-
Notifications
You must be signed in to change notification settings - Fork 742
Expand file tree
/
Copy pathsub_setup.py
More file actions
135 lines (116 loc) · 4.43 KB
/
sub_setup.py
File metadata and controls
135 lines (116 loc) · 4.43 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import platform
import os
import sys
try:
from setuptools import find_packages, setup
except ImportError:
from distutils.core import find_packages, setup
def parse_requirements(filename):
line_iter = (line.strip() for line in open(filename))
return [line for line in line_iter if line and not line.startswith('#')]
requirements = parse_requirements('requirements.txt')
current_plat = sys.platform
# 移除PyQt5的特殊处理
# if current_plat == 'linux':
# requirements.remove('PyQt5')
hku_version = ''
with open('xmake.lua', 'r', encoding='utf-8') as f:
for line in f:
if len(line) > 15 and line[:11] == 'set_version':
pre_pos = line.find('"') + 1
end_pos = line.find('"', pre_pos)
hku_version = line[pre_pos:end_pos]
break
if not hku_version:
print("无法在 xmake.lua 中找到 set_version 语句,获取版本号失败!")
exit(0)
print('current hikyuu version:', hku_version)
py_version = platform.python_version_tuple()
py_version = int(py_version[0]) * 10 + int(py_version[1])
hku_name = "hikyuu" # "hikyuu-noarrow"
# hku_version = "1.0.9"
hku_author = "fasiondog"
hku_author_email = "fasiondog@sina.com"
hku_license = "MIT"
hku_keywords = [
"quant", "trade", "System Trading", "backtester", "量化", "程序化交易", "量化交易",
"系统交易"
]
hku_platforms = "Independant"
hku_url = "http://hikyuu.org/"
hku_description = "Hikyuu Quant Framework for System Trading Analysis and backtester"
with open("./readme.md", encoding='utf-8') as f:
hku_long_description = f.read()
hku_data_files = []
packages = ['hikyuu']
for root, dirs, files in os.walk('hikyuu'):
for p in dirs:
if p.find('__pycache__') < 0 and p.find('ipynb_checkpoints') < 0 \
and p.find('virtual_documents') < 0 and p.find('idea') < 0 and p.find('venv') < 0:
packages.append(f'{root}/{p}')
setup(
name=hku_name,
version=hku_version,
description=hku_description,
# long_description_content_type="text/x-rst",
long_description_content_type='text/markdown',
long_description=hku_long_description,
author=hku_author,
author_email=hku_author_email,
license=hku_license,
license_files=['LICENSE.txt'],
keywords=hku_keywords,
platforms=hku_platforms,
url=hku_url,
packages=packages, # find_packages(),
zip_safe=False,
include_package_data=True,
package_data={
'': [
'*.rst', '*.pyd', '*.png', '*.md', '*.ipynb', '*.ini', '*.sql', '*.properties', '*.xml',
'LICENSE.txt', '*.dll', '*.exe', '*.ico', '*.so', '*.dylib', '*.h', '*.lib', '*.mo',
'*.so.*', '*.qm', 'libboost_serialization*', 'libboost_python{}*'.format(py_version),
'*.png'
],
},
data_files=hku_data_files,
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 5 - Production/Stable',
# Indicate who your project is intended for
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Office/Business :: Financial',
'Topic :: Office/Business :: Financial :: Investment',
'Topic :: Scientific/Engineering :: Mathematics',
# Pick your license as you wish (should match "license" above)
'License :: OSI Approved :: MIT License',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS :: MacOS X',
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
],
entry_points={
# win11下使用 GUI 方式,会立刻 timeout,导致无法下载
# 'gui_scripts': [
# 'HikyuuTDX=hikyuu.gui.HikyuuTDX:start',
# ],
'console_scripts': [
'HikyuuTDX=hikyuu.gui.HikyuuTDX:start',
'importdata=hikyuu.gui.importdata:main',
'dataserver=hikyuu.gui.dataserver:main',
]
},
install_requires=requirements,
)