| commit | ae2eb7075fe12585c55d6bd6522cc688d20db94c | [log] [tgz] |
|---|---|---|
| author | Richard Levasseur <rlevasseur@google.com> | Fri Jul 19 15:20:46 2024 -0700 |
| committer | GitHub <noreply@github.com> | Fri Jul 19 22:20:46 2024 +0000 |
| tree | 596015b6294e37dd3d6ffe034706b553cef1a5d1 | |
| parent | ecad092ffa97ac236fb9a6b33ff7f5af4af80eb6 [diff] |
fix: insert user imports before runtime site-packages (#2073) Previously, all the user import paths were put at the end of sys.path. This was done so that user import paths didn't hide stdlib modules. However, a side-effect is that user import paths came after the runtime's site-packages directory. This prevented user imports from overriding non-stdlib modules included in a runtime (e.g. pip). To fix, we look for the runtime site-packages directory, then insert the user import paths before it. A test is used to ensure that the ordering is `[stdlib, user, runtime site-packages]` Also fixes a bug introduced by #2076: safe path was being disabled by default Fixes https://github.com/bazelbuild/rules_python/issues/2064
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.