Git+SSH dependencies have subtle (yet critical) differences from git clone
See original GitHub issueReproduction steps:
- Have a git repository which is private, and is a pip package.
- Have a deploy key which can read the repository.
- Confirm you can run
git clone git@github.com:account/private-pip-package.git
- Google around and discover that the instructions to use a git repo as a pip dependency boil down to very nearly “prefixing the repo with
git+ssh://
and suffix it with#egg=private-pip-package
.” - End up with a pip dependency of
git+ssh://git@github.com:account/private-pip-package.git#egg=private-pip
- Try installing the package, but get a
fatal: Could not read from remote repository.
instead. - Run the gamut of tests (
ssh git@github.com
works, butssh ssh://git@github.com
fails …) - Realize (after much hair-pulling) that instead of
git+ssh://git@github.com:account/private-pip-package.git#egg=private-pip
it should begit+ssh://git@github.com/account/private-pip-package.git#egg=private-pip
(if you didn’t catch that, its github.com/
account instead of github.com:
account)
I would propose that a simple note in the failure message, or checking on input, or what have you, about the :
vs. /
would be quite helpful.
Issue Analytics
- State:
- Created 9 years ago
- Reactions:29
- Comments:32 (9 by maintainers)
Top Results From Across the Web
Trouble installing private github repository using pip
... use github.com /account instead of github.com :account see Git+SSH dependencies have subtle (yet critical) differences from git clone.
Read more >4.1 Git on the Server - The Protocols
Git over HTTPS can be a little more tricky to set up compared to SSH on some servers. Other than that, there is...
Read more >Authenticating pipelines using git secret
A pipeline run or task run might require multiple authentications to access different Git repositories. Annotate each secret with the domains where Pipelines ......
Read more >Use SSH keys to communicate with GitLab
The SSH key generated in WSL is not directly available for Git for Windows, and vice versa, as both have a different home...
Read more >esx extra items
Contribute to BZN999/esx_extraitems development by creating an account on GitHub. Sharing templates and files results. With ESX Server, there are three ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Pip wants to know the version before fetching (git clone) the dependency. If we specify the version after the project name in the egg string, in this hacky form:
egg=<project name>-<version>
, then there will be an item in_find_all_versions()
's returned list, and everything goes fine. So if we want to dependent our package on the latest commit in the branchSTABLE-X
of a VCS repository, we can do this:But, it’s too hacky! I think these days it’s so reasonable to have a project dependant on the latest version of a branch of some VCS repository, and there should be no need on specifying a dummy version number as a workaround for this purpose.
Hi guys, I am having the very same problem of not being able to install a specific commit of a Github-hosted project using setuptools’
dependency_links
option, and was wondering if this was still considered a bug or a misunderstanding of setuptools.Say, for example, that I want to install a specific commit of the project paramiko-expect; for example, https://github.com/fgimian/paramiko-expect/tree/943630ac499284e6441854a9c4ae1e04301bfdd9
Here is what works and what doesn’t, using pip 8.1.2 and setuptools 23.1.0:
pip install "git+ssh://git@github.com/fgimian/paramiko-expect.git@943630a#egg=paramiko-expect-0.2"
dependency_links
insetup.py
)git+ssh://git@github.com/fgimian/paramiko-expect.git@943630a#egg=paramiko-expect-0.2
dependency_links
insetup.py
)https://github.com/fgimian/paramiko-expect/archive/943630ac499284e6441854a9c4ae1e04301bfdd9.zip#egg=paramiko-expect-0.2
dependency_links
insetup.py
)https://github.com/fgimian/paramiko-expect/zipball/943630a#egg=paramiko-expect-0.2
Note that the
setup.py
file then hasparamiko-expect==0.2
in itsinstall_requires
field, and that I tried all possible variants ofparamiko-expect
versusparamiko_expect
. Thesetup.py
file is then used by typingpip install .
.Is there something I’m missing here? Best, Aurélien