-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathsetup.py
More file actions
33 lines (25 loc) · 901 Bytes
/
setup.py
File metadata and controls
33 lines (25 loc) · 901 Bytes
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
from setuptools import setup, Extension
from wheel.bdist_wheel import bdist_wheel
__version__ = 'unknown'
# "import" __version__
for line in open('src/rtmixer.py'):
if line.startswith('__version__'):
exec(line)
break
# Adapted from
# https://github.com/joerick/python-abi3-package-sample/blob/main/setup.py
class bdist_wheel_abi3(bdist_wheel):
def get_tag(self):
python, abi, plat = super().get_tag()
if python.startswith("cp"):
# on CPython, our wheels are abi3 and compatible back to 3.2,
# but let's set it to our min version anyway
return "cp310", "abi3", plat
return python, abi, plat
setup(
version=__version__,
package_dir={'': 'src'},
py_modules=['rtmixer'],
cffi_modules=['rtmixer_build.py:ffibuilder'], # sets Py_LIMITED_API for us
cmdclass={"bdist_wheel": bdist_wheel_abi3},
)