File: pyfdb_setup.py.in

package info (click to toggle)
fdb 5.20.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 89,268 kB
  • sloc: cpp: 40,830; python: 5,079; sh: 4,996; makefile: 32; ansic: 8
file content (49 lines) | stat: -rw-r--r-- 1,592 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import os
from setuptools import setup
import platform
from wheel.bdist_wheel import bdist_wheel
import sys


# NOTE this we need to correctly link with fdb5lib version on cd. For local builds feel free to ignore
version_suffix = os.environ.get("VERSION_SUFFIX", "")


# NOTE see ci-utils/wheelmaker/buildscripts/setup_utils, we need to get the right abi compat tag
class bdist_wheel_ext(bdist_wheel):
    def get_tag(self):
        python, abi, plat = bdist_wheel.get_tag(self)
        return python, abi, f"manylinux_2_28_{platform.machine()}"


ext_kwargs = {
    "darwin": {},
    "linux": {"cmdclass": {"bdist_wheel": bdist_wheel_ext}},
}

if os.environ.get("IS_LOCAL_BUILD", "") != "":
    # Don't pin the version of the fdb for the local install and rely on findlibs to find the
    # corresponding version
    setup(
        name="pyfdb",
        version=f"@fdb5_VERSION_STR@{version_suffix}",
        packages=["pyfdb", "pyfdb._internal", "pyfdb_bindings"],
        package_data={
            "pyfdb_bindings": ["*.so", "*.pyd"],
        },
        install_requires=["findlibs>=0.1.2"],
        has_ext_modules=lambda: True,
        **ext_kwargs[sys.platform],
    )
else:
    setup(
        name="pyfdb",
        version=f"@fdb5_VERSION_STR@{version_suffix}",
        packages=["pyfdb", "pyfdb._internal", "pyfdb_bindings"],
        package_data={
            "pyfdb_bindings": ["*.so", "*.pyd"],
        },
        install_requires=["findlibs>=0.1.2", f"fdb5lib==@fdb5_VERSION_STR@{version_suffix}"],
        has_ext_modules=lambda: True,
        **ext_kwargs[sys.platform],
    )