Skip to content

Commit

Permalink
Added PyPI deployment workflow (#8)
Browse files Browse the repository at this point in the history
* Added PyPI deployment workflow
* Updated installation instructions in docs + README
* Updated pyproject.toml
  • Loading branch information
ianmkenney authored Oct 13, 2023
1 parent 8f58202 commit fe14a20
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 5 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and upload to PyPi

on:
push:
tags:
- "*"
release:
types:
- published

jobs:
pypi_push:
environment: deploy
if: "github.repository == 'MDAnalysis/waterdynamics'"
name: Build, upload and test pure Python wheels
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: testpypi_deploy
uses: MDAnalysis/pypi-deployment@main
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.TEST_PYPI_API_TOKEN }}
test_submission: true
test_deps: 'pytest MDAnalysisTests'
package_name: 'waterdynamics'

- name: pypi_deploy
uses: MDAnalysis/pypi-deployment@main
if: github.event_name == 'release' && github.event.action == 'published'
with:
token: ${{ secrets.PYPI_API_TOKEN }}
package_name: 'waterdynamics'
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ conda deactivate

#### With pip

##### Install from PyPI

The latest release of waterdynamics is available on [PyPI](https://pypi.org/project/waterdynamics/) and can be installed with:

```
pip install waterdynamics
```

##### Install from source

To build the package from source, run:

```
Expand Down
2 changes: 2 additions & 0 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ dependencies:
# MDAnalysis
- MDAnalysis
- MDAnalysisTests
- numpy>=1.22.3


# Testing
- pytest
Expand Down
31 changes: 29 additions & 2 deletions docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,37 @@ This page details how to get started with waterdynamics.
Installation
------------

Water dynamics can be installed from source.
PyPi
~~~~

The waterdyanmics package can be installed from PyPI with:

.. code-block:: bash
pip install waterdynamics
If you would like to test your installation, use the `test` optional dependencies and run the tests:

.. code-block:: bash
pip install "waterdynamics[test]"
pytest --pyargs waterdynamics.tests
From source
~~~~~~~~~~~

If you want the latest (non-release) version of waterdynamics, you should install the package from source.

.. code-block:: bash
git clone https://github.com/MDAnalysis/waterdynamics
cd waterdynamics
pip install .
pip install .
If you want to run tests on your installation, install the `test` dependencies and run the tests:

.. code-block:: bash
pip install ".[test]"
pytest --pyargs waterdynamics.tests
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ readme = "README.md"
requires-python = ">=3.9"
dependencies = [
"MDAnalysis>=2.0.0",
"numpy>=1.22.3",
]
keywords = [
"molecular simulations",
Expand All @@ -39,9 +40,9 @@ doc = [
"sphinx_rtd_theme",
]

# [project.urls]
# source = "https://github.com/MDAnalysis/waterdynamics"
# documentation = "https://waterdynamics.readthedocs.io"
[project.urls]
source = "https://github.com/MDAnalysis/waterdynamics"
documentation = "https://mdanalysis.org/waterdynamics"

[tool.pytest.ini_options]
minversion = "6.0"
Expand Down

0 comments on commit fe14a20

Please sign in to comment.