| workspace( | |
| name = "module_under_test", | |
| ) | |
| local_repository( | |
| name = "rules_python", | |
| path = "../../..", | |
| ) | |
| load("@rules_python//python:repositories.bzl", "py_repositories") | |
| py_repositories() | |
| load("@rules_python//python/local_toolchains:repos.bzl", "local_runtime_repo", "local_runtime_toolchains_repo") | |
| # Step 1: Define the python runtime. | |
| local_runtime_repo( | |
| name = "local_python3", | |
| interpreter_path = "python3", | |
| on_failure = "fail", | |
| # or interpreter_path = "C:\\path\\to\\python.exe" | |
| ) | |
| # Step 2: Create toolchains for the runtimes | |
| local_runtime_toolchains_repo( | |
| name = "local_toolchains", | |
| runtimes = ["local_python3"], | |
| ) | |
| # Step 3: Register the toolchains | |
| register_toolchains("@local_toolchains//:all") |