Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated deployment to PyPI on release #3

Merged
merged 17 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essentially you want to just have this workflow file: https://github.com/MDAnalysis/mda-xdrlib/blob/main/.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