Skip to content

Commit

Permalink
fix certifi path
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming committed Nov 9, 2021
1 parent 1daaa0d commit 4d1df95
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
2 changes: 2 additions & 0 deletions pipenv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
del sys.modules["concurrency"]
except Exception:
pass
if "urllib3" in sys.modules:
del sys.modules["urllib3"]

from pipenv.vendor.vistir.misc import get_text_stream

Expand Down
2 changes: 1 addition & 1 deletion pipenv/patched/notpip/_vendor/certifi/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def where():
# We also have to hold onto the actual context manager, because
# it will do the cleanup whenever it gets garbage collected, so
# we will also store that at the global level as well.
_CACERT_CTX = get_path("pip._vendor.certifi", "cacert.pem")
_CACERT_CTX = get_path("pipenv.patched.notpip._vendor.certifi", "cacert.pem")
_CACERT_PATH = str(_CACERT_CTX.__enter__())

return _CACERT_PATH
Expand Down
39 changes: 26 additions & 13 deletions tasks/vendoring/patches/patched/_post_pip_import.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
diff --git a/pipenv/patched/notpip/__main__.py b/pipenv/patched/notpip/__main__.py
index 204a8ca2..546caab1 100644
--- a/pipenv/patched/notpip/__main__.py
+++ b/pipenv/patched/notpip/__main__.py
@@ -26,6 +26,7 @@ if __name__ == "__main__":
warnings.filterwarnings(
"ignore", category=DeprecationWarning, module=".*packaging\\.version"
)
+ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))))
from pipenv.patched.notpip._internal.cli.main import main as _main

sys.exit(_main())
diff --git a/pipenv/patched/notpip/_internal/cli/req_command.py b/pipenv/patched/notpip/_internal/cli/req_command.py
index cb2c8e86..17c2209f 100644
--- a/pipenv/patched/notpip/_internal/cli/req_command.py
Expand All @@ -21,7 +33,7 @@ index cb2c8e86..17c2209f 100644
finder=finder,
wheel_cache=wheel_cache,
diff --git a/pipenv/patched/notpip/_internal/resolution/resolvelib/candidates.py b/pipenv/patched/notpip/_internal/resolution/resolvelib/candidates.py
index 0ba06c52..3136651b 100644
index 0ba06c52..6fdb59b7 100644
--- a/pipenv/patched/notpip/_internal/resolution/resolvelib/candidates.py
+++ b/pipenv/patched/notpip/_internal/resolution/resolvelib/candidates.py
@@ -253,7 +253,10 @@ class _InstallRequirementBackedCandidate(Candidate):
Expand All @@ -36,15 +48,16 @@ index 0ba06c52..3136651b 100644


class LinkCandidate(_InstallRequirementBackedCandidate):
diff --git a/pipenv/patched/notpip/__main__.py b/pipenv/patched/notpip/__main__.py
index 204a8ca2..546caab1 100644
--- a/pipenv/patched/notpip/__main__.py
+++ b/pipenv/patched/notpip/__main__.py
@@ -26,6 +26,7 @@ if __name__ == "__main__":
warnings.filterwarnings(
"ignore", category=DeprecationWarning, module=".*packaging\\.version"
)
+ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))))
from pipenv.patched.notpip._internal.cli.main import main as _main

sys.exit(_main())
diff --git a/pipenv/patched/notpip/_vendor/certifi/core.py b/pipenv/patched/notpip/_vendor/certifi/core.py
index b8140cf1..5b06ce3f 100644
--- a/pipenv/patched/notpip/_vendor/certifi/core.py
+++ b/pipenv/patched/notpip/_vendor/certifi/core.py
@@ -47,7 +47,7 @@ try:
# We also have to hold onto the actual context manager, because
# it will do the cleanup whenever it gets garbage collected, so
# we will also store that at the global level as well.
- _CACERT_CTX = get_path("pip._vendor.certifi", "cacert.pem")
+ _CACERT_CTX = get_path("pipenv.patched.notpip._vendor.certifi", "cacert.pem")
_CACERT_PATH = str(_CACERT_CTX.__enter__())

return _CACERT_PATH

0 comments on commit 4d1df95

Please sign in to comment.