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

Vendor pip 22.0.4 follow-up changes [Diff of actual changes to code] #4969

Closed
wants to merge 34 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
53682cf
check point progress on only bringing in pip==22.0.3
Feb 20, 2022
f3ba76f
updating vendor packaging version
Feb 20, 2022
512b22b
update pipdeptree to fix pipenv graph with new version of pip.
Feb 20, 2022
c37e470
Apply patch logic to pipdeptree.py
Feb 20, 2022
86242c4
Update patch file for pipdeptree
matteius Feb 20, 2022
f814c9c
corrected vendor.text
matteius Feb 20, 2022
aece086
port pip21 patch to pip22 patch
matteius Feb 21, 2022
e4dc20e
fix tabs issue in making patch
matteius Feb 21, 2022
ead6fe2
fix tabs issues from patching
Feb 21, 2022
631dada
correct patch paths
matteius Feb 21, 2022
289c4c9
hardcoded cachecontrol license to satisfy build.
matteius Feb 21, 2022
442882d
hardcoded cachecontrol license to satisfy build.
matteius Feb 21, 2022
7904d41
realizing that I am not to change pip internal, this at least gets th…
Feb 23, 2022
d83570d
This gest the hashes back and fixes handling Specifer or SpecifierSet…
Feb 23, 2022
98b9e9f
new pip requires verrbosity integer argument.
Feb 23, 2022
c3ecd9b
followup verbosity error
matteius Feb 23, 2022
2ec2eb2
Solve for extras packages not getting the specifer set as well.
Feb 23, 2022
b1da183
This test depends on the Pipfile.lock hashes which calls out 1.22 of …
matteius Feb 23, 2022
2d75f08
attempt to change this to the form we use elsewhere in this file
matteius Mar 9, 2022
85d2e8b
small victory: revert change to pip now that I chanegd methodology sa…
Mar 9, 2022
7078e9e
these changes no longer neccessary too
Mar 9, 2022
4da76e2
remove unused imports now
matteius Mar 9, 2022
d612c9d
Update vendoring of pip to 22.0.4 which also fixes 1/2 final failing …
Mar 9, 2022
ff8310b
Merge branch 'issues-4651-vendor-pip-22.0.3' into vendor-pip-22.0.3-f…
Mar 9, 2022
69c75fc
test toggling verbosity to be hardcoded on since someone is going to …
matteius Mar 9, 2022
66aa70b
Update vendored version of pyparsing
Mar 10, 2022
57510b5
Merge branch 'issues-4651-vendor-pip-22.0.3' into vendor-pip-22.0.3-f…
Mar 10, 2022
2a03dc4
This fixes the last test I believe, not sure why I needed this origin…
Mar 10, 2022
40fad79
put this back how it was I guess
Mar 10, 2022
77c98b9
revert this change too because I guess pip 22.0.4 doesnt require it w…
Mar 10, 2022
15763c6
this test also no longer needs to be modified
Mar 10, 2022
d12dec2
Merge branch 'main' into issues-4651-vendor-pip-22.0.3
matteius Mar 19, 2022
f92c63e
Add news fragment and remove python 3.6 runner
matteius Mar 19, 2022
db04891
Merge branch 'issues-4651-vendor-pip-22.0.3' into vendor-pip-22.0.3-f…
matteius Mar 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tabs issue in making patch
  • Loading branch information
