Skip to content

Commit

Permalink
Add py3.13 support w/ minimal deps (#4732)
Browse files Browse the repository at this point in the history
* Add Python 3.13 to minimal CI testing, and include some minor test shims to accommodate.
  • Loading branch information
IAlibay authored Oct 13, 2024
1 parent 740e74e commit 599c8db
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- [macos-12, macosx_*, x86_64]
- [windows-2019, win_amd64, AMD64]
- [macos-14, macosx_*, arm64]
python: ["cp310", "cp311", "cp312"]
python: ["cp310", "cp311", "cp312", "cp313"]
defaults:
run:
working-directory: ./package
Expand Down Expand Up @@ -243,7 +243,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
type: ["FULL", "MIN"]
exclude:
# Multiple deps don't like windows
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/gh-ci-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ jobs:
os-type: "ubuntu"

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

# minimally install nightly wheels & core deps
- name: nightly_wheels
Expand Down Expand Up @@ -197,7 +195,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/gh-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ jobs:
full-deps: [true, ]
codecov: [true, ]
include:
- name: python_313
os: ubuntu-latest
python-version: "3.13"
full-deps: false
codecov: true
- name: macOS_monterey_py311
os: macOS-12
python-version: "3.12"
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
PYTHON_VERSION: '3.12'
PYTHON_ARCH: 'x64'
BUILD_TYPE: 'wheel'
NUMPY_MIN: '1.26.0'
NUMPY_MIN: '2.1.0'
imageName: 'ubuntu-latest'
Linux-Python310-64bit-full-wheel:
PYTHON_VERSION: '3.10'
Expand Down
1 change: 1 addition & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Fixes
* Fix groups.py doctests using sphinx directives (Issue #3925, PR #4374)

Enhancements
* MDAnalysis now supports Python 3.13 (PR #4732)
* Introduce parallelization API to `AnalysisBase` and to `analysis.rms.RMSD` class
(Issue #4158, PR #4304)
* Enables parallelization for analysis.gnm.GNMAnalysis (Issue #4672)
Expand Down
3 changes: 2 additions & 1 deletion package/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ classifiers = [
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: C',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Bio-Informatics',
Expand Down Expand Up @@ -124,6 +125,6 @@ MDAnalysis = [

[tool.black]
line-length = 79
target-version = ['py310', 'py311', 'py312']
target-version = ['py310', 'py311', 'py312', 'py313']
extend-exclude = '.'
required-version = '24'
8 changes: 4 additions & 4 deletions testsuite/MDAnalysisTests/analysis/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,17 +345,17 @@ def test_verbose_progressbar(u, capsys):
def test_verbose_progressbar_run(u, capsys):
FrameAnalysis(u.trajectory).run(verbose=True)
_, err = capsys.readouterr()
expected = u'100%|██████████| 98/98 [00:00<00:00, 8799.49it/s]'
expected = u'100%|██████████'
actual = err.strip().split('\r')[-1]
assert actual[:24] == expected[:24]
assert actual[:15] == expected

def test_verbose_progressbar_run_with_kwargs(u, capsys):
FrameAnalysis(u.trajectory).run(
verbose=True, progressbar_kwargs={'desc': 'custom'})
_, err = capsys.readouterr()
expected = u'custom: 100%|██████████| 98/98 [00:00<00:00, 8799.49it/s]'
expected = u'custom: 100%|██████████'
actual = err.strip().split('\r')[-1]
assert actual[:30] == expected[:30]
assert actual[:23] == expected


def test_progressbar_multiprocessing(u):
Expand Down
4 changes: 2 additions & 2 deletions testsuite/MDAnalysisTests/lib/test_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def test_output(self, capsys):
for i in ProgressBar(list(range(10))):
pass
out, err = capsys.readouterr()
expected = u'100%|██████████| 10/10 [00:00<00:00, 583.67it/s]'
expected = u'100%|██████████'
actual = err.strip().split('\r')[-1]
assert actual[:24] == expected[:24]
assert actual[:15] == expected

def test_disable(self, capsys):
for i in ProgressBar(list(range(10)), disable=True):
Expand Down

0 comments on commit 599c8db

Please sign in to comment.