ast*_*nlu 5 python packaging setuptools
我的Python包有以下结构:
$ tree -d | grep -v "__pycache__"
.
??? src
? ??? poliastro
? ? ??? iod
? ? ??? tests
? ? ??? twobody
? ? ??? tests
??? setup.py
??? MANIFEST.in
47 directories
Run Code Online (Sandbox Code Playgroud)
执行python setup.py build完Buf后,最内层test目录不会被复制:
$ tree -d | grep -v "__pycache__"
.
??? build
? ??? lib
? ? ??? poliastro
? ? ??? iod
? ? ??? tests
? ? ??? twobody
Run Code Online (Sandbox Code Playgroud)
相反,python setup.py sdist正常工作.
到目前为止,我已经使用MANIFEST.in规则来包含或排除sdist中的某些文件,模式和目录.有没有办法控制build目录的内容?为什么有些测试会到达而有些测试却没有?
参考原始问题和源代码:https://github.com/poliastro/poliastro/issues/129
你的setup()失踪了include_package_data=True。请参阅我制作的此 PR https://github.com/poliastro/poliastro/pull/139
讨论:如果没有这个,默认情况下不会包含非 python 包文件(例如您列出的不在“包中”的测试 py 文件),即使它们在技术上是包含的 Python 包目录树的一部分。
/HTH
| 归档时间: |
|
| 查看次数: |
590 次 |
| 最近记录: |