-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
89 lines (80 loc) · 2.53 KB
/
Copy pathsetup.py
File metadata and controls
89 lines (80 loc) · 2.53 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
from setuptools import setup
import os
import sys
import pathlib
import importlib
import warnings
# get setup.py location
here = pathlib.Path(__file__).parent.resolve()
long_description = (here / "README.md").read_text(encoding="utf-8")
license_content = (here / "LICENSE.md").read_text(encoding="utf-8")
# import setup_ext
sys.path.insert(0, str(here))
import setup_ext
from setup_ext import setuptools_wrap, meta_build
from setup_ext import cmake_clib, cmake_extension, cmake_if
from setup_ext import conan_clib
from setup_ext import conan_cmake_extension
from setup_ext import develop_warp
from setup_ext import path_util, rpath_util
sys.path.pop(0)
# current packages
packages = [
"sim_estab",
]
# clib & ext
import nanobind
libraries = [
conan_clib.ConanClib(
name="sim_estab",
version="0.0.1",
sourcedir="src/libsim_estab",
targetdir=path_util.PathPrefixBuildLib("sim_estab"),
build_type="Debug", # TODO: use envvar
conan_profile_path=str(here / "buildsys" / "conan" / "profile"),
conan_local_dep={"xorg/system": {
"package": str(here / "buildsys" / "conan" / "recipe" / "xorg"),
}}),
]
ext_modules = [
conan_cmake_extension.ConanCMakeExtension(
"sim_estab._if",
sourcedir=str(here / "src" / "sim_estab_ext"),
build_type="Debug", # TODO: use envvar
conan_name="sim_estab_ext",
conan_version="0.0.1",
conan_profile_path=str(here / "buildsys" / "conan" / "profile"),
cmake_configure_argdef={
"nanobind_ROOT": nanobind.cmake_dir(),
"libsim_estab_ROOT": path_util.PathPrefixBuildLib("sim_estab/lib/cmake"),
"DESIGNATED_RPATH": rpath_util.compute_rpath("sim_estab._if", "sim_estab/lib"),
},
extra_lib={},
py_limited_api=True,
)
]
setuptools_wrap.setup(
name="sim_estab",
version="0.0.1",
description="Simulated Establishment",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/TransshipmentEnvoy/SimEstab",
license=license_content,
license_files=('LICENSE.md',),
author="TransshipmentEnvoy",
author_email="TransshipmentEnvoy@outlook.com",
# dep
python_requires=">=3.11, <4",
# pkg
package_dir={"": "src"},
packages=packages,
# cmdclass
cmdclass={
"develop": develop_warp.CustomDevelop,
"build_clib": meta_build.MetaBuildClib,
"build_ext": meta_build.MetaBuildExt,
},
libraries=libraries,
ext_modules=ext_modules,
)