I know I can install the master branch with:
pip install git+https://github.com/USER/REPO
I also know I can install a specific release with:
pip install git+https://github.com/USER/REPO@RELEASE
But is there a way to install the latest release (the one GitHub returns at https://github.com/USER/REPO/releases/latest)? I've tried the following:
pip install git+https://github.com/USER/REPO@latest
but it fails:
ERROR: Command errored out with exit status 1: git checkout -q latest
EDIT: This question is not a duplicate of Pip doesn't install latest GitHub release. The latter is about how to install a specific release and/or from the master branch, but not from the latest release.
You can use the github API. Something like
pip install "git+https://github.com/USER/REPO@$(curl -s https://api.github.com/repos/USER/REPO/releases/latest | jq -r ".tag_name")"
would probably work for you. If you don't feel like installing jq, there's e.g. this gist.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With