-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
39 lines (33 loc) · 1.15 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from setuptools import setup, find_packages
from setuptools.extension import Extension
from distutils.command.build_ext import build_ext as du_build_ext
class build_ext(du_build_ext):
def run(self):
from Cython.Build.Dependencies import cythonize
self.distribution.ext_modules[:] = cythonize(
self.distribution.ext_modules,
include_path = ["primecountpy"],
compiler_directives={'embedsignature': True, 'binding': True},
language_level=3)
du_build_ext.run(self)
with open('VERSION') as version_file:
version = version_file.read().strip()
extensions = [
Extension(
"primecountpy.primecount",
sources=["primecountpy/primecount.pyx"],
language="c++",
libraries=["primecount","primesieve"],
),
]
setup(
version=version,
packages=find_packages(),
ext_modules=extensions,
zip_safe=False,
package_dir={'primecountpy': 'primecountpy'},
package_data={"primecountpy": ["*.pxd"],
"docs": ["*"], "docs.source": ["*"], "docs.source.modules": ["*"],
},
cmdclass={'build_ext': build_ext},
)