matteius committed Feb 21, 2022
commit e4dc20ee2e2445433fde648607b7205a75ad8fd1
36 changes: 18 additions & 18 deletions tasks/vendoring/patches/patched/pip22.patch
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ index daeb7fbc8..88482908b 100644
*,
kind: str,
) -> None:
+ sys_executable = os.environ.get('PIP_PYTHON_PATH', sys.executable)
+ sys_executable = os.environ.get('PIP_PYTHON_PATH', sys.executable)
args: List[str] = [
- sys.executable,
+ sys_executable,
@@ -124,7 +124,7 @@ index 223d06df6..dd5283c7f 100644
target_python: TargetPython,
allow_yanked: bool,
ignore_requires_python: Optional[bool] = None,
+ ignore_compatibility: Optional[bool] = None,
+ ignore_compatibility: Optional[bool] = None,
) -> None:
"""
:param project_name: The user supplied package name.
@@ -139,15 +139,15 @@ index 223d06df6..dd5283c7f 100644
ignore_requires_python = False
+ if ignore_compatibility is None:
+ ignore_compatibility = True

self._allow_yanked = allow_yanked
self._canonical_name = canonical_name
@@ -142,6 +147,7 @@ class LinkEvaluator:
self._target_python = target_python

self.project_name = project_name
+ self._ignore_compatibility = ignore_compatibility
+ self._ignore_compatibility = ignore_compatibility

def evaluate_link(self, link: Link) -> Tuple[bool, Optional[str]]:
"""
@@ -166,10 +172,10 @@ class LinkEvaluator:
@@ -165,7 +165,7 @@ index 223d06df6..dd5283c7f 100644
try:
@@ -181,7 +187,7 @@ class LinkEvaluator:
return (False, reason)

supported_tags = self._target_python.get_tags()
- if not wheel.supported(supported_tags):
+ if not wheel.supported(supported_tags) and not self._ignore_compatibility:
@@ -182,9 +182,9 @@ index 223d06df6..dd5283c7f 100644
# _log_skipped_link().
return (False, None)
@@ -469,7 +475,10 @@ class CandidateEvaluator:

return sorted(filtered_applicable_candidates, key=self._sort_key)

- def _sort_key(self, candidate: InstallationCandidate) -> CandidateSortingKey:
+ def _sort_key(
+ self, candidate: InstallationCandidate,
@@ -215,25 +215,25 @@ index 223d06df6..dd5283c7f 100644
format_control: Optional[FormatControl] = None,
candidate_prefs: Optional[CandidatePreferences] = None,
ignore_requires_python: Optional[bool] = None,
+ ignore_compatibility: Optional[bool] = False
+ ignore_compatibility: Optional[bool] = False
) -> None:
"""
This constructor is primarily meant to be used by the create() class
@@ -605,6 +618,7 @@ class PackageFinder:
self._ignore_requires_python = ignore_requires_python
self._link_collector = link_collector
self._target_python = target_python
+ self._ignore_compatibility = ignore_compatibility
+ self._ignore_compatibility = ignore_compatibility
self._use_deprecated_html5lib = use_deprecated_html5lib

self.format_control = format_control
@@ -701,6 +715,7 @@ class PackageFinder:
target_python=self._target_python,
allow_yanked=self._allow_yanked,
ignore_requires_python=self._ignore_requires_python,
+ ignore_compatibility=self._ignore_compatibility
+ ignore_compatibility=self._ignore_compatibility
)

def _sort_links(self, links: Iterable[Link]) -> List[Link]:
diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py
index 02dbda194..72ab5c1dc 100644
@@ -243,17 +243,17 @@ index 02dbda194..72ab5c1dc 100644
self.unpacked_source_directory,
backend,
backend_path=backend_path,
+ python_executable=os.getenv('PIP_PYTHON_PATH', sys.executable)
+ python_executable=os.getenv('PIP_PYTHON_PATH', sys.executable)
)

def isolated_editable_sanity_check(self) -> None:
diff --git a/src/pip/_vendor/requests/packages.py b/src/pip/_vendor/requests/packages.py
index 9582fa730..5fb6f07df 100644
--- a/src/pip/_vendor/requests/packages.py
+++ b/src/pip/_vendor/requests/packages.py
@@ -4,13 +4,13 @@ import sys
# I don't like it either. Just look the other way. :)

for package in ('urllib3', 'idna', 'chardet'):
- vendored_package = "pip._vendor." + package
+ vendored_package = "pipenv.patched.notpip._vendor." + package
@@ -266,5 +266,5 @@ index 9582fa730..5fb6f07df 100644
- sys.modules['pip._vendor.requests.packages.' + unprefixed_mod] = sys.modules[mod]
+ unprefixed_mod = mod[len("pipenv.patched.notpip._vendor."):]
+ sys.modules['pipenv.patched.notpip._vendor.requests.packages.' + unprefixed_mod] = sys.modules[mod]

# Kinda cool, though, right?