diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..4ebf49c5 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +--- +name: publish Python package + +on: + push: + pull_request: + branches: [master] + +jobs: + publish_package: + 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 + python setup.py sdist + python setup.py bdist + + - 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/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" ] }, { 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 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" diff --git a/setup.py b/setup.py index ab9bcb25..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) @@ -24,7 +28,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,13 +38,15 @@ '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, + long_description=long_description, + long_description_content_type="text/x-rst", tests_require=['pytest'], entry_points=''' [console_scripts] 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