-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
49 lines (41 loc) · 1.3 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Use setup.cfg to configure your project.
This file was generated with PyScaffold 3.1.
PyScaffold helps you to put up the scaffold of your new Python project.
Learn more under: https://pyscaffold.org/
"""
import sys
from pkg_resources import require, VersionConflict
from setuptools import setup
try:
from setuptools_rust import Binding, RustExtension
has_rust = True
except ImportError:
has_rust = False
pass
try:
require("setuptools>=38.3")
except VersionConflict:
print("Error: version of setuptools is too old (<38.3)!")
sys.exit(1)
# import subprocess
# toolchains = subprocess.check_output(["rustup", "toolchain", "list"]).decode('utf-8').split("\n")
# nightlys = sorted([x[:x.find(' ') if x.find(' ') != -1 else None] for x in toolchains if x.startswith('nightly')])
# import os
# os.environ['RUSTUP_TOOLCHAIN'] = nightlys[0] # use the oldest one...
# print("USING", os.environ['RUSTUP_TOOLCHAIN'])
if __name__ == "__main__":
if has_rust:
setup(
rust_extensions=[
RustExtension(
"mbf_nested_intervals.mbf_nested_intervals",
binding=Binding.PyO3,
debug=False,
)
],
)
else:
setup()