精简setup.py查找子模块函数

This commit is contained in:
xuejianqing 2018-10-10 23:30:23 +08:00 committed by joans321
parent 9aa7521e11
commit d5e7533789

View File

@ -19,22 +19,11 @@ other financial markets.
import os
from setuptools import setup
from setuptools import setup, find_packages
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(
name='vnpy',
version=vnpy.__version__,
@ -55,7 +44,7 @@ setup(
'Topic :: Office/Business :: Financial :: Investment',
'Programming Language :: Python :: Implementation :: CPython',
'License :: OSI Approved :: MIT License'],
packages=getSubpackages('vnpy'),
packages=find_packages(),
package_data={'': ['*.json', '*.md', '*.ico',
'*.h', '*.cpp', '*.bash', '*.txt',
'*.dll', '*.lib', '*.so', '*.pyd',