-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
124 changed files
with
18,915 additions
and
7,544 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .core import where, old_where | ||
|
||
__version__ = "2018.01.18" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from certifi import where | ||
print(where()) |
2,947 changes: 882 additions & 2,065 deletions
2,947
pip/_vendor/requests/cacert.pem → pip/_vendor/certifi/cacert.pem
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
certifi.py | ||
~~~~~~~~~~ | ||
This module returns the installation location of cacert.pem. | ||
""" | ||
import os | ||
import warnings | ||
|
||
|
||
class DeprecatedBundleWarning(DeprecationWarning): | ||
""" | ||
The weak security bundle is being deprecated. Please bother your service | ||
provider to get them to stop using cross-signed roots. | ||
""" | ||
|
||
|
||
def where(): | ||
f = os.path.dirname(__file__) | ||
|
||
return os.path.join(f, 'cacert.pem') | ||
|
||
|
||
def old_where(): | ||
warnings.warn( | ||
"The weak security bundle has been removed. certifi.old_where() is now an alias " | ||
"of certifi.where(). Please update your code to use certifi.where() instead. " | ||
"certifi.old_where() will be removed in 2018.", | ||
DeprecatedBundleWarning | ||
) | ||
return where() | ||
|
||
if __name__ == '__main__': | ||
print(where()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
2e142d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this commit is quite a big change (compatibility-wise), pitty that happened in only a minor version change. :(
More specifically, doing:
import requests
import pip
after this would break, as the standalone
requests
would conflict with the bundled one. That wouldn't happen in 9.0.22e142d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @xrg!
Importing
pip
is an unsupported use of pip, which is a command line tool, that just happens to be written in Python. You can find more details at #5081.There was an announcement made a few months back about this change. Any user of
import pip
should switch to using pip in a supported manner as documented or acknowledge that they're fiddling with pip's internals and act accordingly.2e142d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my case I've been trying to "read" the internals, to extract some config information: "where is the active pip config and what is the Pypi URL currently configured? "
With all respect for the work you've done so far, should we also consider a minimal API or allow an easy way to implement such "extensions" on pip?
2e142d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xrg A pip command line invocation (
pip info
or similar) could be added to provide this sort of information. That would be a reasonable enhancement request. Although as I'm sure you're aware the information you quote is not that simple to get - pip has multiple config locations that get merged, and allows for multiple index URLs - how to present that sort of data is something that could be thrashed out as part of designing apip info
command, though.2e142d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for the configuration, I imagine
pip config
in pip 10 should be able to satisfy your requirements.2e142d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh. Sorry @pradyunsg I keep forgetting we now have
pip config
. Yes, that would give the information @xrg needs (apart from the name of the config file, but withpip config
he shouldn't need that...)(Apparently
pip config edit --editor=echo
will give the config filename. I'm not sure I'd consider that as legitimate use, though!)