Skip to content

Commit

Permalink
Merge pull request #447 from vsnever/enhancement/cython3_support
Browse files Browse the repository at this point in the history
Require Cython 3 as a dependency
  • Loading branch information
jacklovell authored Aug 1, 2024
2 parents 58ef28e + 239a6bf commit 895ef8e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cython>=0.28
cython~=3.0
numpy>=1.14,<2.0
scipy
matplotlib
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -61,6 +62,7 @@
[pyx_file],
include_dirs=compilation_includes,
extra_compile_args=compilation_args,
define_macros=macros,
),
)

Expand Down Expand Up @@ -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={"": [
Expand Down

0 comments on commit 895ef8e

Please sign in to comment.