Skip to content

Commit 9b406af

Browse files
committed
Updated pip and packaging versions to work with free-threading packages
1 parent 66a8b5b commit 9b406af

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

python/private/pypi/dependency_resolver/dependency_resolver.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import atexit
1818
import os
19+
import re
1920
import shutil
2021
import sys
2122
from pathlib import Path
@@ -185,14 +186,23 @@ def main(
185186
# and we should copy the updated requirements back to the source tree.
186187
if not absolute_output_file.samefile(requirements_file_tree):
187188
atexit.register(
188-
lambda: shutil.copy(
189-
absolute_output_file, requirements_file_tree
190-
)
189+
lambda: shutil.copy(absolute_output_file, requirements_file_tree)
191190
)
192-
cli(argv, standalone_mode = False)
191+
cli(argv, standalone_mode=False)
193192
requirements_file_relative_path = Path(requirements_file_relative)
194193
content = requirements_file_relative_path.read_text()
195194
content = content.replace(absolute_path_prefix, "")
195+
# Replace the lines like: # via -r /absolute/path/to/requirements_extra.in
196+
# with: # via -r requirements_extra.in
197+
pattern = re.compile(r"(# via -r )(/.+/requirements.*\.in)")
198+
199+
def replace_abspath_with_name(match):
200+
assert match is not None
201+
# match[1] is "# via -r "
202+
# match[2] is "/absolute/path/to/requirements*.in"
203+
return match[1] + Path(match[2]).name
204+
205+
content = pattern.sub(replace_abspath_with_name, content)
196206
requirements_file_relative_path.write_text(content)
197207
else:
198208
# cli will exit(0) on success

python/private/pypi/deps.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ _RULE_DEPS = [
5151
),
5252
(
5353
"pypi__packaging",
54-
"https://files.pythonhosted.org/packages/49/df/1fceb2f8900f8639e278b056416d49134fb8d84c5942ffaa01ad34782422/packaging-24.0-py3-none-any.whl",
55-
"2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5",
54+
"https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl",
55+
"09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759",
5656
),
5757
(
5858
"pypi__pep517",
@@ -61,8 +61,8 @@ _RULE_DEPS = [
6161
),
6262
(
6363
"pypi__pip",
64-
"https://files.pythonhosted.org/packages/8a/6a/19e9fe04fca059ccf770861c7d5721ab4c2aebc539889e97c7977528a53b/pip-24.0-py3-none-any.whl",
65-
"ba0d021a166865d2265246961bec0152ff124de910c5cc39f1156ce3fa7c69dc",
64+
"https://files.pythonhosted.org/packages/ef/7d/500c9ad20238fcfcb4cb9243eede163594d7020ce87bd9610c9e02771876/pip-24.3.1-py3-none-any.whl",
65+
"3790624780082365f47549d032f3770eeb2b1e8bd1f7b2e02dace1afa361b4ed",
6666
),
6767
(
6868
"pypi__pip_tools",

python/private/pypi/evaluate_markers.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ load(":pypi_repo_utils.bzl", "pypi_repo_utils")
2020
SRCS = [
2121
# When the version, or any of the files in `packaging` package changes,
2222
# this file will change as well.
23-
Label("@pypi__packaging//:packaging-24.0.dist-info/RECORD"),
23+
Label("@pypi__packaging//:packaging-24.2.dist-info/RECORD"),
2424
Label("//python/private/pypi/requirements_parser:resolve_target_platforms.py"),
2525
Label("//python/private/pypi/whl_installer:platform.py"),
2626
]

0 commit comments

Comments
 (0)