From fa953efcdbec88becfd95dee71a7088d142a0b81 Mon Sep 17 00:00:00 2001 From: Johan Van de Wauw Date: Mon, 12 Dec 2022 11:05:02 +0100 Subject: [PATCH 1/9] Fix versions for windows, remove obsolete link --- docs/installation.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index 72643b2c..a17599b1 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -6,9 +6,9 @@ Windows ======= The recommended way of installing niche on windows uses miniconda_ for installation. -The recommended version is `64 bit with Python 3.7`__. +The recommended version is `64 bit with Python 3.9`__. -__ https://repo.continuum.io/miniconda/Miniconda3-4.7.10-Windows-x86_64.exe +__ https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-Windows-x86_64.exe .. _Miniconda: https://conda.io/miniconda.html The installation can proceed without administrator rights, keep the default options. After miniconda is installed, @@ -62,9 +62,8 @@ installation. Upgrading ========= -Existing installations of Niche can be updated using pip (for windows, run -from the Anaconda prompt, after downloading the environment file. -https://cdn.rawgit.com/inbo/niche_vlaanderen/master/docs/niche_env.yml +Existing installations of Niche can be updated using pip (run +from the Anaconda prompt. .. code-block:: shell From 913ae09613c9530810ba9ec65315151f467ac7a6 Mon Sep 17 00:00:00 2001 From: Johan Van de Wauw Date: Mon, 12 Dec 2022 11:28:44 +0100 Subject: [PATCH 2/9] Fix redirecting urls --- docs/getting_started.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started.ipynb b/docs/getting_started.ipynb index 4795702a..f6843e58 100644 --- a/docs/getting_started.ipynb +++ b/docs/getting_started.ipynb @@ -217,7 +217,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "By using the pandas [pivot_table](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.pivot_table.html#pandas.DataFrame.pivot_table) method, we can create a summarized table. Note that only the first 5 rows are shown because we use the [head](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.head.html) function" + "By using the pandas [pivot_table](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.pivot_table.html) method, we can create a summarized table. Note that only the first 5 rows are shown because we use the [head](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.head.html) function" ] }, { From 254c45872e36e523605a51399e384743df226909 Mon Sep 17 00:00:00 2001 From: Johan Van de Wauw Date: Mon, 12 Dec 2022 13:26:37 +0100 Subject: [PATCH 3/9] Add pypi publishing --- .github/workflows/publish.yml | 24 ++++++++++++++++++++++++ niche_vlaanderen/__init__.py | 2 +- niche_vlaanderen/version.py | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..5363385a --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,24 @@ + + linux-pip-tests: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9"] + fail-fast: [true] + + steps: + - uses: actions/checkout@v2 + - name: build package + run: | + sudo apt-get -y install libgdal-dev gdal-bin pandoc + python -m pip install --upgrade pip + pip install coveralls wheel + pip install -r dev-requirements.txt + pytest --cov niche_vlaanderen --verbose --tb=long + python setup.py build + + - name: Publish package + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/niche_vlaanderen/__init__.py b/niche_vlaanderen/__init__.py index 02c9abb1..b2286f5c 100644 --- a/niche_vlaanderen/__init__.py +++ b/niche_vlaanderen/__init__.py @@ -3,7 +3,7 @@ from .acidity import Acidity # noqa from .nutrient_level import NutrientLevel # noqa from .vegetation import Vegetation # noqa -from .version import __version__ # noqa +from ._version import __version__ # noqa from .flooding import Flooding # noqa __all__ = [ diff --git a/niche_vlaanderen/version.py b/niche_vlaanderen/version.py index f9014086..6e914700 100644 --- a/niche_vlaanderen/version.py +++ b/niche_vlaanderen/version.py @@ -1 +1 @@ -__version__ = "1.1" +__version__ = "1.2b1" From 016740d3f4eade97ab1069a9f6355d8f5b7804aa Mon Sep 17 00:00:00 2001 From: Johan Van de Wauw Date: Mon, 12 Dec 2022 13:33:39 +0100 Subject: [PATCH 4/9] Fix version import --- niche_vlaanderen/__init__.py | 2 +- tests/test_cli.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/niche_vlaanderen/__init__.py b/niche_vlaanderen/__init__.py index b2286f5c..02c9abb1 100644 --- a/niche_vlaanderen/__init__.py +++ b/niche_vlaanderen/__init__.py @@ -3,7 +3,7 @@ from .acidity import Acidity # noqa from .nutrient_level import NutrientLevel # noqa from .vegetation import Vegetation # noqa -from ._version import __version__ # noqa +from .version import __version__ # noqa from .flooding import Flooding # noqa __all__ = [ diff --git a/tests/test_cli.py b/tests/test_cli.py index c3a41562..29215db8 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -44,4 +44,4 @@ def test_example_yml(): def test_get_version(): runner = CliRunner() result = runner.invoke(nv_cli.cli, ["--version"]) - assert "niche_vlaanderen version: 1.1" in result.output + assert "niche_vlaanderen version: " in result.output From f3d7aa252c283ee26c4c674f6ad91e9dc8fdec65 Mon Sep 17 00:00:00 2001 From: Johan Van de Wauw Date: Mon, 12 Dec 2022 16:10:14 +0100 Subject: [PATCH 5/9] Fix workflow --- .github/workflows/publish.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5363385a..cf5d4570 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,5 +1,12 @@ +--- +name: publish Python package - linux-pip-tests: +on: + push: + pull_request: + branches: [master] + +publish_package: runs-on: ubuntu-latest strategy: matrix: From 7df049cc777675a5db4aa25f4dc1304e9b57faee Mon Sep 17 00:00:00 2001 From: Johan Van de Wauw Date: Mon, 9 Jan 2023 14:57:58 +0100 Subject: [PATCH 6/9] Correct supported Python versions --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index ab9bcb25..6fd2d4c9 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ setup(name='niche_vlaanderen', version=version['__version__'], description='NICHE Vlaanderen: hydro-ecological model for valley-ecosystems in Flanders', - url='https://github.com/INBO/niche_vlaanderen', + url='https://github.com/inbo/niche_vlaanderen', author='Johan Van de Wauw', author_email='johan.vandewauw@inbo.be', license='MIT', @@ -34,11 +34,11 @@ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], include_package_data=True, tests_require=['pytest'], From b016ab130db134d51ed040e359a2172443b7164b Mon Sep 17 00:00:00 2001 From: Johan Van de Wauw Date: Mon, 30 Jan 2023 10:11:15 +0100 Subject: [PATCH 7/9] Fix workflow syntax --- .github/workflows/publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cf5d4570..003652fb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,7 +6,8 @@ on: pull_request: branches: [master] -publish_package: +jobs: + publish_package: runs-on: ubuntu-latest strategy: matrix: From 3e87e3348d86ace97959e296093b7ae8c46ed204 Mon Sep 17 00:00:00 2001 From: Johan Van de Wauw Date: Mon, 30 Jan 2023 10:32:36 +0100 Subject: [PATCH 8/9] Try to get pypi package build --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 003652fb..4ebf49c5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,6 +24,8 @@ jobs: pip install -r dev-requirements.txt pytest --cov niche_vlaanderen --verbose --tb=long python setup.py build + python setup.py sdist + python setup.py bdist - name: Publish package if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') From 1383f1d8eeade9b58e377a3d701fd344bb49e32c Mon Sep 17 00:00:00 2001 From: Johan Van de Wauw Date: Mon, 30 Jan 2023 11:35:36 +0100 Subject: [PATCH 9/9] Set long description for pypi --- setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.py b/setup.py index 6fd2d4c9..d7f392ee 100644 --- a/setup.py +++ b/setup.py @@ -3,8 +3,12 @@ import sys from setuptools import setup, find_packages +from pathlib import Path + version = {} + +long_description = (Path(__file__).parent / "README.rst").read_text() with open("niche_vlaanderen/version.py") as fp: exec(fp.read(), version) @@ -41,6 +45,8 @@ 'Programming Language :: Python :: 3.11', ], include_package_data=True, + long_description=long_description, + long_description_content_type="text/x-rst", tests_require=['pytest'], entry_points=''' [console_scripts]