forked from nfgallimore/quantopian-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
61 lines (54 loc) · 2.29 KB
/
setup.py
File metadata and controls
61 lines (54 loc) · 2.29 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
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import ast
import os
import re
import sys
from pip.req import parse_requirements
from setuptools import setup, find_packages
def read(*names):
with open(os.path.join(os.path.dirname(__file__), *names)) as f:
return f.read()
special_members = {}
for line in ast.parse(read('quantopian_tools', '__init__.py')).body:
if (not isinstance(line, ast.Assign) or len(line.targets) != 1 or
not isinstance(line.targets[0], ast.Name) or
not re.match(r'__.*?__', line.targets[0].id) or
not isinstance(line.value, ast.Str)):
continue
special_members[line.targets[0].id] = line.value.s
pkg_name = special_members['__pkg_name__']
py_version = sys.version_info[0]
setup(
name=pkg_name,
version=special_members.get('__version__'),
description=special_members.get('__project_description__'),
long_description=read('README.md') + '\n\n\n' + read('LICENSE'),
author=special_members.get('__author__'),
author_email=special_members.get('__author_email__'),
maintainer=special_members.get('__maintainer__'),
maintainer_email=special_members.get('__maintainer_email__'),
url=special_members.get('__project_url__'),
packages=find_packages(exclude=['tests']),
license=special_members.get('__license__'),
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: Documentation :: Sphinx',
'Topic :: Software Development :: Libraries :: Python Modules'
],
install_requires=[str(x.req) for x in parse_requirements('requirements/install-py%d.txt' % py_version,
session=False)],
tests_require=[str(x.req) for x in parse_requirements('requirements/py%d.txt' % py_version, session=False)],
include_package_data=True,
zip_safe=False
)