setuptools 警告:找不到配置的许可证文件“L”

时间:2021-01-07 21:38:56

标签: python python-3.x setuptools licensing python-wheel

我正在使用 python setup.py bdist_wheel 基本上是 setuptools 库。

我的项目在存储库的根目录中包含 LICENSE.txt 文件。

目标:

在轮子中正确包含这个特定的许可文件

相关代码:

setup(
...,
license_files='LICENSE.txt',
...
)

错误:

warning: Failed to find the configured license file 'L'
warning: Failed to find the configured license file 'C'
warning: Failed to find the configured license file 'N'
warning: Failed to find the configured license file 't

1 个答案:

答案 0 :(得分:0)

https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html#metadata

Setuptools 官方文档声明 license_file 的数据类型为“str”,license_files 为列表逗号

解决方案 1:将 license_filestr 结合使用

setup(
...,
license_file='LICENSE.txt',
...
)

解决方案 2a:将 license_files 与逗号分隔的列表一起使用

setup(
...,
license_file=LICENSE.txt,
...
)

带有 license_files 的解决方案 2b setup.cfg

我创建了一个新文件 setup.cfg 并升级了我的 setuptools 以允许它从 setup.cfg 中获取元数据

[metadata]
license_files = <name-of-license-file>

感谢:https://stackoverflow.com/a/48691876/5157515 enter image description here