-
Notifications
You must be signed in to change notification settings - Fork 159
/
setup.py
72 lines (59 loc) · 2.07 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
#!/usr/bin/env python
# coding=utf-8
import os
import sys
import re
from setuptools import setup, find_packages
THIS_FOLDER = os.path.dirname(os.path.abspath(__file__))
def get_version():
scope = {}
version = '1.0'
version_file = os.path.join(THIS_FOLDER, "jqdatasdk", "version.py")
if os.path.exists(version_file):
with open(version_file) as fp:
exec(fp.read(), scope)
version = scope.get('__version__', '1.0')
return version
def get_long_description():
with open(os.path.join(THIS_FOLDER, 'README.md'), 'rb') as f:
long_description = f.read().decode('utf-8')
return long_description
def _parse_requirement_file(path):
if not os.path.isfile(path):
return []
with open(path) as f:
requirements = [line.strip() for line in f if line.strip()]
return requirements
def get_install_requires():
if sys.version_info.major < 3:
requirement_file = os.path.join(THIS_FOLDER, "requirements-py2.txt")
else:
requirement_file = os.path.join(THIS_FOLDER, "requirements.txt")
return _parse_requirement_file(requirement_file)
setup(
name="jqdatasdk",
version=get_version(),
description="jqdatasdk<easy utility for getting financial market data of China>",
packages=find_packages(exclude=("tests", "tests.*")),
author="JoinQuant",
author_email="[email protected]",
maintainer="tech_data",
maintainer_email="[email protected]",
license='Apache License v2',
package_data={'': ['*.*']},
url="https://www.joinquant.com/data",
long_description=get_long_description(),
long_description_content_type='text/markdown',
install_requires=get_install_requires(),
zip_safe=False,
platforms=["all"],
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'
],
)