python - 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
解决方案
https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html#metadata
Setuptools 官方文档将数据类型声明为license_file
“str”和license_files
list-comma
解决方案 1:license_file
与str
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>
推荐阅读
- python - 如何生成 3 个字符前缀的唯一列表
- pandas - 用于转换一列或多列的 Python 函数
- javascript - React.js 导航栏汉堡菜单不会关闭
- api - UPS 运输 REST API
- javascript - WebStorm 将 Objection.js 的 $query() 标记为未解决
- python - 如何在 python hmac sha256 中获取原始输出?
- go - 嵌入式接口:结构没有实现方法
- java - SQL 或 Spring JDBC 返回对象的对象
- c++ - 已连接客户端的唯一标识符
- c - 无法在没有 toupper 的情况下使用 C 中的循环将 char* 指针转换为小写/大写