Is there a PyPi source download link that always points to the lastest version?

左心房为你撑大大i 提交于 2021-01-27 07:07:07

问题


Say my latest version of a package is on PyPi and the source can be downloaded with this url:

https://pypi.python.org/packages/source/p/pydy/pydy-0.3.1.tar.gz

I'd really like to have a url that looks like:

https://pypi.python.org/packages/source/p/pydy/pydy-latest.tar.gz

which will always redirect to the latest version, in this case 0.3.1. Does this exist?


回答1:


No, pypi provides no such links. Releases can have multiple download files (binaries for different Python versions, different distribution formats, etc), and that set of downloadable files can differ from version to version.

Use a decent installer tool (such as pip) and have it query pypi for you, then determine what is the latest version and what to best download for that version, instead.

For example, pip install -U will install the latest version for you, or upgrade an already installed version to the latest.

For a project page, just link to the PyPI page without a version:

https://pypi.python.org/pypi/pydy

and visitors are shown the currently visible release. Unless you state otherwise, old releases are automatically hidden when you add a new release.



来源:https://stackoverflow.com/questions/34701312/is-there-a-pypi-source-download-link-that-always-points-to-the-lastest-version

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!