-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathsetup.py
More file actions
28 lines (22 loc) · 743 Bytes
/
setup.py
File metadata and controls
28 lines (22 loc) · 743 Bytes
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
import re
from pathlib import Path
from setuptools import setup
from extensions import NLOptBuild, NLOptBuildExtension
with open("README.md") as f:
long_description = f.read()
with open(Path(__file__).parent / "extern" / "nlopt" / "CMakeLists.txt") as f:
content = f.read()
version = []
for s in ("MAJOR", "MINOR", "BUGFIX"):
m = re.search(f"NLOPT_{s}_VERSION *['\"](.+)['\"]", content)
version.append(m.group(1))
version = ".".join(version)
setup(
version=version,
python_requires=">=3.9",
install_requires=["numpy >=2,<3"],
setup_requires=["numpy >=2,<3"],
ext_modules=[NLOptBuildExtension("nlopt._nlopt", version)],
cmdclass={"build_ext": NLOptBuild},
zip_safe=False,
)