forked from donaldfilimon/wdbx-py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
57 lines (47 loc) · 1.49 KB
/
setup.py
File metadata and controls
57 lines (47 loc) · 1.49 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from pathlib import Path
from setuptools import find_packages, setup, Extension
from setuptools.command.install import install
from setuptools.command.build_ext import build_ext
from Cython.Build import cythonize
def get_requirements():
with open(Path('requirements.txt'), 'r') as f:
return [line.strip() for line in f if line.strip()]
def get_extension_modules():
"""Returns a list of all Cython extension modules"""
return [
Extension(
"wdbx.example_module",
[str(Path("wdbx") / "example_module.pyx")]
)
]
class CustomBuildExt(build_ext):
def run(self):
extensions = get_extension_modules()
ext_modules = cythonize(extensions)
self.extensions = ext_modules
build_ext.run(self)
class CustomInstall(install):
def run(self):
self.run_command('build_ext')
install.run(self)
setup(
name="wdbxpy",
version="0.1",
packages=find_packages(),
ext_modules=cythonize(get_extension_modules()),
install_requires=get_requirements(),
setup_requires=['cython'],
cmdclass={
'build_ext': CustomBuildExt,
'install': CustomInstall,
},
author="WDBX Team",
author_email="wdbx@team.com",
url="https://github.com/WDBX/WDBX",
description="WDBX Python package",
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules"
],
)