-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
90 lines (69 loc) · 2.12 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
85
86
87
88
89
90
import os
import sys
try:
from setuptools import find_packages
from setuptools import setup
packages = find_packages()
except ImportError:
from distutils.core import setup
packages = ['karld', 'karld.tests', 'karld.record_reader']
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
def read(fname):
"""
Open and read a filename in this directory.
:param fname: `str` file name in this directory
Returns contents of file fname
"""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def get_version():
import imp
with open('karld/_meta.py', 'rb') as fp:
mod = imp.load_source('_meta', 'karld', fp)
return mod.version
def get_requirements(filename):
"""
Get requirements from a file and
convert to a list of strings.
:param filename:
:return:
"""
with open(filename) as f:
return list(f)
def get_install_requires():
return get_requirements('requirements.txt')
def get_test_requires():
return get_requirements('requirements_dev.txt')
try:
license_info = open('LICENSE').read()
except:
license_info = 'APACHE 2.0'
setup_args = dict(
name="karld",
version=get_version(),
author="John W Lockwood IV",
author_email="[email protected]",
description=("Doing some data things "
"in a memory efficient manner"),
license=license_info,
keywords="data",
url="https://github.com/johnwlockwood/karl_data",
package_dir={'karld': 'karld'},
packages=packages,
install_requires=get_install_requires(),
tests_require=get_test_requires(),
long_description=read('README.rst'),
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Natural Language :: English',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
],
)
if __name__ == '__main__':
setup(**setup_args)