-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
60 lines (47 loc) · 1.33 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
#!/usr/bin/env python
#
# based on template example from:
# https://github.com/hcarvalhoalves/python-package-template
#
from setuptools import setup, find_packages
import sys
import os
BASE_LOCATION = os.path.abspath(os.path.dirname(__file__))
VERSION_FILE = 'VERSION'
REQUIRES_FILE = 'requirements.txt'
DEPENDENCIES_FILE = 'requirements_links.txt'
def readfile(filename, func):
try:
with open(os.path.join(BASE_LOCATION, filename)) as f:
data = func(f)
except (IOError, IndexError):
sys.stderr.write(u"""
Unable to open file: {0}
For development run:
make version
setup.py develop
To build a valid release, run:
make release
""".format(filename))
sys.exit(1)
return data
def get_version():
return readfile(VERSION_FILE, lambda f: f.read().strip())
def get_requires():
return readfile(REQUIRES_FILE, lambda f: f.read().strip())
def get_dependencies():
return readfile(DEPENDENCIES_FILE, lambda f: f.read().strip())
setup(
name="timing_parse",
author="Ben Andre",
author_email="[email protected]",
packages=['timing_parse'],
version=get_version(),
scripts=['timing_parse/timing_parse.py',
],
install_requires=get_requires(),
#dependency_links=get_dependencies(),
include_package_data=True,
zip_safe=True,
use_2to3=True,
)