forked from stringertheory/traces
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
83 lines (68 loc) · 2.32 KB
/
setup.py
File metadata and controls
83 lines (68 loc) · 2.32 KB
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
def read_init(key):
"""Parse the package __init__ file to find a variable so that it's not
in multiple places.
"""
filename = os.path.join("traces", "__init__.py")
result = None
with open(filename) as stream:
for line in stream:
if key in line:
result = line.split('=')[-1].strip().replace("'", "")
# throw error if version isn't in __init__ file
if result is None:
raise ValueError('must define %s in %s' % (key, filename))
return result
def read_author():
return read_init('author')
def read_author_email():
return read_init('email')
def read_dependencies(filename):
"""Read in the dependencies from the virtualenv requirements file.
"""
dependencies = []
filepath = os.path.join('requirements', filename)
with open(filepath, 'r') as stream:
for line in stream:
package = line.strip().split('#')[0].strip()
if package and package.split(' ')[0] != '-r':
dependencies.append(package)
return dependencies
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='traces',
version='0.6.0',
description="A library for unevenly-spaced time series analysis.",
long_description=long_description,
long_description_content_type="text/markdown",
author=read_author(),
author_email=read_author_email(),
url='https://github.com/datascopeanalytics/traces',
packages=['traces'],
package_dir={'traces': 'traces'},
include_package_data=True,
install_requires=read_dependencies('python.txt'),
extras_require={
'test': read_dependencies('python-test.txt'),
'doc': read_dependencies('python-doc.txt'),
'dev': read_dependencies('python-dev.txt'),
'pandas': ['pandas'],
},
license="MIT license",
zip_safe=False,
keywords='traces',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
test_suite='nose.collector',
)