Skip to content

Commit

Permalink
精简setup.py查找子模块函数
Browse files Browse the repository at this point in the history
  • Loading branch information
joans321 committed Oct 17, 2018
1 parent 9aa7521 commit d5e7533
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,11 @@


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__,
Expand All @@ -55,7 +44,7 @@ def getSubpackages(name):
'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',
Expand Down

0 comments on commit d5e7533

Please sign in to comment.