Skip to content

Commit

Permalink
Issue 5000 remove requests certifi (#5146)
Browse files Browse the repository at this point in the history
* Depend on requests and certifi from vendored pip and remove it as explicit vendor dependency.

* Documentation tweak.

* Add a news fragment.

* Update remaining vendor dependencies to point at the pip requests.

* vendoring task needs requests.
  • Loading branch information
matteius authored Jun 27, 2022
1 parent fb0f888 commit 0ee8234
Show file tree
Hide file tree
Showing 40 changed files with 17 additions and 9,704 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
with:
python-version: 3.9
- run: |
python -m pip install --upgrade wheel invoke parver bs4 vistir towncrier
python -m pip install --upgrade wheel invoke parver bs4 vistir towncrier requests
python -m invoke vendoring.update
tests:
name: ${{matrix.os}} / ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions docs/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ flag::
py==1.4.34
pytest==3.2.3

Adding the ``--hash`` flag will add package hashes to the output for extra security.
Adding the ``--exclude-markers`` flagwill exclude the markers from the output.
Adding the ``--hash`` flag adds package hashes to the output for extra security.
Adding the ``--exclude-markers`` flag excludes the markers from the output.

The locked requirements are written to stdout, with shell output redirection
used to write them to a file::
Expand Down
1 change: 1 addition & 0 deletions news/5000.vendor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Depend on ``requests`` and ``certifi`` from vendored ``pip`` and remove them as explicit vendor dependencies.
2 changes: 1 addition & 1 deletion news/5092.behavior.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Adjust ``pipenv requirements`` to add markers and add an ``--exclude-markers`` option to allow the exclusion of markers
Adjust ``pipenv requirements`` to add markers and add an ``--exclude-markers`` option to allow the exclusion of markers.
4 changes: 2 additions & 2 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def import_requirements(project, r=None, dev=False):
from pipenv.patched.notpip._internal.req.constructors import (
install_req_from_parsed_requirement,
)
from pipenv.patched.notpip._vendor import requests as pip_requests
from pipenv.patched.notpip._vendor import requests
from pipenv.vendor.pip_shims.shims import parse_requirements

# Parse requirements.txt file with Pip's parser.
Expand Down Expand Up @@ -196,7 +196,7 @@ def import_requirements(project, r=None, dev=False):
trusted_hosts = sorted(set(trusted_hosts))
reqs = [
install_req_from_parsed_requirement(f)
for f in parse_requirements(r, session=pip_requests)
for f in parse_requirements(r, session=requests)
]
for package in reqs:
if package.name not in BAD_PACKAGES:
Expand Down
2 changes: 1 addition & 1 deletion pipenv/patched/safety/safety.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import time
from collections import namedtuple

import pipenv.vendor.requests as requests
import pipenv.patched.notpip._vendor.requests as requests
from pipenv.vendor.packaging.specifiers import SpecifierSet

from .constants import (API_MIRRORS, CACHE_FILE, CACHE_LICENSES_VALID_SECONDS,
Expand Down
2 changes: 1 addition & 1 deletion pipenv/utils/internet.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def _get_requests_session(max_retries=1):
global requests_session
if requests_session is not None:
return requests_session
import requests
from pipenv.patched.notpip._vendor import requests

requests_session = requests.Session()
adapter = requests.adapters.HTTPAdapter(max_retries=max_retries)
Expand Down
21 changes: 0 additions & 21 deletions pipenv/vendor/certifi/LICENSE

This file was deleted.

3 changes: 0 additions & 3 deletions pipenv/vendor/certifi/__init__.py

This file was deleted.

12 changes: 0 additions & 12 deletions pipenv/vendor/certifi/__main__.py

This file was deleted.

4,257 changes: 0 additions & 4,257 deletions pipenv/vendor/certifi/cacert.pem

This file was deleted.

60 changes: 0 additions & 60 deletions pipenv/vendor/certifi/core.py

This file was deleted.

2 changes: 1 addition & 1 deletion pipenv/vendor/pip_shims/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
Union,
)

from requests import Session
from pipenv.patched.notpip._vendor.requests import Session

from .utils import TShim, TShimmedFunc, TShimmedPath

Expand Down
175 changes: 0 additions & 175 deletions pipenv/vendor/requests/LICENSE

This file was deleted.

Loading

0 comments on commit 0ee8234

Please sign in to comment.