Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install private git repos #313

Closed
gregwebs opened this issue Apr 12, 2017 · 17 comments
Closed

install private git repos #313

gregwebs opened this issue Apr 12, 2017 · 17 comments
Labels
Type: Bug 🐛 This issue is a bug.

Comments

@gregwebs
Copy link

pipenv supports the format git+https://github.com/org/repo.... However, that will prompt me for a username and password. I expected it to support (as pip does) the form git+git@github.com:org/repo.... However, trying this gives the error message

Invalid Requirement: git-url from above
It looks like a path. Does it exist ?
@nateprewitt
Copy link
Sponsor Member

Hey @gregwebs, thanks for taking the time to open this ticket. If you look at the official documentation for pip, you'll note that installing with dependencies in the format git+git@github.com:org/repo require the -e flag to be passed. You can accomplish this in pipenv with either using the command pipenv install -e git+git@github.com:org/repo... or adding an entry for the package in your Pipfile with the table value editable = 'true'.

Please let us know if you have any further questions.

@nateprewitt
Copy link
Sponsor Member

@gregwebs, forgive my hastiness here. You should be able to pass the -e flag but apparently that has been regressed. I'll try to get this bundled into the 3.6.0 release.

For the time being, you'll need to add an entry to your Pipfile in this format.

package_name = { git = 'git+git@github.com:org/repo/package_name.git', editable = 'true' }

@kennethreitz
Copy link
Contributor

@nateprewitt let's make sure to write a test for this!

@gregwebs
Copy link
Author

Thanks for the workaround! You might want to re-open the issue if you are going to use it to track the regression.

@nateprewitt nateprewitt reopened this Apr 13, 2017
@nateprewitt nateprewitt added the Type: Bug 🐛 This issue is a bug. label Apr 13, 2017
@marctc
Copy link

marctc commented Aug 2, 2017

Im not sure if is the same issue but I think is related. I want to install a private repo in a project:

pipenv install git+ssh://git@gitlab.host.net/mygroup/myproject.git@1.0.0#egg=myproject

It works but it generates this in the Pipfile.lock:

"myproject": {
    "git": "ssh://gitlab.host.net/mygroup/myproject.git",
    "ref": "1.0.0"
}

missing the git@ before the git host. So if you run pipenv install in other environment it prompts you to introduce a password.

@yuvallanger
Copy link

For the perplexed (I sure were), I shall convert https://github.com/kennethreitz/pipenv/issues/313#issuecomment-293915992 into TOML syntax and extend it with a ref:

[packages.package_name]
git = "git@github.com:org/repo/package_name.git"
ref = "a_branch_name_a_tag_or_commit_hash"
editable = "true"

@kennethreitz
Copy link
Contributor

I encourage you to use .netrc

@marctc
Copy link

marctc commented Sep 6, 2017

@kennethreitz the issue that I mentioned it still happening in the last version. Should I open a new issue for this?

@kennethreitz
Copy link
Contributor

Did you explore using nertrc?

@theSage21
Copy link

I think this might be the right place to put this. While using Python 3.6.2 and pipenv, version 9.0.3 the command pipenv install -e git+git@gitlab.com:some/private.git#egg=private exits with an error. It installs correctly but fails on the Pipfile.lock creation.

In the Pipfile the entry "634efac" = {path = "git+git@gitlab.com:someprivate.git", editable = true} gets added. On adding #egg=private to the path, the command pipenv lock succeeds and behaves as expected, correctly generating the lock file but without that it fails by raising pip.exceptions.InstallationError: Could not detect requirement name, please specify one with #egg=.

Is there something I'm doing wrong?

@kennethreitz
Copy link
Contributor

/cc @techalchemy

@clayk
Copy link

clayk commented Feb 7, 2018

@theSage21 I also am seeing this, I opened a separate issue, #1393

@arshbot
Copy link

arshbot commented Jan 9, 2019

How can I change the name of the package? For example I'm trying to install this repo

https://github.com/priestc/python-altcoin-blockchain-parser

But the name pipenv would install it with isn't a valid when importing, so I need to change the name (ideally to pabp). I can't seem to find a way and unfortunately adding the following line doesn't seem to do the job (although installing works fine)

pabp = {editable = true, paths = "git+https://github.com/priestc/python-altcoin-blockchain-parser.git"}

@theSage21
Copy link

The package is actually called blockchain_parser. pipenv install git+https://github.com/priestc/python-altcoin-blockchain-parser#egg=blockchain_parser works for me.

@arshbot
Copy link

arshbot commented Jan 10, 2019

Thanks @theSage21! But, question still stands - is it possible to install a package under a different name for whatever reason (perhaps the package name contains -)?

@astrojuanlu
Copy link

@n-ae
Copy link

n-ae commented Dec 7, 2021

For me, the working solution was adding this line to Pipfile:

package-name = { git = 'git@github.com:org-name/repo-name.git', editable = 'true' }

Note: my package-name and repo-name had the same value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 This issue is a bug.
Projects
None yet
Development

No branches or pull requests

10 participants