diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f135db17f..cd7cecd35 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -115,3 +115,26 @@ jobs: files: ./reports/coverage.xml fail_ci_if_error: true verbose: true + + deploy_pypi: + needs: tests + if: ${{ success() && (contains(github.ref, 'refs/tags') || github.ref == 'refs/heads/master') }} + runs-on: ubuntu-latest + env: + # override make command to install directly in active python + CONDA_COMMAND: "" + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: "0" + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.7" + - name: Build Distribution Package + run: make install-dev dist + - name: Push Package to PyPi + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/config/magpie.ini b/config/magpie.ini index b2750e877..9d9833006 100644 --- a/config/magpie.ini +++ b/config/magpie.ini @@ -10,7 +10,7 @@ use = egg:Paste#urlmap #/magpie/api = api_app [app:magpie_app] -use = egg:magpie +use = egg:pavics-magpie filter-with = urlprefix pyramid.reload_templates = false diff --git a/docs/installation.rst b/docs/installation.rst index 301674db8..8503311fc 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -29,6 +29,12 @@ with it directly. pip install git+https://github.com/Ouranosinc/Magpie.git +To use the PyPI package, employ the following command instead: + +.. code-block:: console + + pip install pavics-magpie + If you desire to develop code features or fixes with `Magpie`, consider using the ``-e`` option to install a reference to your local installation, avoiding distinct instances locally and in ``site-packages``. For example: @@ -42,7 +48,7 @@ If you have ``conda`` installed, you can create an environment and activate it a conda create -n magpie conda activate magpie - pip install magpie + pip install -e All above operations is done automatically with the following command executed from within a local `Magpie` directory: diff --git a/magpie/__meta__.py b/magpie/__meta__.py index 326e8d766..10cc0e81f 100644 --- a/magpie/__meta__.py +++ b/magpie/__meta__.py @@ -5,6 +5,7 @@ __version__ = "3.24.0" __title__ = "Magpie" __package__ = "magpie" # pylint: disable=W0622 +__distribution__ = "pavics-magpie" # name for pypi __author__ = "Francois-Xavier Derue, Francis Charette-Migneault" __maintainer__ = "Francis Charette-Migneault" __email__ = "francis.charette-migneault@crim.ca" diff --git a/requirements-dev.txt b/requirements-dev.txt index ed7e773a6..7516aee4d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -28,5 +28,6 @@ pytest python2-secrets; python_version <= "3.5" safety tox>=3.0 +twine webtest waitress diff --git a/setup.py b/setup.py index edde264a2..afd17b9c0 100644 --- a/setup.py +++ b/setup.py @@ -187,7 +187,7 @@ def _extra_requirements(base_requirements, other_requirements): setup( # -- meta information -------------------------------------------------- - name=__meta__.__package__, + name=__meta__.__distribution__, version=__meta__.__version__, description=__meta__.__description__, long_description=README + "\n\n" + CHANGES,