python - 使用 setuptools 构建包时如何避免收到无用的警告?

标签 python setuptools

似乎 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/

相关文章:

python - 如何转义 MANIFEST.in 文件中目录名称中的空格?

python - 在 Python 3 中正确使用全局变量

python - 导入pyspark ETL模块并使用python子进程作为子进程运行时出错

python - Conda setuptools install 将 shebangs 更改为默认 python 安装

python - 无法为 pip 创建 Python 包

python - 在私有(private)服务器上从 zip 文件进行 Pip 安装未安装要求,并且当满足要求时找不到软件包

python - 如何在Open CV Python中消除这些噪音?

python - Tkinter 按钮的突出显示对我不起作用

python - 如何根据 ODR 结果计算标准误差?

python - 如何强制 virtualenv 从 pypi 安装最新的 setuptools 和 pip?