diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3b109da --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[build-system] +requires = ["setuptools", "cython>=0.28.4,<4"] diff --git a/setup.py b/setup.py index 35a4a4b..37d1cde 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,6 @@ pass dev_requires = [ - "cython>=0.28.4", "flake8>=2.5", "pytest>=2.8", "sphinx-rtd-theme>=0.1.9", @@ -40,13 +39,6 @@ ] + tornado_requires -# cython detection -try: - from Cython.Build import cythonize - CYTHON = True -except ImportError: - CYTHON = False - cmdclass = {} ext_modules = [] @@ -56,11 +48,10 @@ # only build ext in CPython with UNIX platform if UNIX and not PYPY: - # rebuild .c files if cython available - if CYTHON: - cythonize("thriftpy2/transport/cybase.pyx") - cythonize("thriftpy2/transport/**/*.pyx") - cythonize("thriftpy2/protocol/cybin/cybin.pyx") + from Cython.Build import cythonize + cythonize("thriftpy2/transport/cybase.pyx") + cythonize("thriftpy2/transport/**/*.pyx") + cythonize("thriftpy2/protocol/cybin/cybin.pyx") ext_modules.append(Extension("thriftpy2.transport.cybase", ["thriftpy2/transport/cybase.c"]))