Skip to content

Commit

Permalink
Correct index safety patch
Browse files Browse the repository at this point in the history
  • Loading branch information
matteius committed Sep 23, 2024
1 parent b4d395d commit 0f8e6a5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
9 changes: 3 additions & 6 deletions pipenv/patched/pip/_internal/models/search_scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,16 @@
logger = logging.getLogger(__name__)


@dataclass(frozen=True)
@dataclass(frozen=False)
class SearchScope:
"""
Encapsulates the locations that pip is configured to search.
"""

__slots__ = ["find_links", "index_urls", "no_index", "index_lookup", "index_restricted"]

find_links: List[str]
index_urls: List[str]
no_index: bool
index_lookup: Optional[Dict[str, str]]
index_restricted: Optional[bool]
index_lookup: Optional[Dict[str, str]] = None
index_restricted: Optional[bool] = None

@classmethod
def create(
Expand Down
26 changes: 16 additions & 10 deletions tasks/vendoring/patches/patched/pip_index_safety.patch
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ index 5f8fdee3d..b7c40c190 100644
return link_collector

diff --git a/pipenv/patched/pip/_internal/models/search_scope.py b/pipenv/patched/pip/_internal/models/search_scope.py
index ee7bc8622..1ea2bdca4 100644
index ee7bc8622..5e24ae67e 100644
--- a/pipenv/patched/pip/_internal/models/search_scope.py
+++ b/pipenv/patched/pip/_internal/models/search_scope.py
@@ -4,7 +4,7 @@ import os
Expand All @@ -48,22 +48,28 @@ index ee7bc8622..1ea2bdca4 100644

from pip._vendor.packaging.utils import canonicalize_name

@@ -21,11 +21,13 @@ class SearchScope:
@@ -15,17 +15,16 @@ from pip._internal.utils.misc import normalize_path, redact_auth_from_url
logger = logging.getLogger(__name__)


-@dataclass(frozen=True)
+@dataclass(frozen=False)
class SearchScope:
"""
Encapsulates the locations that pip is configured to search.
"""

-
- __slots__ = ["find_links", "index_urls", "no_index"]
+ __slots__ = ["find_links", "index_urls", "no_index", "index_lookup", "index_restricted"]

-
find_links: List[str]
index_urls: List[str]
no_index: bool
+ index_lookup: Optional[Dict[str, str]]
+ index_restricted: Optional[bool]
+ index_lookup: Optional[Dict[str, str]] = None
+ index_restricted: Optional[bool] = None

@classmethod
def create(
@@ -33,6 +35,8 @@ class SearchScope:
@@ -33,6 +32,8 @@ class SearchScope:
find_links: List[str],
index_urls: List[str],
no_index: bool,
Expand All @@ -72,7 +78,7 @@ index ee7bc8622..1ea2bdca4 100644
) -> "SearchScope":
"""
Create a SearchScope object after normalizing the `find_links`.
@@ -67,6 +71,8 @@ class SearchScope:
@@ -67,6 +68,8 @@ class SearchScope:
find_links=built_find_links,
index_urls=index_urls,
no_index=no_index,
Expand All @@ -81,7 +87,7 @@ index ee7bc8622..1ea2bdca4 100644
)

def get_formatted_locations(self) -> str:
@@ -124,4 +130,9 @@ class SearchScope:
@@ -124,4 +127,9 @@ class SearchScope:
loc = loc + "/"
return loc

Expand Down

0 comments on commit 0f8e6a5

Please sign in to comment.