diff --git a/.coveragerc b/.coveragerc index f87af87aa8..b7e90a3600 100644 --- a/.coveragerc +++ b/.coveragerc @@ -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. omit = */MDAnalysis/tests/* */legacy/* diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index 76f3b518f3..654d86d43a 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -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 diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index 99894ca434..0011bb3093 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -31,36 +31,27 @@ jobs: python-version: ["3.11", "3.12", "3.13"] full-deps: [true, ] codecov: [true, ] - cython: ["cython<3.1", ] 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" @@ -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 }} diff --git a/package/AUTHORS b/package/AUTHORS index c8ba87c062..dba8be1110 100644 --- a/package/AUTHORS +++ b/package/AUTHORS @@ -285,6 +285,7 @@ Chronological list of authors - Apoorva Verma - Aryaman Chaudhri - Francesco Siciliani + - Akshit Boora External code ------------- diff --git a/package/CHANGELOG b/package/CHANGELOG index 45647f3904..8911a9d685 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -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 diff --git a/package/setup.py b/package/setup.py index f9b7b4a9e7..6beab963f1 100755 --- a/package/setup.py +++ b/package/setup.py @@ -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 + else: + cython_linetrace = bool(os.environ.get("CYTHON_TRACE_NOGIL", False)) except ImportError: cython_found = False if not is_release: @@ -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",