-
Notifications
You must be signed in to change notification settings - Fork 184
/
setup.py
78 lines (61 loc) · 2.28 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from os.path import join as path_join, dirname as path_dirname
from setuptools import setup, find_packages
try:
# for pip >= 10
from pip._internal.req import parse_requirements
except ImportError:
# for pip <= 9.0.3
from pip.req import parse_requirements
try:
requirements = [str(ir.req) for ir in parse_requirements("requirements.txt", session=False)]
except AttributeError:
requirements = [str(ir.requirement) for ir in parse_requirements("requirements.txt", session=False)]
def get_version():
scope = {}
with open(path_join(path_dirname(__file__), "jqfactor_analyzer", "version.py")) as fp:
exec(fp.read(), scope)
return scope.get('__version__', '1.0')
def get_long_description():
with open(path_join(path_dirname(__file__), 'README.md'), 'rb') as fp:
long_desc = fp.read()
long_desc = long_desc.replace(
u'docs/API文档.md'.encode('utf-8'),
u'https://github.com/JoinQuant/jqfactor_analyzer/blob/master/docs/API%E6%96%87%E6%A1%A3.md'.encode('utf-8'),
)
return long_desc.decode('utf-8')
setup_args = dict(
name='jqfactor_analyzer',
version=get_version(),
packages=find_packages(exclude=("tests", "tests.*")),
author='JoinQuant',
author_email='[email protected]',
maintainer="",
maintainer_email="",
url='https://www.joinquant.com',
description='JoinQuant single factor analyzer',
long_description=get_long_description(),
long_description_content_type='text/markdown',
zip_safe=False,
platforms=["all"],
license='Apache License v2',
classifiers=[
'Programming Language :: Python',
'Operating System :: Microsoft :: Windows',
'Operating System :: Unix',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
install_requires=requirements,
include_package_data=True,
package_data={'jqfactor_analyzer': ['jqfactor_analyzer/sample_data/*.csv', 'jqfactor_analyzer/config.json']},
)
def main():
setup(**setup_args)
if __name__ == "__main__":
main()