问题描述
我正在使用
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
解决方法
https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html#metadata
Setuptools 官方文档声明 license_file
的数据类型为“str”,license_files
为列表逗号
解决方案 1:将 license_file
与 str
结合使用
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>