| Richard Levasseur | 68c3048 | 2024-07-16 16:22:22 -0700 | [diff] [blame] | 1 | # 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. |
| 14 | module(name = "module_under_test") |
| 15 | |
| 16 | bazel_dep(name = "rules_python", version = "0.0.0") |
| Richard Levasseur | 4ccf5b2 | 2025-05-03 01:37:15 -0700 | [diff] [blame] | 17 | bazel_dep(name = "bazel_skylib", version = "1.7.1") |
| 18 | bazel_dep(name = "platforms", version = "0.0.11") |
| 19 | |
| Richard Levasseur | 68c3048 | 2024-07-16 16:22:22 -0700 | [diff] [blame] | 20 | local_path_override( |
| 21 | module_name = "rules_python", |
| 22 | path = "../../..", |
| 23 | ) |
| 24 | |
| Richard Levasseur | 34e433b | 2025-04-08 22:43:06 -0700 | [diff] [blame] | 25 | local_runtime_repo = use_repo_rule("@rules_python//python/local_toolchains:repos.bzl", "local_runtime_repo") |
| Richard Levasseur | 68c3048 | 2024-07-16 16:22:22 -0700 | [diff] [blame] | 26 | |
| Richard Levasseur | 34e433b | 2025-04-08 22:43:06 -0700 | [diff] [blame] | 27 | local_runtime_toolchains_repo = use_repo_rule("@rules_python//python/local_toolchains:repos.bzl", "local_runtime_toolchains_repo") |
| Richard Levasseur | 68c3048 | 2024-07-16 16:22:22 -0700 | [diff] [blame] | 28 | |
| 29 | local_runtime_repo( |
| 30 | name = "local_python3", |
| 31 | interpreter_path = "python3", |
| 32 | on_failure = "fail", |
| 33 | ) |
| 34 | |
| 35 | local_runtime_toolchains_repo( |
| 36 | name = "local_toolchains", |
| 37 | runtimes = ["local_python3"], |
| Richard Levasseur | 4ccf5b2 | 2025-05-03 01:37:15 -0700 | [diff] [blame] | 38 | target_compatible_with = { |
| 39 | "local_python3": [ |
| 40 | "HOST_CONSTRAINTS", |
| 41 | ], |
| 42 | }, |
| 43 | target_settings = { |
| 44 | "local_python3": [ |
| 45 | "@//:is_py_local", |
| 46 | ], |
| 47 | }, |
| Richard Levasseur | 68c3048 | 2024-07-16 16:22:22 -0700 | [diff] [blame] | 48 | ) |
| 49 | |
| 50 | python = use_extension("@rules_python//python/extensions:python.bzl", "python") |
| 51 | use_repo(python, "rules_python_bzlmod_debug") |
| 52 | |
| 53 | register_toolchains("@local_toolchains//:all") |