commit | b99027fbd0a62d25c933e7efee0fff4329bfed59 | [log] [tgz] |
---|---|---|
author | Richard Levasseur <rlevasseur@google.com> | Fri Dec 15 16:39:22 2023 -0800 |
committer | GitHub <noreply@github.com> | Sat Dec 16 00:39:22 2023 +0000 |
tree | e87a7efa4e8f5f5a7594bfb9966d306423e68bd7 | |
parent | 847c03f6e830a792a2b9d97e10928268962a7fcb [diff] |
fix(pip.parse): allow absolute path for python_interpreter; skip hermetic toolchain lookup when used (#1619) The `python_interpreter` arg wasn't being properly handled in the bzlmod code in two ways. 1. Lookup of a hermetic runtime wasn't being skipped when it was set. The net effect was it ignored the specified interpreter and would try to lookup a hermetic interpreter using the python version. To fix, add a check for python_interpreter to the guard of the lookup. 2. Specifying an absolute path for the value wasn't being converted to a `path` object, which meant a plain string eventually made its way to some code expecting a `path` object. To fix, call `repository_ctx.path()` on the path to convert it to a path object. Fixes https://github.com/bazelbuild/rules_python/issues/1618
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.
Currently, the core rules build into the Bazel binary, and the symbols in this repository are simple aliases. However, we are migrating the rules to Starlark and removing them from the Bazel binary. Therefore, the future-proof way to depend on Python rules is via this repository. SeeMigrating from the Bundled Rules
below.
The core rules are stable. Their implementation in Bazel is subject to Bazel's backward compatibility policy. Once migrated to rules_python, they may evolve at a different rate, but this repository will still 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.