From 99c9df49ef13cb813fc48786f9e7ebdeeae0e39d Mon Sep 17 00:00:00 2001 From: vsnever Date: Sun, 14 Jul 2024 23:03:37 +0200 Subject: [PATCH 1/2] Add cython~=3 to the requirements. --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 1 + pyproject.toml | 2 +- requirements.txt | 2 +- setup.py | 7 +++++-- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd3ec227..eb7de4f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install Python dependencies - run: python -m pip install --prefer-binary cython>=0.28 ${{ matrix.numpy-version }} scipy matplotlib "pyopencl[pocl]>=2022.2.4" + run: python -m pip install --prefer-binary cython~=3.0 ${{ matrix.numpy-version }} scipy matplotlib "pyopencl[pocl]>=2022.2.4" - name: Install Raysect from pypi run: pip install raysect==0.8.1 - name: Build cherab diff --git a/CHANGELOG.md b/CHANGELOG.md index c70837fb..35e3e6d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Release 1.5.0 (TBD) New: * Support Raysect 0.8 +* Cython version 3 is now required to build the package. * Add custom line shape support to BeamCXLine model. (#394) * Add PeriodicTransformXD and VectorPeriodicTransformXD functions to support the data simulated with periodic boundary conditions. (#387) * Add CylindricalTransform and VectorCylindricalTransform to transform functions from cylindrical to Cartesian coordinates. (#387) diff --git a/pyproject.toml b/pyproject.toml index a4eabed0..ea724622 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools>=62.3", "oldest-supported-numpy", "cython>=0.28", "raysect==0.8.1"] +requires = ["setuptools>=62.3", "oldest-supported-numpy", "cython~=3.0", "raysect==0.8.1"] build-backend="setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt index 3e98c385..e070e4ce 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -cython>=0.28 +cython~=3.0 numpy>=1.14,<2.0 scipy matplotlib diff --git a/setup.py b/setup.py index eb56a797..b9058c27 100644 --- a/setup.py +++ b/setup.py @@ -33,8 +33,9 @@ source_paths = ["cherab", "demos"] compilation_includes = [".", numpy.get_include()] -compilation_args = ["-O3"] +compilation_args = ["-O3", "-Wno-unreachable-code-fallthrough"] cython_directives = {"language_level": 3} +macros = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")] setup_path = path.dirname(path.abspath(__file__)) num_processes = int(os.getenv("CHERAB_NCPU", "-1")) if num_processes == -1: @@ -61,6 +62,7 @@ [pyx_file], include_dirs=compilation_includes, extra_compile_args=compilation_args, + define_macros=macros, ), ) @@ -115,6 +117,7 @@ long_description=long_description, long_description_content_type="text/markdown", install_requires=[ + "cython~=3.0", "numpy>=1.14,<2.0", "scipy", "matplotlib", @@ -122,7 +125,7 @@ ], extras_require={ # Running ./dev/build_docs.sh runs setup.py, which requires cython. - "docs": ["cython", "sphinx", "sphinx-rtd-theme", "sphinx-tabs"], + "docs": ["cython~=3.0", "sphinx", "sphinx-rtd-theme", "sphinx-tabs"], }, packages=find_packages(include=["cherab*"]), package_data={"": [ From 239a6bf5ac63c074676abf0be81a29b0764cac81 Mon Sep 17 00:00:00 2001 From: vsnever Date: Thu, 1 Aug 2024 13:17:00 +0200 Subject: [PATCH 2/2] Remove Cython from install_requires. --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index b9058c27..baab310b 100644 --- a/setup.py +++ b/setup.py @@ -117,7 +117,6 @@ long_description=long_description, long_description_content_type="text/markdown", install_requires=[ - "cython~=3.0", "numpy>=1.14,<2.0", "scipy", "matplotlib",