From 10289825404e45267e8b97223d4ee054ef49c36b Mon Sep 17 00:00:00 2001 From: Benjamin Rabier Date: Wed, 31 Aug 2022 23:18:02 +0200 Subject: [PATCH] remove cython as build requirements There's no Cython anymore in Antidote for now, so no need to require in pyproject.toml and keep cython-specific code in setup.py. --- pyproject.toml | 3 --- setup.py | 65 +++----------------------------------------------- 2 files changed, 3 insertions(+), 65 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2a8a164..e9e40b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,9 +3,6 @@ requires = [ "setuptools>=42", "wheel", "setuptools_scm>=3.4", - # Ideally those would be optional... - "cython>=0.29,<0.30", - "fastrlock>=0.7,<0.9" ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 8e13f1c..6b3abb5 100644 --- a/setup.py +++ b/setup.py @@ -1,72 +1,13 @@ import os import pathlib -import re -from setuptools import Extension, find_packages, setup +from setuptools import find_packages, setup here = pathlib.Path(os.path.dirname(os.path.abspath(__file__))) with open(str(here / "README.rst"), "r") as f: readme = f.read() -ext_modules = [] -install_requires = ["typing_extensions"] - -# Ideally this would be done with a installation flag... -if os.environ.get("ANTIDOTE_COMPILED") == "true": - install_requires.append("fastrlock>=0.7,<0.9") - - from Cython.Build import cythonize - from Cython.Compiler import Options - - cython_options = set(os.environ.get("ANTIDOTE_CYTHON_OPTIONS", "").split(",")) - if "all" in cython_options: - cython_options |= {"annotate", "debug", "trace", "profile"} - - extension_extras = {} - cythonize_extras = {} - compiler_directives_extras = {} - - if "annotate" in cython_options: - Options.annotate = True - cythonize_extras["annotate"] = True - - if "debug" in cython_options: - cythonize_extras["gdb_debug"] = True - - if "trace" in cython_options: # line_profiler / coverage - directive_defaults = Options.get_directive_defaults() - directive_defaults["linetrace"] = True - directive_defaults["binding"] = True - extension_extras["define_macros"] = [("CYTHON_TRACE", "1")] - - if "profile" in cython_options: # cProfile - compiler_directives_extras["profile"] = True - - def generate_extensions(): - extensions = [] - for root, _, filenames in os.walk("src"): - for filename in filenames: - if re.match(r".*\.(cpp|pyx)$", filename): - path = os.path.join(root, filename) - module = path[4:].replace("/", ".").rsplit(".", 1)[0] - extensions.append(Extension(module, [path], language="c++", **extension_extras)) - - return extensions - - ext_modules = cythonize( - generate_extensions(), - compiler_directives=dict( - language_level=3, - boundscheck=False, - wraparound=False, - annotation_typing=False, - cdivision=True, - **compiler_directives_extras, - ), - **cythonize_extras, - ) - setup( name="antidote", use_scm_version=dict(write_to="src/antidote/_internal/scm_version.py"), @@ -78,9 +19,9 @@ def generate_extensions(): package_dir={"": "src"}, package_data={"antidote": ["py.typed"]}, include_dirs=["src"], - ext_modules=ext_modules, + ext_modules=[], python_requires=">=3.7,<4", - install_requires=install_requires, + install_requires=["typing_extensions"], license="MIT", classifiers=[ "Development Status :: 5 - Production/Stable ",