Skip to content

Commit

Permalink
Update setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Illviljan committed Jan 28, 2022
1 parent 15c2999 commit 7d37ead
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from setuptools import Extension, setup

try:
from Cython.Distutils.build_ext import new_build_ext as build_ext
except ImportError:
from setuptools.command.build_ext import build_ext

ext_modules = [
Extension(
"ruptures.detection._detection.ekcpd",
Expand All @@ -20,23 +25,10 @@
]


# if __name__ == "__main__":
# from Cython.Build import cythonize

# setup(
# ext_modules=cythonize(ext_modules, language_level="3"),
# )

cmdclass = dict()
cmdclass["build_ext"] = build_ext

if __name__ == "__main__":
setup(
# ...
setup_requires=[
# Setuptools 18.0 properly handles Cython extensions.
'setuptools>=42',
'cython',
],
ext_modules=[
ext_modules,
],
)
setup(
cmdclass=cmdclass,
ext_modules=cythonize(ext_modules, language_level="3"),
)

0 comments on commit 7d37ead

Please sign in to comment.