Skip to content

Commit e8598b1

Browse files
committed
update Python and workflows
- NEP: removed 3.9, 3.10, added 3.13, 3.14 - update actions versions - updated deployment workflow - based on gridData - removed MDAnalysis deployment action - use trusted publishing (as before) - bump python to 3.14 for workflow steps - do not run online tests for deployment workflow - renamed deploy.yaml -> deploy.yml and setup trusted publishers - improved debugging - verbose output for testpypi deployment to aid debugging - allow testpypi deployment to pass when file already uploaded (testing only)
1 parent 2972714 commit e8598b1

6 files changed

Lines changed: 210 additions & 74 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
name: PyPi Package Deployment
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
release:
8+
types:
9+
- published
10+
11+
concurrency:
12+
group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}"
13+
cancel-in-progress: false
14+
15+
defaults:
16+
run:
17+
shell: bash -l {0}
18+
19+
20+
jobs:
21+
build:
22+
name: Build package
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v6
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v6
30+
with:
31+
python-version: "3.14"
32+
33+
- name: Install build dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install build twine
37+
38+
- name: Build package (binary wheel and source distribution package)
39+
run: |
40+
python -m build
41+
42+
- name: Check package
43+
run: |
44+
twine check dist/*
45+
46+
- name: Upload dist files
47+
uses: actions/upload-artifact@v7
48+
with:
49+
name: dist-files
50+
path: dist/
51+
retention-days: 1
52+
53+
test-pytest:
54+
name: Run tests
55+
runs-on: ubuntu-latest
56+
needs: build
57+
steps:
58+
- name: Set up Python
59+
uses: actions/setup-python@v6
60+
with:
61+
python-version: "3.14"
62+
63+
- name: Download dist files
64+
uses: actions/download-artifact@v8
65+
with:
66+
name: dist-files
67+
path: dist/
68+
69+
- name: Install package with test dependencies and tests
70+
run: |
71+
python -m pip install --upgrade pip
72+
WHEEL_FILE=$(ls dist/*.whl)
73+
pip install "$WHEEL_FILE"[test]
74+
75+
- name: Test import
76+
run: |
77+
python -c "import MDAnalysisData; print(f'Package {MDAnalysisData.__version__} imported successfully')"
78+
79+
- name: Run basic tests
80+
run: |
81+
pytest --verbose -m "not online" --pyargs MDAnalysisData
82+
83+
deploy-testpypi:
84+
name: Deploy to TestPyPI
85+
runs-on: ubuntu-latest
86+
needs: [build, test-pytest]
87+
if: |
88+
github.repository == 'MDAnalysis/MDAnalysisData' &&
89+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
90+
environment:
91+
name: testpypi
92+
url: https://test.pypi.org/p/MDAnalysisData
93+
permissions:
94+
id-token: write # IMPORTANT: mandatory for trusted publishing
95+
steps:
96+
- name: Download dist files
97+
uses: actions/download-artifact@v8
98+
with:
99+
name: dist-files
100+
path: dist/
101+
102+
- name: Publish to TestPyPI
103+
uses: pypa/gh-action-pypi-publish@v1.13.0
104+
with:
105+
repository-url: https://test.pypi.org/legacy/
106+
verbose: true # useful debugging info (eg wrong classifiers)
107+
skip-existing: true # allows repeated testing with same tag
108+
109+
deploy-pypi:
110+
name: Deploy to PyPI
111+
runs-on: ubuntu-latest
112+
needs: [build, test-pytest]
113+
if: |
114+
github.repository == 'MDAnalysis/MDAnalysisData' &&
115+
(github.event_name == 'release' && github.event.action == 'published')
116+
environment:
117+
name: pypi
118+
url: https://pypi.org/p/MDAnalysisData
119+
permissions:
120+
id-token: write # IMPORTANT: mandatory for trusted publishing
121+
steps:
122+
- name: Download dist files
123+
uses: actions/download-artifact@v8
124+
with:
125+
name: dist-files
126+
path: dist/
127+
128+
- name: Publish to PyPI
129+
uses: pypa/gh-action-pypi-publish@v1.13.0
130+
131+
test-deployed-testpypi:
132+
name: Test deployed package (TestPyPI)
133+
runs-on: ${{ matrix.os }}
134+
strategy:
135+
fail-fast: false
136+
matrix:
137+
os: [ubuntu-latest, macos-latest]
138+
needs: deploy-testpypi
139+
if: |
140+
github.repository == 'MDAnalysis/MDAnalysisData' &&
141+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
142+
steps:
143+
- name: Set up Python
144+
uses: actions/setup-python@v6
145+
with:
146+
python-version: "3.14"
147+
148+
- name: Install from TestPyPI
149+
run: |
150+
python -m pip install --upgrade pip
151+
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ MDAnalysisData[test]
152+
153+
- name: Test import
154+
run: |
155+
python -c "import MDAnalysisData; print(f'Package {MDAnalysisData.__version__} imported successfully from TestPyPi')"
156+
157+
- name: Run basic tests
158+
run: |
159+
pytest --verbose -m "not online" --pyargs MDAnalysisData
160+
161+
test-deployed-pypi:
162+
name: Test deployed package (PyPI)
163+
runs-on: ${{ matrix.os }}
164+
strategy:
165+
fail-fast: false
166+
matrix:
167+
os: [ubuntu-latest, macos-latest]
168+
needs: deploy-pypi
169+
if: |
170+
github.repository == 'MDAnalysis/MDAnalysisData' &&
171+
(github.event_name == 'release' && github.event.action == 'published')
172+
steps:
173+
- name: Set up Python
174+
uses: actions/setup-python@v6
175+
with:
176+
python-version: "3.14"
177+
178+
- name: Install from PyPI
179+
run: |
180+
python -m pip install --upgrade pip
181+
pip install MDAnalysisData[test]
182+
183+
- name: Test import
184+
run: |
185+
python -c "import MDAnalysisData; print(f'Package {MDAnalysisData.__version__} imported successfully from PyPi')"
186+
187+
- name: Run basic tests
188+
run: |
189+
pytest --verbose -m "not online" --pyargs MDAnalysisData

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v6
1818
with:
1919
fetch-depth: 0
2020

2121
- name: Setup python
22-
uses: actions/setup-python@v4
22+
uses: actions/setup-python@v6
2323
with:
24-
python-version: 3.9
24+
python-version: 3.14
2525

2626
- name: Display Python version
2727
run: python -c "import sys; print(sys.version)"
@@ -44,7 +44,7 @@ jobs:
4444
make html
4545
4646
- name: deploy docs
47-
uses: peaceiris/actions-gh-pages@v3
47+
uses: peaceiris/actions-gh-pages@v4
4848
with:
4949
github_token: ${{ secrets.GITHUB_TOKEN }}
5050
publish_dir: ./docs/_build/html

.github/workflows/gh-ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,24 @@ jobs:
2424
fail-fast: false
2525
matrix:
2626
os: [ubuntu-latest]
27-
python-version: ["3.9", "3.10", "3.11", "3.12"]
27+
python-version: ["3.11", "3.12", "3.13", "3.14"]
2828
include:
2929
- os: macOS-latest
30-
python-version: "3.9"
30+
python-version: "3.11"
3131
- os: macOS-latest
32-
python-version: "3.12"
32+
python-version: "3.14"
3333
- os: windows-latest
34-
python-version: "3.9"
34+
python-version: "3.11"
3535
- os: windows-latest
36-
python-version: "3.12"
36+
python-version: "3.14"
3737

3838
steps:
39-
- uses: actions/checkout@v4
39+
- uses: actions/checkout@v6
4040
with:
4141
fetch-depth: 0
4242

4343
- name: Setup python
44-
uses: actions/setup-python@v5
44+
uses: actions/setup-python@v6
4545
with:
4646
python-version: ${{ matrix.python-version }}
4747

@@ -55,7 +55,7 @@ jobs:
5555
5656
- name: Install package dependencies
5757
run: |
58-
python -m pip install six setuptools tqdm
58+
python -m pip install setuptools tqdm
5959
6060
- name: Install package
6161
run: |
@@ -67,7 +67,7 @@ jobs:
6767
6868
- name: Codecov
6969
if: github.event_name != 'schedule'
70-
uses: codecov/codecov-action@v4
70+
uses: codecov/codecov-action@v6
7171
with:
7272
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
7373
token: ${{ secrets.CODECOV_TOKEN }}

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Unreleased
88

9-
## Changes
9+
### Changes
10+
- Update package to only support NEP29 range (Python 3.11 - 3.14 as of writing)
1011
- Update packaging to be PEP518 compliant.
1112

13+
### Fixes
14+
- removed deprecated pkg_resources use (#75)
15+
1216
## [0.9.0] - 2023-10-30
1317

1418
### Changes

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ classifiers = [
2525
"Operating System :: Microsoft :: Windows ",
2626
"Programming Language :: Python",
2727
"Programming Language :: Python :: 3",
28-
"Programming Language :: Python :: 3.9",
29-
"Programming Language :: Python :: 3.10",
3028
"Programming Language :: Python :: 3.11",
3129
"Programming Language :: Python :: 3.12",
30+
"Programming Language :: Python :: 3.13",
31+
"Programming Language :: Python :: 3.14",
3232
"Topic :: Scientific/Engineering",
3333
"Topic :: Scientific/Engineering :: Bio-Informatics",
3434
"Topic :: Scientific/Engineering :: Chemistry",
3535
"Topic :: Software Development :: Libraries :: Python Modules",
3636
]
3737
readme = {file = "README.md", content-type = "text/markdown"}
38-
requires-python = ">=3.9"
38+
requires-python = ">=3.11"
3939
dependencies = [
4040
"tqdm",
4141
]

0 commit comments

Comments
 (0)