似乎 setuptools 触发了各种警告,这些警告实际上是零值,我想摆脱它们,因为它们正在向持续集成进程发送垃圾信息,使发现真正的警告变得更加困难。
以下是我确实想要摆脱的那些:
python setup.py -q bdist_wheel
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.pyc' found under directory '*'
warning: no previously-included files matching '*.pyo' found under directory '*'
warning: no previously-included files matching '*.orig' found under directory '*'
warning: no files found matching '*.md' under directory 'releases'
warning: no files found matching '*.rst' under directory 'releases'
warning: no files found matching '*.json' under directory 'releases'
warning: no previously-included files matching '*' found under directory 'examples/node_modules'
no previously-included directories found matching 'examples/node_modules'
warning: build_py: byte-compiling is disabled, skipping.
warning: install_lib: byte-compiling is disabled, skipping.
看来这一切都是MANIFEST.in
引起的文件,但那里的条件确实有存在的理由,而当排除模式确实找不到匹配的文件时,这显然不是生成警告的原因之一?!
最佳答案
目前我只找到一个解决此问题的方法:
导出 PYTHONDONTWRITEBYTECODE=
这将避免在构建过程中收到这些恼人的警告。
关于python - 使用 setuptools 构建包时如何避免收到无用的警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35984019/