-
Notifications
You must be signed in to change notification settings - Fork 370
Expand file tree
/
Copy pathsetup.py
More file actions
108 lines (78 loc) · 3.07 KB
/
setup.py
File metadata and controls
108 lines (78 loc) · 3.07 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# -*- coding: utf-8 -*-
import os
import re
import shutil
from codecs import open
from setuptools import setup, find_packages
from setuptools.command.install import install
class CustomInstallCommand(install):
def run(self):
install.run(self)
config_path = os.path.join(os.path.expanduser('~'), '.strategyease_sdk', 'config')
ConfigInstantiator.instantiate(config_path)
class ConfigInstantiator:
@staticmethod
def instantiate(path):
for filename in os.listdir(path):
match = re.search("(.*)-template\\.(.*)", filename)
if match is None:
continue
concrete_filename = '{}.{}'.format(match.group(1), match.group(2))
template_file_path = os.path.join(path, filename)
concrete_file_path = os.path.join(path, concrete_filename)
if os.path.isfile(concrete_file_path):
continue
shutil.copyfile(template_file_path, concrete_file_path)
def main():
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='strategyease_sdk',
version='2.1.1',
description=u'策略易(StrategyEase)Python SDK,策略自动化交易 API。',
long_description=long_description,
url='https://github.com/sinall/StrategyEase-Python-SDK',
author='sinall',
author_email='gaoruinan@163.com',
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Financial and Insurance Industry',
'Topic :: Office/Business :: Financial :: Investment',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
keywords='StrategyEase SDK',
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
install_requires=['requests', 'six', 'apscheduler', 'lxml', 'cssselect', 'bs4', 'html5lib', 'pandas',
'tushare', 'pyyaml'],
extras_require={
'dev': [],
'test': [],
},
package_data={
},
data_files=[(os.path.join(os.path.expanduser('~'), '.strategyease_sdk', 'config'), [
'config/scheduler-template.ini',
'config/logging-template.ini',
])],
scripts=['scripts/strategyease-scheduler.py'],
entry_points={
'console_scripts': [
'strategyease-scheduler = strategyease_sdk.scheduler:start',
],
},
cmdclass={
'install': CustomInstallCommand,
},
)
if __name__ == '__main__':
main()