-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
106 lines (91 loc) · 2.91 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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/env python
"""The setup script."""
from glob import glob
from setuptools import Extension, find_packages, setup
from setuptools.command.build_ext import build_ext
with open("README.md") as readme_file:
readme = readme_file.read()
with open("HISTORY.md") as history_file:
history = history_file.read()
requirements = []
test_requirements = [
"pytest>=3",
]
class get_pybind_include(object):
"""Helper class to determine the pybind11 include path
The purpose of this class is to postpone importing pybind11
until it is actually installed, so that the ``get_include()``
method can be invoked."""
def __init__(self, user=False):
self.user = user
def __str__(self):
import pybind11
return pybind11.get_include(self.user)
compile_args = ["-std=c++11", "-fopenmp"]
ext_modules = [
Extension(
"pisinger_cpp",
sorted(glob("digneapy/solvers/_pisinger/src/*.cpp")),
include_dirs=[
# Path to pybind11 headers
get_pybind_include(),
get_pybind_include(user=True),
],
extra_compile_args=compile_args,
language="c++",
),
Extension(
"parallel_ea",
sorted(glob("digneapy/solvers/_parallel_ea/src/*.cpp")),
include_dirs=[
# Path to pybind11 headers
get_pybind_include(),
get_pybind_include(user=True),
],
extra_compile_args=compile_args,
extra_link_args=["-fopenmp"],
language="c++",
),
]
setup(
author="Alejandro Marrero",
author_email="amarrerd@ull.edu.es",
python_requires=">=3.10",
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
"Operating System :: Unix",
"Operating System :: MacOS",
],
description="Python version of the DIGNEA code for instance generation",
install_requires=requirements,
license="GNU General Public License v3",
long_description=readme + "\n\n" + history,
include_package_data=True,
keywords=[
"dignea",
"optimization",
"instance generation",
"quality-diversity",
"NS",
],
name="digneapy",
packages=find_packages(include=["digneapy", "digneapy.*"]),
platforms=["any"],
test_suite="tests",
tests_require=test_requirements,
url="https://github.com/DIGNEA/digneapy",
version="0.2.5",
ext_modules=ext_modules,
cmdclass={"build_ext": build_ext},
zip_safe=False,
)