forked from QuantFans/quantdigger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
105 lines (94 loc) · 3.41 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
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
# -*- coding: utf8 -*-
import codecs
import os
import sys
import util
import platform
from distutils.util import convert_path
from fnmatch import fnmatchcase
from setuptools import setup, find_packages
def read(fname):
return codecs.open(os.path.join(os.path.dirname(__file__), fname)).read()
standard_exclude = ["*.py", "*.pyc", "*$py.class", "*~", "*.bak"]
standard_exclude_directories = [
"_darcs", "./build", "./dist", "EGG-INFO", "*.egg-info", "*.bak"
]
def find_package_data(
where=".",
package="",
exclude=standard_exclude,
exclude_directories=standard_exclude_directories,
only_in_packages=True,
show_ignored=False):
out = {}
stack = [(convert_path(where), "", package, only_in_packages)]
while stack:
where, prefix, package, only_in_packages = stack.pop(0)
for name in os.listdir(where):
fn = os.path.join(where, name)
if os.path.isdir(fn):
bad_name = False
for pattern in exclude_directories:
if (fnmatchcase(name, pattern)
or fn.lower() == pattern.lower()):
bad_name = True
if show_ignored:
print >> sys.stderr, (
"Directory %s ignored by pattern %s"
% (fn, pattern))
break
if bad_name:
continue
if (os.path.isfile(os.path.join(fn, "__init__.py"))
and not prefix):
if not package:
new_package = name
else:
new_package = package + "." + name
stack.append((fn, "", package, False))
else:
stack.append((fn, prefix + name + "/", package, only_in_packages))
elif package or not only_in_packages:
# is a file
bad_name = False
for pattern in exclude:
if (fnmatchcase(name, pattern)
or fn.lower() == pattern.lower()):
bad_name = True
if show_ignored:
print >> sys.stderr, (
"File %s ignored by pattern %s"
% (fn, pattern))
break
if bad_name:
continue
out.setdefault(package, []).append(prefix+name)
return out
PACKAGE = "quantdigger"
NAME = "QuantDigger"
DESCRIPTION = "量化交易PYTHON回测系统"
AUTHOR = "QuantFans"
AUTHOR_EMAIL = "[email protected]"
URL = "https://github.com/QuantFans/quantdigger"
VERSION = "0.2.00"
setup(
name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=read("./README.rst").decode('utf-8'),
author=AUTHOR,
author_email=AUTHOR_EMAIL,
license="MIT",
url=URL,
packages=find_packages(),
package_data=find_package_data(PACKAGE, only_in_packages=False),
scripts=['util.py','dependency.py','install_pip.py','install.py','install_dependency.py'],
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
],
zip_safe=False,
)