Skip to content
Open
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
4 changes: 3 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[run]
branch = True
source = MDAnalysis
plugins = Cython.Coverage
# Cython.Coverage plugin disabled for Cython >= 3.1.0 compatibility (Issue #5057).
# Cython 3.1+ has worker crash bugs with linetrace which is required by the
# Cython.Coverage plugin, so we disable the plugin to prevent test crashes.
Comment on lines +4 to +6

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't believe that just disabling coverage is the solution to this issue.

omit =
*/MDAnalysis/tests/*
*/legacy/*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-ci-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ jobs:
- name: install_deps
shell: bash
run: |
pip install pytest-xdist pytest-timeout "numpy<2.3" "cython<3.1" wheel "setuptools>=40.9.0" packaging
pip install pytest-xdist pytest-timeout "numpy<2.3" cython wheel "setuptools>=40.9.0" packaging

- name: install_mdanalysis
shell: bash
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/gh-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,36 +31,27 @@ jobs:
python-version: ["3.11", "3.12", "3.13"]
full-deps: [true, ]
codecov: [true, ]
cython: ["cython<3.1", ]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The testing of cython < 3.1 and cython >3.1 is intentional.

include:
# Including 3.14 and 3.11 without coverage
# and cython >=3.1 to deal temporarily with
# keeping on testing Cython whilst issue #5057
# is not fixed
- name: python_314_nocov
os: ubuntu-latest
python-version: "3.14"
full-deps: false
codecov: false
cython: "cython>=3.1"
- name: python_311_nocov
os: ubuntu-latest
python-version: "3.11"
full-deps: false
codecov: false
cython: "cython>=3.1"
- name: macOS_14_arm64_py313
os: macOS-14
python-version: "3.13"
full-deps: false
codecov: true
cython: "cython<3.1"
- name: ubuntu_arm
os: ubuntu-24.04-arm
python-version: "3.13"
full-deps: false
codecov: false
cython: "cython>3.1"
- name: numpy_min
os: ubuntu-latest
python-version: "3.11"
Expand Down Expand Up @@ -105,7 +96,6 @@ jobs:
full-deps: ${{ matrix.full-deps }}
# disable GSD because it occasionally introduce hanging in testing #4209
gsd: ''
# pin cython
cython: ${{ matrix.cython }}
# in most cases will just default to empty, i.e. pick up max version from other deps
numpy: ${{ matrix.numpy }}
Expand Down
1 change: 1 addition & 0 deletions package/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ Chronological list of authors
- Apoorva Verma
- Aryaman Chaudhri
- Francesco Siciliani
- Akshit Boora

External code
-------------
Expand Down
4 changes: 3 additions & 1 deletion package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ The rules for this file:
spyke7, talagayev, tanii1125, BradyAJohnston, hejamu, jeremyleung521,
harshitgajjela-droid, kunjsinha, aygarwal, jauy123, Dreamstick9,
ollyfutur, Amarendra22, charity-g, ParthUppal523, apoorva-01, RMeli,
raulloiscuns, Aryaman-Chaudhri, sici17
raulloiscuns, Aryaman-Chaudhri, sici17, AkshitBoora

* 2.11.0

Fixes
* Unpinned Cython version constraint and restored support for Cython >= 3.1.0
(Issue #5057)
* Mass (u) has been added to MDAnalysis base units and clarified that physical
constants use CODATA 2010 values (Issue #3944, PR #5439)
* Added `.gitattributes` to enforce LF (\n) as line endings and renormalized
Expand Down
17 changes: 14 additions & 3 deletions package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@
)
)
cython_found = False
cython_linetrace = bool(os.environ.get("CYTHON_TRACE_NOGIL", False))
if Version(Cython.__version__) >= Version("3.1.0"):
# Cython 3.1+ has worker crash bugs with linetrace (Issue #5057)
cython_linetrace = False

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This would change the tracing pytest behavior with Cython 3.1+ from a deadlock to a silent failure to perform the coverage tracing, which I'm not sure is desirable. One could even argue for a "fail fast and early" design here, where you instead go in the opposite direction and refuse to build with a clear failure under the problematic circumstances.

Seems like the desired solution would be to fix the upstream issue (cython/cython#6658) and then always require a very recent version of Cython, which is generally considered quite acceptable b/c it is a build time/dev dep. For example, SciPy requires 3.2.0+ already: https://github.com/scipy/scipy/blob/main/pyproject.toml#L22

else:
cython_linetrace = bool(os.environ.get("CYTHON_TRACE_NOGIL", False))
except ImportError:
cython_found = False
if not is_release:
Expand Down Expand Up @@ -353,8 +357,15 @@ def extensions(config):
mathlib = ["m"]

if cython_linetrace:
extra_compile_args.append("-DCYTHON_TRACE_NOGIL")
cpp_extra_compile_args.append("-DCYTHON_TRACE_NOGIL")
extra_compile_args.extend(
["-DCYTHON_TRACE_NOGIL=1", "-DCYTHON_TRACE=1"]
)
cpp_extra_compile_args.extend(
["-DCYTHON_TRACE_NOGIL=1", "-DCYTHON_TRACE=1"]
)
encore_compile_args.extend(
["-DCYTHON_TRACE_NOGIL=1", "-DCYTHON_TRACE=1"]
)

libdcd = MDAExtension(
"MDAnalysis.lib.formats.libdcd",
Expand Down
Loading