how to set bug tracker url in setup.py script

后端 未结 2 371
广开言路
广开言路 2020-12-29 04:30

I have just discovered the pypi web UI have a field \'Bug tracker URL\' in edit of egg metadata.

This field exists so I guess it is supported in setup.py but I can\'

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-29 05:17

    Bug tracker URL on PyPi project

    In setup.py use project_urls in the setup :

    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',
        },
    ...
    )
    

    The dict order is kept but listed in reversed on PyPi:

    About PyPi bugtracker_url legacy code

    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.

    And

    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...

提交回复
热议问题