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 86a64e3a..3f5bcca4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ API changes: 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..baab310b 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, ), ) @@ -122,7 +124,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={"": [