-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
66 lines (57 loc) · 1.57 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
from setuptools import setup
from distutils.extension import Extension
import logging
import sys
requirements = ['numpy', 'matplotlib', 'tqdm', 'scipy', 'cython']
# Set up the logging environment
logging.basicConfig()
log = logging.getLogger()
# Check Cython installation
try:
from Cython.Build import cythonize
except ImportError:
log.warning("Cython required to compile project. Installing now:")
import pip
pip.main(['install', 'cython'])
try:
from Cython.Build import cythonize
except ImportError:
log.critical(
'Cython.Build.cythonize not found. '
'Cython is required to build from a repo.')
sys.exit(1)
# Extension options
include_dirs = []
try:
import numpy
include_dirs.append(numpy.get_include())
except ImportError:
log.critical('Numpy and its headers are required to run setup(). Exiting')
sys.exit(1)
opts = dict(
include_dirs=include_dirs,
)
ext_modules = cythonize([
Extension(
'sslap.auction_', ['sslap/auction_.pyx'], **opts),
Extension(
'sslap.feasibility_', ['sslap/feasibility_.pyx'], ** opts)
]
)
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name='sslap',
version='0.2.5',
description='Super Sparse Linear Assignment Problems Solver',
long_description=long_description,
long_description_content_type="text/markdown",
author_email='ollieboyne@gmail.com',
packages=['sslap'],
url='http://github.com/OllieBoyne/sslap',
author='Ollie Boyne',
ext_modules=ext_modules,
install_requires=requirements,
license="MIT",
keywords='super sparse linear assignment problem solve lap auction algorithm',
)