summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py55
1 files changed, 26 insertions, 29 deletions
diff --git a/setup.py b/setup.py
index 8d5089c18..26beca2f4 100755
--- a/setup.py
+++ b/setup.py
@@ -94,16 +94,16 @@ def compile_cython_modules(profile=False, coverage=False, compile_minimal=False,
"Cython.Plex.Machines",
"Cython.Plex.Transitions",
"Cython.Plex.DFA",
+ "Cython.Compiler.Code",
"Cython.Compiler.FusedNode",
+ "Cython.Compiler.Parsing",
"Cython.Tempita._tempita",
"Cython.StringIOTree",
"Cython.Utils",
])
if compile_more and not compile_minimal:
compiled_modules.extend([
- "Cython.Compiler.Code",
"Cython.Compiler.Lexicon",
- "Cython.Compiler.Parsing",
"Cython.Compiler.Pythran",
"Cython.Build.Dependencies",
"Cython.Compiler.ParseTreeTransforms",
@@ -183,37 +183,27 @@ def compile_cython_modules(profile=False, coverage=False, compile_minimal=False,
setup_args['ext_modules'] = extensions
-cython_profile = '--cython-profile' in sys.argv
-if cython_profile:
- sys.argv.remove('--cython-profile')
+def check_option(name):
+ cli_arg = "--" + name
+ if cli_arg in sys.argv:
+ sys.argv.remove(cli_arg)
+ return True
-cython_coverage = '--cython-coverage' in sys.argv
-if cython_coverage:
- sys.argv.remove('--cython-coverage')
+ env_var = name.replace("-", "_").upper()
+ if os.environ.get(env_var) == "true":
+ return True
-try:
- sys.argv.remove("--cython-compile-all")
- cython_compile_more = True
-except ValueError:
- cython_compile_more = False
+ return False
-try:
- sys.argv.remove("--cython-compile-minimal")
- cython_compile_minimal = True
-except ValueError:
- cython_compile_minimal = False
-try:
- sys.argv.remove("--cython-with-refnanny")
- cython_with_refnanny = True
-except ValueError:
- cython_with_refnanny = False
+cython_profile = check_option('cython-profile')
+cython_coverage = check_option('cython-coverage')
+cython_with_refnanny = check_option('cython-with-refnanny')
-try:
- sys.argv.remove("--no-cython-compile")
- compile_cython_itself = False
-except ValueError:
- compile_cython_itself = True
+compile_cython_itself = not check_option('no-cython-compile')
+if compile_cython_itself:
+ cython_compile_more = check_option('cython-compile-all')
+ cython_compile_minimal = check_option('cython-compile-minimal')
setup_args.update(setuptools_extra_args)
@@ -283,7 +273,7 @@ def run_build():
.. _Pyrex: https://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
"""),
- license='Apache',
+ license='Apache-2.0',
classifiers=[
dev_status(version),
"Intended Audience :: Developers",
@@ -308,6 +298,13 @@ def run_build():
"Topic :: Software Development :: Compilers",
"Topic :: Software Development :: Libraries :: Python Modules"
],
+ project_urls={
+ "Documentation": "https://cython.readthedocs.io/",
+ "Donate": "https://cython.readthedocs.io/en/latest/src/donating.html",
+ "Source Code": "https://github.com/cython/cython",
+ "Bug Tracker": "https://github.com/cython/cython/issues",
+ "User Group": "https://groups.google.com/g/cython-users",
+ },
scripts=scripts,
packages=packages,