问题
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