-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·43 lines (33 loc) · 986 Bytes
/
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
40
41
42
43
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import numpy
from setuptools import Extension, setup, find_packages
from Cython.Build import cythonize
PACKAGES = find_packages()
MOD_NAMES = ["thinc_bigendian_ops.ops"]
def clean(path):
for name in MOD_NAMES:
name = name.replace(".", "/")
for ext in [".so", ".html", ".cpp", ".c"]:
file_path = os.path.join(path, name + ext)
if os.path.exists(file_path):
os.unlink(file_path)
def setup_package():
extensions = [
Extension(
"thinc_bigendian_ops.ops",
["thinc_bigendian_ops/bigendian_ops.pyx"],
include_dirs=[numpy.get_include()],
),
]
setup(
name="thinc_bigendian_ops",
zip_safe=True,
packages=PACKAGES,
package_data={"": ["*.pyx", "*.pxd"]},
ext_modules=cythonize(extensions),
)
if __name__ == "__main__":
setup_package()