File: setup.py

package info (click to toggle)
python-skytools 3.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 620 kB
  • sloc: python: 6,394; ansic: 929; makefile: 38; awk: 14
file content (31 lines) | stat: -rw-r--r-- 883 bytes parent folder | download
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
"""Setup for skytools module.
"""

from typing import Tuple
from setuptools import Extension, setup

try:
    from wheel.bdist_wheel import bdist_wheel
    class bdist_wheel_abi3(bdist_wheel):
        def get_tag(self) -> Tuple[str, str, str]:
            python, abi, plat = super().get_tag()
            if python.startswith("cp"):
                return CP_VER, "abi3", plat
            return python, abi, plat
    cmdclass = {"bdist_wheel": bdist_wheel_abi3}
except ImportError:
    cmdclass = {}

CP_VER = "cp37"
API_VER = ('Py_LIMITED_API', '0x03070000')

setup(
    cmdclass = cmdclass,
    ext_modules = [
        Extension("skytools._cquoting", ["modules/cquoting.c"],
                  define_macros=[API_VER], py_limited_api=True),
        Extension("skytools._chashtext", ["modules/hashtext.c"],
                  define_macros=[API_VER], py_limited_api=True),
    ]
)