如何在中设置bug tracker url设置.py临时票据

2024-09-30 01:22:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我刚刚发现pypiwebui在egg元数据的编辑中有一个字段“Bug tracker URL”。在

此字段存在,因此我想它在中受支持设置.py但是我在谷歌上找不到任何关于这个的信息。在

那么问题是如何在我的设置.py因此,在pypi上执行dist释放时,可以自动填充它。在


Tags: 数据pypypi信息url编辑eggdist
2条回答

PyPi项目上的Bug tracker URL

在设置.py在设置中使用project_urls

setup(
...
    project_urls={
        'Documentation': 'https://readthedocs.io/',
        'Funding': 'https://donate.pypi.org',
        'Say Thanks!': 'http://saythanks.io/to/example',
        'Source': 'https://github.com/pypa/sampleproject/',
        'Tracker': 'https://github.com/pypa/sampleproject/issues',
    },
...
)

保留dict顺序,但列在reversed on PyPi

enter image description here

关于PyPibugtracker_url遗留代码

pypa/warehouse Issue #233

bugtrack_url: IIRC it was something added by the PyPI maintainers to help projects, but in parallel PEP 345 introduced Project-URL which was intended to cover source code repository, bug tracker, mailing list, etc. If PEP 426 or one of its companion keeps Project-URL (and maybe improves it with defined labels for common sites, e.g. "repository"), then this special case becomes redundant.

以及

At the moment, it looks like this is hardcoded to None in their API. I guess they left the field for backwards compatibility when they migrated...

该条目名为bugtrack_url,但它没有从setup.py中提取。在

context和{a2}我了解到,它只打算在PyPI上通过web使用,根据项目元数据,而不是通常的每个版本信息。在

该字段现在被认为是legacy field(硬编码为None),您可以通过Project-URL list添加此类信息,您可以通过^{} entrysetuptools中设置:

    project_urls={
        'Documentation': 'https://packaging.python.org/tutorials/distributing-packages/',
        'Funding': 'https://donate.pypi.org',
        'Say Thanks!': 'http://saythanks.io/to/example',
        'Source': 'https://github.com/pypa/sampleproject/',
        'Tracker': 'https://github.com/pypa/sampleproject/issues',
    },

这个选项是finally added to ^{} in November 2017,在版本38.3.0中登陆。在

相关问题 更多 >

    热门问题