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 713fd3e commit 00ff39d
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@


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

ext_modules = [
Extension(
Expand All @@ -25,31 +25,39 @@
),
]

setup(
setup_requires=[
# Setuptools 18.0 properly handles Cython extensions.
'setuptools>42.0',
'cython',
],
ext_modules=ext_modules,
)

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

# setup(
# cmdclass=cmdclass,
# ext_modules=ext_modules,
# cmdclass=cmdclass,
# ext_modules=ext_modules,
# )

# https://luminousmen.com/post/resolve-cython-and-numpy-dependencies
try:
from Cython.Build import cythonize
except ImportError:
# create closure for deferred import
def cythonize(*args, **kwargs):
from Cython.Build import cythonize
# # https://luminousmen.com/post/resolve-cython-and-numpy-dependencies
# try:
# from Cython.Build import cythonize
# except ImportError:
# # create closure for deferred import
# def cythonize(*args, **kwargs):
# from Cython.Build import cythonize

return cythonize(*args, **kwargs)
# return cythonize(*args, **kwargs)


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

0 comments on commit 00ff39d

Please sign in to comment.