【问题标题】:Does description-file in setup.cfg, section "metadata" have any effect?setup.cfg 中的描述文件,“元数据”部分有什么影响吗?
【发布时间】:2020-05-21 20:37:41
【问题描述】:

我最近从 PyPI 下载了 208,492 个 Python 包。其中 18,844 个有一个 setup.cfg 和一个 metadata 部分,其中包含密钥 description-file。该键对 setuptools 或 PyPI 有任何影响吗? the setuptools docs里有提到,但是没看懂。

setup.cfg 示例

[metadata]
description-file = README.md
name = foopackage
long_description = file: README.md
long_description_content_type = text/markdown

【问题讨论】:

    标签: python setuptools pypi


    【解决方案1】:

    代码中没有提到,distutilssetuptools都没有:

    distutils $ grep -Frw description-file .
    distutils $ cd ../setuptools
    setuptools $ grep -Frw description-file .
    

    如果您想通过setup.cfg 发布文件中的长描述,请使用

    long_description = file: README.rst
    

    诡计。见the very setuptools' setup.cfg。在setuptools/config.py处理。

    【讨论】:

    • 一些教程说这个文件的内容显示在 PyPI 上。但这似乎并非如此,设置它可能只是一种货物崇拜仪式。正如 phd 已经写的那样,使用 long_description 代替,description-file 不会出现在 distutils 或 setuptools 中。在当前和旧版 PyPI 版本的源代码中也找不到它。
    • description-file 键特定于 pbr (Python Build Reasonableness) - 具有讽刺意味的是,它发明了一个不合理的新键,而不是重用上述现有的 long_description = file: ... 语法。这就是为什么我们不能拥有美好的东西,伙计们。
    • @CecilCurry 你想让这个评论成为答案吗?
    猜你喜欢
    • 2021-04-04
    • 2019-11-27
    • 1970-01-01
    • 2013-06-07
    • 1970-01-01
    • 1970-01-01
    • 2011-06-21
    • 2015-01-18
    • 2021-04-26
    相关资源
    最近更新 更多