forked from nicholasRenninger/wombats_experiments
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
57 lines (51 loc) · 1.71 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
# Copyright (C) 2020 University of Colorado at Boulder
# This software may be modified and distributed under the terms of the
# MIT license. See the accompanying LICENSE file for details.
from sys import platform
from setuptools import setup
from setuptools.command.install import install
from subprocess import call
import pathlib
import pkg_resources
LIBRARY_NAME = "wombats"
with pathlib.Path('requirements.txt').open() as requirements_txt:
install_requires = [
str(requirement)
for requirement
in pkg_resources.parse_requirements(requirements_txt)
]
## Installation of pygraphviz
# linux
if platform == "linux" or platform == "linux2":
pass
install_requires.append('pygraphviz')
cmdclass = {}
# OS X
elif platform == "darwin":
class CustomInstall(install):
"""
Somehow installing pygraphviz fails on mac.
We have to tell pip where the graphviz libraries are on this machine.
Plus, parse_requirements cannot handle arguments,
so I had to use CustomInstall.
"""
def run(self):
call(['pip', 'install', '--global-option=build_ext', '--global-option="-I/usr/local/include"', '--global-option="-L/usr/local/lib"', 'pygraphviz'])
install.run(self)
cmdclass = {'install': CustomInstall}
# Windows...
elif platform == "win32":
raise Exception('Not Supported')
setup(
name=LIBRARY_NAME,
version='1.0.0',
author="Nicholas Renninger",
author_email="[email protected]",
description="",
license="",
url='https://github.com/aria-systems-group/wombats',
python_requires='>=3.5',
package_dir={'':LIBRARY_NAME},
cmdclass=cmdclass,
install_requires=install_requires,
)