首页 > 解决方案 > setuptools 警告:找不到配置的许可证文件“L”

问题描述

我正在使用 python setup.py bdist_wheel Basicsetuptools库构建一个轮子。

我的项目包含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

标签: pythonpython-3.xsetuptoolslicensingpython-wheel

解决方案


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

Setuptools 官方文档将数据类型声明为license_file“str”和license_fileslist-comma

解决方案 1:license_filestr

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

解决方案 2a:使用license_files逗号分隔列表

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

解决方案 2b setup.cfg 与license_files

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

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

感谢:https ://stackoverflow.com/a/48691876/5157515 在此处输入图像描述


推荐阅读