Python-函数不会从包中导出

时间:2019-01-09 18:12:15

标签: python unit-testing package

我不知道为什么不导出我的python软件包https://github.com/Tazovsky/pyci中的函数:

$ python3 setup.py install                                                                                            
running install
running bdist_egg
running egg_info
writing pyci.egg-info/PKG-INFO
writing dependency_links to pyci.egg-info/dependency_links.txt
writing top-level names to pyci.egg-info/top_level.txt
reading manifest file 'pyci.egg-info/SOURCES.txt'
writing manifest file 'pyci.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-intel/egg
running install_lib
running build_py
creating build/bdist.macosx-10.6-intel/egg
copying build/lib/.DS_Store -> build/bdist.macosx-10.6-intel/egg
creating build/bdist.macosx-10.6-intel/egg/pyci
copying build/lib/pyci/__init__.py -> build/bdist.macosx-10.6-intel/egg/pyci
copying build/lib/pyci/hello.py -> build/bdist.macosx-10.6-intel/egg/pyci
copying build/lib/pyci/make_custom_yml.py -> build/bdist.macosx-10.6-intel/egg/pyci
byte-compiling build/bdist.macosx-10.6-intel/egg/pyci/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/pyci/hello.py to hello.cpython-36.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/pyci/make_custom_yml.py to make_custom_yml.cpython-36.pyc
creating build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying pyci.egg-info/PKG-INFO -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying pyci.egg-info/SOURCES.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying pyci.egg-info/dependency_links.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying pyci.egg-info/not-zip-safe -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying pyci.egg-info/top_level.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
creating 'dist/pyci-0.1.1-py3.6.egg' and adding 'build/bdist.macosx-10.6-intel/egg' to it
removing 'build/bdist.macosx-10.6-intel/egg' (and everything under it)
Processing pyci-0.1.1-py3.6.egg
removing '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyci-0.1.1-py3.6.egg' (and everything under it)
creating /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyci-0.1.1-py3.6.egg
Extracting pyci-0.1.1-py3.6.egg to /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
pyci 0.1.1 is already the active version in easy-install.pth

Installed /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyci-0.1.1-py3.6.egg
Processing dependencies for pyci==0.1.1
Finished processing dependencies for pyci==0.1.1

测试输出:

$ python3 setup.py test
______________________________________________________________________________ ERROR collecting tests/test_make_custom_yaml.py _______________________________________________________________________________
ImportError while importing test module '/Users/user/Projects/pyci/tests/test_make_custom_yaml.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_make_custom_yaml.py:3: in <module>
    from pyci import make_custom_yaml
E   ImportError: cannot import name 'make_custom_yaml'

您能帮助我们理解为什么找不到功能make_custom_yaml吗?

0 个答案:

没有答案