commit | 7d42a93a55aa1d3a8778eb80bc690cf6e90eb769 | [log] [tgz] |
---|---|---|
author | Richard Levasseur <rlevasseur@google.com> | Tue Sep 10 14:42:36 2024 -0700 |
committer | GitHub <noreply@github.com> | Tue Sep 10 21:42:36 2024 +0000 |
tree | ba8d1c792f0e55b19eb6bcc3a3af789ba3e245e7 | |
parent | a6cd158eeaa5d887480e90351596c94d32b18bce [diff] |
tests: make precompile tests pass when other toolchains are defined (#2213) This makes the precompile_tests pass when the environment defines custom toolchains that don't match what rules_python defines in its dev environment. This keeps the tests independent of whatever the user's environment is. Basically, the tests rely on a fake Python version 4.5 toolchain for the precompiler being defined. They pass today because they fallback to a real toolchain (as setup by MODULE.bazel), which doesn't have any version constraints on it. In comparison, within Google, there is no "default" toolchain, so the tests fail to find what they need. To fix, explicitly define a fake precompiler toolchain and tell the test to use it. Along the way: * Also force `--allow_unresolved_symlinks=true` in the tests. This flag isn't enabled in certain environments, but is implicitly relied upon by the `current_interpreter_executable` rule when a platform runtime is used (as they are in the tests). * Move the Python testing toolchains to support/py_toolchains, to match where the cc testing toolchains were moved.
This repository is the home of the core Python rules -- py_library
, py_binary
, py_test
, py_proto_library
, and related symbols that provide the basis for Python support in Bazel. It also contains package installation rules for integrating with PyPI and other indices.
Documentation for rules_python is at https://rules-python.readthedocs.io and in the Bazel Build Encyclopedia.
Examples live in the examples directory.
The core rules are stable. Their implementation is subject to Bazel's backward compatibility policy. This repository aims to follow semantic versioning.
The Bazel community maintains this repository. Neither Google nor the Bazel team provides support for the code. However, this repository is part of the test suite used to vet new Bazel releases. See How to contribute page for information on our development workflow.
For detailed documentation, see https://rules-python.readthedocs.io
See Bzlmod support for more details.