Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sage
Path: blob/develop/pkgs/sagemath-coxeter3/setup.py
4054 views
1
#!/usr/bin/env python
2
3
from distutils import log
4
from setuptools import setup
5
6
# Work around a Cython problem in Python 3.8.x on macOS
7
# https://github.com/cython/cython/issues/3262
8
import os
9
if os.uname().sysname == 'Darwin':
10
import multiprocessing
11
multiprocessing.set_start_method('fork', force=True)
12
13
# If build isolation is not in use and setuptools_scm is installed,
14
# then its file_finders entry point is invoked, which we don't need.
15
# Workaround from ​https://github.com/pypa/setuptools_scm/issues/190#issuecomment-351181286
16
try:
17
import setuptools_scm.integration
18
setuptools_scm.integration.find_files = lambda _: []
19
except ImportError:
20
pass
21
22
# PEP 517 builds do not have . in sys.path
23
import sys
24
sys.path.insert(0, os.path.dirname(__file__))
25
26
if len(sys.argv) > 1 and (sys.argv[1] == "sdist" or sys.argv[1] == "egg_info"):
27
sdist = True
28
else:
29
sdist = False
30
31
if sdist:
32
cmdclass = {}
33
else:
34
from sage_setup.excepthook import excepthook
35
sys.excepthook = excepthook
36
37
from sage_setup.setenv import setenv
38
setenv()
39
40
import sage.env
41
sage.env.default_required_modules = sage.env.default_optional_modules = ()
42
43
from sage_setup.command.sage_build_cython import sage_build_cython
44
from sage_setup.command.sage_build_ext import sage_build_ext
45
from sage_setup.command.sage_build_py import sage_build_py
46
sage_build_cython.built_distributions = ['sagemath-coxeter3']
47
48
cmdclass = dict(build_cython=sage_build_cython,
49
build_ext=sage_build_ext,
50
build_py=sage_build_py)
51
52
from sage_setup.find import find_python_sources
53
python_packages, python_modules, cython_modules = find_python_sources(
54
'.', ['sage'], distributions=['sagemath-coxeter3'])
55
56
log.warn('python_packages = {0}'.format(python_packages))
57
log.warn('python_modules = {0}'.format(python_modules))
58
log.warn('cython_modules = {0}'.format(cython_modules))
59
60
setup(
61
cmdclass = cmdclass,
62
packages = python_packages,
63
py_modules = python_modules,
64
ext_modules = cython_modules,
65
)
66
67