Skip to content

Commit

Permalink
Change setup.py for Cython 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
janezd committed Jul 20, 2023
1 parent ff152a9 commit 3544d1f
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

try:
from Cython.Distutils.build_ext import new_build_ext as build_ext
from Cython.Build import cythonize
have_cython = True
except ImportError:
have_cython = False
Expand Down Expand Up @@ -434,14 +435,7 @@ def ext_modules():
if os.name == 'posix':
libraries.append("m")

return [
# Cython extensions. Will be automatically cythonized.
Extension(
"*",
["Orange/*/*.pyx"],
include_dirs=includes,
libraries=libraries,
),
modules = [
Extension(
"Orange.classification._simple_tree",
sources=[
Expand All @@ -464,6 +458,16 @@ def ext_modules():
),
]

if have_cython:
modules += cythonize(Extension(
"*",
["Orange/*/*.pyx"],
include_dirs=includes,
libraries=libraries,
))

return modules


def setup_package():
write_version_py()
Expand Down

0 comments on commit 3544d1f

Please sign in to comment.