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

Add py3.13 support w/ minimal deps #4732

Merged
merged 7 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
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'
Copy link
Member

Choose a reason for hiding this comment

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

did you mean to change to 3.13 above? I don't think that's a blocker here though

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]'
Copy link
Member

Choose a reason for hiding this comment

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

I think the reason why the full output was there originally was to give devs an idea what it looks like even if other parts could not be reliably tested.

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately the py3.13 behaviour changed here and I can't work out exactly why - I'm not sure if there's a better way to deal with this without having an explicit python version check :/

expected = u'100%|██████████'
actual = err.strip().split('\r')[-1]
assert actual[:24] == expected[:24]
assert expected == actual[:15]
Copy link
Member

Choose a reason for hiding this comment

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

Why did you switch actual and expected?

Doesn't really matter except for consistency throughout because in testsuite/MDAnalysisTests/lib/test_log.py it's still actual == expected.

Copy link
Member Author

Choose a reason for hiding this comment

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

I had originally switched it to a expected in actual check, but decided to revert back to an equality check.

Copy link
Member Author

Choose a reason for hiding this comment

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

Reverted the order in the latest commit.


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 expected == actual[:23]


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
Loading