精简setup.py查找子模块函数
This commit is contained in:
parent
9aa7521e11
commit
d5e7533789
15
setup.py
15
setup.py
@ -19,22 +19,11 @@ other financial markets.
|
|||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from setuptools import setup
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
import vnpy
|
import vnpy
|
||||||
|
|
||||||
|
|
||||||
def getSubpackages(name):
|
|
||||||
"""获取该模块下所有的子模块名称"""
|
|
||||||
splist = []
|
|
||||||
|
|
||||||
for dirpath, _dirnames, _filenames in os.walk(name):
|
|
||||||
if os.path.isfile(os.path.join(dirpath, '__init__.py')):
|
|
||||||
splist.append(".".join(dirpath.split(os.sep)))
|
|
||||||
|
|
||||||
return splist
|
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='vnpy',
|
name='vnpy',
|
||||||
version=vnpy.__version__,
|
version=vnpy.__version__,
|
||||||
@ -55,7 +44,7 @@ setup(
|
|||||||
'Topic :: Office/Business :: Financial :: Investment',
|
'Topic :: Office/Business :: Financial :: Investment',
|
||||||
'Programming Language :: Python :: Implementation :: CPython',
|
'Programming Language :: Python :: Implementation :: CPython',
|
||||||
'License :: OSI Approved :: MIT License'],
|
'License :: OSI Approved :: MIT License'],
|
||||||
packages=getSubpackages('vnpy'),
|
packages=find_packages(),
|
||||||
package_data={'': ['*.json', '*.md', '*.ico',
|
package_data={'': ['*.json', '*.md', '*.ico',
|
||||||
'*.h', '*.cpp', '*.bash', '*.txt',
|
'*.h', '*.cpp', '*.bash', '*.txt',
|
||||||
'*.dll', '*.lib', '*.so', '*.pyd',
|
'*.dll', '*.lib', '*.so', '*.pyd',
|
||||||
|
Loading…
Reference in New Issue
Block a user