Skip to content

Commit 7734d82

Browse files
author
gns
committed
[NOT FOR UPSTREAM] stash patch from TF
1 parent 0759322 commit 7734d82

File tree

7 files changed

+534
-29
lines changed

7 files changed

+534
-29
lines changed

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
]

python/private/python_bootstrap_template.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,14 @@ def GetWindowsPathWithUNCPrefix(path):
5252
# removed from common Win32 file and directory functions.
5353
# Related doc: https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later
5454
import platform
55-
if platform.win32_ver()[1] >= '10.0.14393':
55+
version = None
56+
# The try-except block is needed to fix the flakiness of RBE tests
57+
# on Windows 2022 using hermetic python 3.12.8.
58+
try:
59+
version = platform.win32_ver()[1]
60+
except (ValueError, KeyError):
61+
version = platform.win32_ver()[1]
62+
if version and version >= '10.0.14393':
5663
return path
5764

5865
# import sysconfig only now to maintain python 2.6 compatibility

python/private/python_register_toolchains.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def python_register_toolchains(
8686
minor_mapping = minor_mapping or MINOR_MAPPING
8787

8888
python_version = full_version(version = python_version, minor_mapping = minor_mapping)
89+
python_version_kind = kwargs.pop("python_version_kind", "")
8990

9091
toolchain_repo_name = "{name}_toolchains".format(name = name)
9192

@@ -165,6 +166,7 @@ def python_register_toolchains(
165166
toolchain_aliases(
166167
name = name,
167168
python_version = python_version,
169+
python_version_kind = python_version_kind,
168170
user_repository_name = name,
169171
platforms = loaded_platforms,
170172
)

python/private/toolchains_repo.bzl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ def _toolchain_aliases_impl(rctx):
130130
(os_name, arch) = _get_host_os_arch(rctx, logger)
131131

132132
host_platform = _get_host_platform(os_name, arch)
133+
python_version_kind = rctx.attr.python_version_kind
134+
if python_version_kind == "ft":
135+
host_platform += "-freethreaded"
133136

134137
is_windows = (os_name == WINDOWS_NAME)
135138
python3_binary_path = "python.exe" if is_windows else "bin/python3"
@@ -233,6 +236,10 @@ actions.""",
233236
doc = "List of platforms for which aliases shall be created",
234237
),
235238
"python_version": attr.string(doc = "The Python version."),
239+
"python_version_kind": attr.string(
240+
doc = "Python version kind, e.g. ft (free-threaded)",
241+
default = ""
242+
),
236243
"user_repository_name": attr.string(
237244
mandatory = True,
238245
doc = "The base name for all created repositories, like 'python38'.",

0 commit comments

Comments
 (0)