Skip to content

Commit

Permalink
Merge pull request #74 from Becksteinlab/auto-deploy
Browse files Browse the repository at this point in the history
- new GHA workflow deploy.yaml using MDAnalysis/pypi-deployment action
- add Trusted Publisher Management for PyPi and TestPyPi (externally done)
- Additional fixes
   - make RTD work again by mamba-installing dependencies
   - update sphinx conf.py
  • Loading branch information
orbeckst authored Oct 13, 2024
2 parents ca280be + 6f49396 commit fe51a91
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 10 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build and upload to PyPi

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

jobs:
test_pypi_push:
environment:
name: TestPyPi
url: https://test.pypi.org/p/propkatraj
permissions:
id-token: write
if: |
github.repository == 'Becksteinlab/propkatraj' &&
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
name: "TestPyPi: Build and upload pure Python wheels"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: testpypi_deploy
uses: MDAnalysis/pypi-deployment@main
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
with:
test_submission: true
package_name: 'propkatraj'
module_name: 'propkatraj'
tests: true

pypi_push:
environment:
name: PyPi
url: https://pypi.org/p/propkatraj
permissions:
id-token: write
if: |
github.repository == 'Becksteinlab/propkatraj' &&
(github.event_name == 'release' && github.event.action == 'published')
name: "PyPi: Build and upload pure Python wheels"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: pypi_deploy
uses: MDAnalysis/pypi-deployment@main
if: github.event_name == 'release' && github.event.action == 'published'
with:
package_name: 'propkatraj'
module_name: 'propkatraj'
tests: true
6 changes: 2 additions & 4 deletions devtools/environment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: propkatraj
channels:
- conda-forge
- defaults
dependencies:
- MDAnalysis>=2.0.0
- MDAnalysisTests>=2.0.0
Expand All @@ -10,6 +9,5 @@ dependencies:
- pytest-cov
- pytest-xdist
- codecov
- pip
- pip:
- propka==3.1
- propka==3.1.0

7 changes: 6 additions & 1 deletion docs/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ name: propkatrajdocs
channels:
- conda-forge
dependencies:
- python
- python >=3.10
- pip
# propkatraj dependencies
- MDAnalysis >=2.0.0
- pandas
- propka==3.1.0
# sphinx on RTD
- sphinx
- sphinx_rtd_theme
- sphinx-sitemap
8 changes: 4 additions & 4 deletions docs/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
# Configuration for intersphinx: refer to the Python standard library
# and other packages used by MDAnalysis
intersphinx_mapping = {
'https://docs.python.org/3/': None,
'https://docs.mdanalysis.org/stable/index.html': None,
'https://numpy.org/doc/stable/': None,
'https://pandas.pydata.org/pandas-docs/stable/': None,
'python': ('https://docs.python.org/3/', None),
'mdanalysis': ('https://docs.mdanalysis.org/stable/', None),
'numpy': ('https://numpy.org/doc/stable/', None),
'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None),
}
10 changes: 9 additions & 1 deletion readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "mambaforge-4.10"
python: "mambaforge-22.9"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/sphinx/conf.py

# Optionally build your docs in additional formats such as PDF
formats:
- pdf

python:
install:
Expand Down

0 comments on commit fe51a91

Please sign in to comment.