-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
49 lines (38 loc) · 1.32 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
from setuptools import setup, find_packages
from os import path as p
from version import VERSION
DISTNAME = 'test-harness'
DESCRIPTION = 'A tool for collaboration on models and comparison of model results.'
with open('README.md') as f:
LONG_DESCRIPTION = f.read()
MAINTAINER = 'Hamed'
MAINTAINER_EMAIL = '[email protected]'
def read(filename, parent=None):
parent = (parent or __file__)
try:
with open(p.join(p.dirname(parent), filename)) as f:
return f.read()
except IOError:
return ''
def parse_requirements(filename, parent=None):
parent = (parent or __file__)
filepath = p.join(p.dirname(parent), filename)
content = read(filename, parent)
for line_number, line in enumerate(content.splitlines(), 1):
candidate = line.strip()
if candidate.startswith('-r'):
for item in parse_requirements(candidate[2:].strip(), filepath):
yield item
else:
yield candidate
setup(
name=DISTNAME,
version=VERSION,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
author=MAINTAINER,
author_email=MAINTAINER_EMAIL,
packages=['harness'] + ['harness/' + s for s in find_packages('harness')],
include_package_data=True,
install_requires=list(parse_requirements('requirements.txt'))
)