-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
100 lines (91 loc) · 4.37 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
"""
This file instructs scitkit-build how to build the module. This is very close
to the classical setuptools, but wraps some things for us to build the native
modules easier and more reliable.
For a proper installation with `pip install .`, you additionally need a
`pyproject.toml` to specify the dependencies to load this `setup.py`.
You can use `python3 setup.py install` to build and install the package
locally, with verbose output. To build this package in place, which may be
useful for debugging, use `python3 setup.py develop`. This will build
the native modules and move them into your source folder.
The setup options are documented here:
https://scikit-build.readthedocs.io/en/latest/usage.html#setup-options
"""
from glob import glob
from setuptools import find_packages
from skbuild_conan import setup
def readme():
# Simply return the README.md as string
with open("README.md") as file:
return file.read()
setup( # https://scikit-build.readthedocs.io/en/latest/usage.html#setup-options
# ~~~~~~~~~ BASIC INFORMATION ~~~~~~~~~~~
name="samplns",
description="An LNS-based algorithm for pairwise configuration sampling.",
long_description=readme(),
url="https://github.com/tubs-alg/SampLNS",
long_description_content_type="text/markdown",
author="TU Braunschweig, IBR, Algorithms Group",
author_email="TBD",
classifiers=[
"Development Status :: 4 - Beta",
# "License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
],
use_scm_version=True,
setup_requires=["setuptools_scm"],
# ~~~~~~~~~~~~ CRITICAL PYTHON SETUP ~~~~~~~~~~~~~~~~~~~
# This project structures defines the python packages in a subfolder.
# Thus, we have to collect this subfolder and define it as root.
packages=find_packages(
"pysrc", exclude=["tests"]
), # Include all packages in `./python`.
package_dir={"": "pysrc"}, # The root for our python package is in `./pysrc`.
python_requires=">=3.8", # lowest python version supported.
install_requires=[
# requirements necessary for basic usage (subset of requirements.txt)
"chardet>=4.0.0",
"requests>=2.25.1",
"ortools>=9.5.2237",
],
data_files=[
(
"deps/samplns",
["deps/featjar/evaluation-sampling-algorithms-0.1.0-SNAPSHOT-all.jar"],
),
("deps/samplns/tools/FeatJar", glob("deps/featjar/tools/FeatJAR/*")),
("deps/samplns/tools/FIDE_org", glob("deps/featjar/tools/FIDE_org/*")),
],
entry_points={"console_scripts": ["samplns=samplns.__main__:main"]},
# ~~~~~~~~~~~ CRITICAL CMAKE SETUP ~~~~~~~~~~~~~~~~~~~~~
# Especially LTS systems often have very old CMake version (or none at all).
# Defining this will automatically install locally a working version.
cmake_minimum_required_version="3.24",
#
# By default, the `install` target is built (automatically provided).
# To compile a specific target, use the following line.
# Alternatively, you can use `if(NOT SKBUILD) ... endif()` in CMake, to
# remove unneeded parts for packaging (like tests).
# cmake_install_target=None
#
# In the cmake you defined by install(...) where to move the built target.
# This is critical als only targets with install will be used by skbuild.
# This should be relative paths to the project root, as you don't know
# where the package will be packaged. You can change the root for the
# install-paths with the following line. Note that you can also access
# the installation root (including this modification) in cmake via
# `CMAKE_INSTALL_PREFIX`. If your package misses some binaries, you
# probably messed something up here or in the `install(...)` path.
# cmake_install_dir = ".",
# |-----------------------------------------------------------------------|
# | If you are packing foreign code/bindings, look out if they do install |
# | targets in global paths, like /usr/libs/. This could be a problem. |
# |-----------------------------------------------------------------------|
#
# Some CMake-projects allow you to configure it using parameters. You
# can specify them for this Python-package using the following line.
# cmake_args=[]
#
# There are further options, but you should be fine with these above.
conan_recipes=["./cmake/conan/gurobi_public"],
)