Skip to content

Commit

Permalink
Cythonize is now implicit thanks to build-system.
Browse files Browse the repository at this point in the history
  • Loading branch information
trexfeathers committed Sep 24, 2024
1 parent e293308 commit 31bd497
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

from setuptools import Command, Extension, setup

# Default to using cython, but use the .c files if it doesn't exist
try:
from Cython.Build import cythonize
except ImportError:
cythonize = False

COMPILER_DIRECTIVES = {}
# This Cython macro disables a build warning, obsolete with Cython>=3
# see : https://cython.readthedocs.io/en/latest/src/userguide/migrating_to_cy30.html#numpy-c-api
Expand Down Expand Up @@ -130,7 +124,7 @@ def _set_builtin(name, value):

udunits_ext = Extension(
f"{PACKAGE}._udunits2",
[str(Path(f"{PACKAGE}") / f"_udunits2.{'pyx' if cythonize else 'c'}")],
[str(Path(f"{PACKAGE}") / "_udunits2.pyx")],
include_dirs=get_include_dirs(),
library_dirs=library_dirs,
libraries=["udunits2"],
Expand All @@ -140,15 +134,6 @@ def _set_builtin(name, value):
),
)

if cythonize:
[udunits_ext] = cythonize(
udunits_ext,
compiler_directives=COMPILER_DIRECTIVES,
# Assert python 3 source syntax: Currently required to suppress a warning,
# even though this is now the default (as-of Cython v3).
language_level="3str",
)

cmdclass = {"clean_cython": CleanCython, "build_ext": numpy_build_ext}

kwargs = dict(
Expand Down

0 comments on commit 31bd497

Please sign in to comment.