blob: 6c06909cd7d9b06614ccccb4998a44e872e446a7 [file] [log] [blame]
Richard Levasseur68c30482024-07-16 16:22:22 -07001# Copyright 2024 The Bazel Authors. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14module(name = "module_under_test")
15
16bazel_dep(name = "rules_python", version = "0.0.0")
Richard Levasseur4ccf5b22025-05-03 01:37:15 -070017bazel_dep(name = "bazel_skylib", version = "1.7.1")
18bazel_dep(name = "platforms", version = "0.0.11")
19
Richard Levasseur68c30482024-07-16 16:22:22 -070020local_path_override(
21 module_name = "rules_python",
22 path = "../../..",
23)
24
Richard Levasseur34e433b2025-04-08 22:43:06 -070025local_runtime_repo = use_repo_rule("@rules_python//python/local_toolchains:repos.bzl", "local_runtime_repo")
Richard Levasseur68c30482024-07-16 16:22:22 -070026
Richard Levasseur34e433b2025-04-08 22:43:06 -070027local_runtime_toolchains_repo = use_repo_rule("@rules_python//python/local_toolchains:repos.bzl", "local_runtime_toolchains_repo")
Richard Levasseur68c30482024-07-16 16:22:22 -070028
29local_runtime_repo(
30 name = "local_python3",
31 interpreter_path = "python3",
32 on_failure = "fail",
33)
34
35local_runtime_toolchains_repo(
36 name = "local_toolchains",
37 runtimes = ["local_python3"],
Richard Levasseur4ccf5b22025-05-03 01:37:15 -070038 target_compatible_with = {
39 "local_python3": [
40 "HOST_CONSTRAINTS",
41 ],
42 },
43 target_settings = {
44 "local_python3": [
45 "@//:is_py_local",
46 ],
47 },
Richard Levasseur68c30482024-07-16 16:22:22 -070048)
49
50python = use_extension("@rules_python//python/extensions:python.bzl", "python")
51use_repo(python, "rules_python_bzlmod_debug")
52
53register_toolchains("@local_toolchains//:all")