-
Notifications
You must be signed in to change notification settings - Fork 10
/
setup.py
84 lines (75 loc) · 2.85 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
import os
import sys
import setuptools
import setuptools.command.test
from codecs import open
here = os.path.abspath(os.path.dirname(__file__))
about = {}
with open(os.path.join(here, "src", "pybnb", "__about__.py")) as f:
exec(f.read(), about)
# Get the long description from the README file
def _readme():
with open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
return f.read()
install_requires = []
with open(os.path.join(here, "requirements.txt")) as f:
install_requires.extend([ln.strip() for ln in f
if ln.strip() != ""])
if sys.version_info < (3, 4):
# Backport of Python 3.4 enums to earlier versions
install_requires.append('enum34')
# Type annotations used by mypy
install_requires.append('typing')
tests_require = []
with open(os.path.join(here, "test_requirements.txt")) as f:
tests_require.extend([ln.strip() for ln in f
if (ln.strip() != "") and \
(not ln.strip() == "-r requirements.txt")])
class PyTest(setuptools.command.test.test):
user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")]
def initialize_options(self):
super(PyTest, self).initialize_options()
self.pytest_args = ''
def run_tests(self):
import shlex
#import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(shlex.split(self.pytest_args))
sys.exit(errno)
setuptools.setup(
name=about["__title__"],
version=about["__version__"],
description=about["__summary__"],
long_description=_readme(),
url=about["__uri__"],
author=about["__author__"],
author_email=about["__email__"],
license=about["__license__"],
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Mathematics",
"Natural Language :: English",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
keywords=["optimization","branch and bound"],
packages=setuptools.find_packages('src', exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
package_dir={'':'src'},
install_requires=install_requires,
cmdclass={
"test": PyTest
},
# use MANIFEST.in
include_package_data=True,
tests_require=tests_require
)