Skip to content

Commit cd11e69

Browse files
committed
fix the majority of the tests
1 parent ee29882 commit cd11e69

File tree

5 files changed

+206
-253
lines changed

5 files changed

+206
-253
lines changed

python/private/pypi/extension.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ EXPERIMENTAL: this may be removed without notice.
665665
""",
666666
),
667667
"target_platforms": attr.string_list(
668-
default = ["{os}_{arch}"],
668+
default = [],
669669
doc = """\
670670
The list of platforms for which we would evaluate the requirements files. If you need to be able to
671671
only evaluate for a particular platform (e.g. "linux_x86_64"), then put it in here.

python/private/pypi/hub_builder.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ def _pip_parse(self, module_ctx, pip_attr):
142142
python_version = full_python_version,
143143
config = self._config,
144144
# TODO @aignas 2025-12-09: flip or part to default to 'os_arch' after
145-
# VERSION_NEXT_FEATURE is released
145+
# VERSION_NEXT_FEATURE is released and set the default of the `target_platforms` attribute
146+
# to `{os}_{arch}`.
146147
target_platforms = pip_attr.target_platforms or ([] if default_cross_setup else ["{os}_{arch}"]),
147148
)
148149
_add_group_map(self, pip_attr.experimental_requirement_cycles)

python/private/pypi/requirements_files_by_platform.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ def requirements_files_by_platform(
144144

145145
input_platforms = platforms
146146
default_platforms = [_platform(p, python_version) for p in platforms]
147+
if logger:
148+
logger.debug(lambda: "Input platforms: {}".format(input_platforms))
147149

148150
if platforms_from_args:
149151
lock_files = [

tests/pypi/extension/extension_tests.bzl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ load(":pip_parse.bzl", _parse = "pip_parse")
2222

2323
_tests = []
2424

25-
def _mock_mctx(*modules, environ = {}, read = None):
25+
def _mock_mctx(*modules, os_name = "unittest", arch_name = "exotic", environ = {}, read = None):
2626
return struct(
2727
os = struct(
2828
environ = environ,
29-
name = "unittest",
30-
arch = "exotic",
29+
name = os_name,
30+
arch = arch_name,
3131
),
3232
read = read or (lambda _: """\
3333
simple==0.0.1 \
@@ -148,6 +148,8 @@ def _test_simple(env):
148148
),
149149
],
150150
),
151+
os_name = "linux",
152+
arch_name = "x86_64",
151153
),
152154
available_interpreters = {
153155
"python_3_15_host": "unit_test_interpreter_target",

0 commit comments

Comments
 (0)