Skip to content

Commit

Permalink
Automatic deployment to PyPI on release (#3)
Browse files Browse the repository at this point in the history
* Use MDAnalysis deployment action
* Updated docs to reflect PyPI installations
  • Loading branch information
ianmkenney authored Oct 13, 2023
1 parent 3267dee commit a93a301
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 5 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and upload to PyPi

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

jobs:
pypi_push:
environment: deploy
if: "github.repository == 'MDAnalysis/PathSimAnalysis'"
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
tests: true
test_deps: 'pytest MDAnalysisTests'
package_name: 'pathsimanalysis'

- 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: 'pathsimanalysis'
tests: false
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 PathSimAnalysis is available on [PyPI](https://pypi.org/project/pathsimanalysis/) and can be installed with:

```
pip install pathsimanalysis
```

##### Install from source

To build the package from source, run:

```
Expand Down
4 changes: 4 additions & 0 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ dependencies:

# MDAnalysis
- MDAnalysis
- scipy>=1.5.0
- matplotlib>=1.5.1
- numpy>=1.22.3


# Testing
- MDAnalysisTests
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 PathSimAnalysis.
Installation
------------

PathSimAnalysis is currently only installable from source.
PyPi
~~~~

PathSimAnalysis can be installed from PyPI with:

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

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

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

.. code-block:: bash
git clone --depth=1 https://github.com/MDAnalysis/PathSimAnalysis
cd PathSimAnalysis
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 pathsimanalysis.tests
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ readme = "README.md"
requires-python = ">=3.9"
dependencies = [
"MDAnalysis>=2.0.0",
"scipy>=1.5.0",
"matplotlib>=1.5.1",
"numpy>=1.22.3",
]
keywords = [
"molecular simulations",
Expand All @@ -39,9 +42,9 @@ doc = [
"sphinx_rtd_theme",
]

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

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

0 comments on commit a93a301

Please sign in to comment.