-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
pipenv doesn't honor NETRC environment variable #4771
Comments
This functionality is especially useful during automated builds, such as on a Jenkins worker, where the |
I've played around a bit locally trying to figure out where the variable is being lost, since it appears that it should be getting used/checked, as that bit of logic from the requests library is currently included in the vendored requests code, but for some reason, falls through unused My understanding of the pipenv project structure is basically 0, so grain of salt, but the only thing I could find that seemed relevant was that the current notpip/.../requests version doesn't have the recent-enough requests code to leverage the NETRC values |
It looks like there is currently (or, was, hasn't been updated in 8 months) an outstanding WIP draft PR to bump the pip version to |
bumping pip to 21.0 seemed to have supposedly included as part of Switch the resolver from piptools to pip internal; I'll have to try grabbing latest versions and testing to see if is now honored as expected |
@bigpick any updates? |
Hey 👋 , sorry for the delay, but it looks good now! Checking what I have currently (trying this just now on macOS, fwiw):
With a test
and a
A "sources": [
{
"name": "Private Repo",
"url": "https://privatehost/artifactory/api/pypi/privaterepo/simple",
"verify_ssl": true
}
] Doing a clean re-install with a custom rm Pipfile.lock
pipenv --rm
mv ~/.netrc /some/non/default/dir/.netrc
export NETRC=/some/non/default/dir/.netrc
pipenv install (i.e it also successfully installs and shows the expected source in the lock file) |
Issue description
pipenv does not honor the
NETRC
environment variable.Expected result
pipenv should leverage the path specified in the
NETRC
environment variable; requests library does this already:Actual result
pipenv does not use the set
NETRC
variable, defaulting to only~/.netrc
and~/_netrc
paths. If using a private source (e.g Artifactory) as aurl
in[[source]]
, this results in a[pipenv.exceptions.ResolutionFailure]
:Copying the
.netrc
file from the custom dir to either~/.netrc
and/or~/_netrc
then successfully works with no other modifications to thePipfile
file (and it resolves with public sources fine as well, so is not an issue with the packages/dependencies or something like that)Steps to replicate
Pipfile:
Create a
.netrc
in some directory path thats not~/.netrc
or~/_netrc
(and make sure that there are no files there currently, otherwise, temporarily move them to something like~/.netrc.temp_backup
.Then set
NETRC
to the path to that file:export NETRC=/some/path/to/that/.netrc
Then, try:
The text was updated successfully, but these errors were encountered: