File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change 16
16
17
17
import atexit
18
18
import os
19
+ import re
19
20
import shutil
20
21
import sys
21
22
from pathlib import Path
@@ -185,14 +186,23 @@ def main(
185
186
# and we should copy the updated requirements back to the source tree.
186
187
if not absolute_output_file .samefile (requirements_file_tree ):
187
188
atexit .register (
188
- lambda : shutil .copy (
189
- absolute_output_file , requirements_file_tree
190
- )
189
+ lambda : shutil .copy (absolute_output_file , requirements_file_tree )
191
190
)
192
- cli (argv , standalone_mode = False )
191
+ cli (argv , standalone_mode = False )
193
192
requirements_file_relative_path = Path (requirements_file_relative )
194
193
content = requirements_file_relative_path .read_text ()
195
194
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 )
196
206
requirements_file_relative_path .write_text (content )
197
207
else :
198
208
# cli will exit(0) on success
Original file line number Diff line number Diff line change @@ -51,8 +51,8 @@ _RULE_DEPS = [
51
51
),
52
52
(
53
53
"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 " ,
56
56
),
57
57
(
58
58
"pypi__pep517" ,
@@ -61,8 +61,8 @@ _RULE_DEPS = [
61
61
),
62
62
(
63
63
"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 " ,
66
66
),
67
67
(
68
68
"pypi__pip_tools" ,
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ load(":pypi_repo_utils.bzl", "pypi_repo_utils")
20
20
SRCS = [
21
21
# When the version, or any of the files in `packaging` package changes,
22
22
# 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" ),
24
24
Label ("//python/private/pypi/requirements_parser:resolve_target_platforms.py" ),
25
25
Label ("//python/private/pypi/whl_installer:platform.py" ),
26
26
]
You can’t perform that action at this time.
0 commit comments