-
Notifications
You must be signed in to change notification settings - Fork 12
/
setup.py
52 lines (46 loc) · 1.7 KB
/
setup.py
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
import os
import sys
import toml
from setuptools import setup
try:
from setuptools_rust import RustBin
except ImportError:
import subprocess
subprocess.check_call([sys.executable, "-m", "pip", "install", "setuptools-rust"])
if sys.platform == "linux":
os.environ["RUSTFLAGS"] = (
"-C link-args=-Wl,-rpath,$ORIGIN/../lib "
"-C link-args=-Wl,-rpath,$ORIGIN/../lib64 "
"-C link-args=-Wl,-rpath,$ORIGIN/../include "
"-C link-args=-Wl,-rpath,$ORIGIN/../share/pkgconfig "
"-C link-args=-Wl,-rpath,$ORIGIN/../lib/pkgconfig "
"-C link-args=-Wl,-rpath,$ORIGIN/../lib64/pkgconfig "
"-C link-args=-Wl,-rpath,$ORIGIN/../lib/x86_64-linux-gnu "
"-C link-args=-Wl,-rpath,$ORIGIN/../lib64/x86_64-linux-gnu "
"-C link-args=-Wl,-rpath,$ORIGIN/../local/lib/pkgconfig "
"-C link-args=-Wl,-rpath,$ORIGIN/../local/lib64/pkgconfig "
"-C link-args=-Wl,-rpath,$ORIGIN/../../local/lib "
"-C link-args=-Wl,-rpath,$ORIGIN/../../local/lib64 "
"-C link-args=-Wl,-rpath,$ORIGIN/../../local/lib/x86_64-linux-gnu "
"-C link-args=-Wl,-rpath,$ORIGIN/../../local/lib64/x86_64-linux-gnu "
)
pyproject = toml.load("pyproject.toml")
version = pyproject["project"]["version"]
setup(
name="pywry",
version=version,
rust_extensions=[
RustBin(
"pywry",
"Cargo.toml",
debug=False,
args=["--release", "--no-default-features"],
)
],
zip_safe=False,
setup_requires=["setuptools-rust>=0.10.1", "wheel", "toml"],
package_dir={"": "python"},
python_requires=">=3.8",
include_package_data=False,
package_data={"pywry": ["py.typed", "pywry.pyi"]},
)