diff --git a/CHANGELOG.md b/CHANGELOG.md index d343ae255c..6ccc568d26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -119,6 +119,9 @@ Unreleased changes template. change. Fixes [#2468](https://github.com/bazelbuild/rules_python/issues/2468). + (gazelle) Gazelle no longer ignores `setup.py` files by default. To restore this behavior, apply the `# gazelle:python_ignore_files setup.py` directive. +* Don't re-fetch whl_library, python_repository, etc. repository rules + whenever `PATH` changes. Fixes + [#2551](https://github.com/bazelbuild/rules_python/issues/2551). [pep-695]: https://peps.python.org/pep-0695/ diff --git a/python/private/repo_utils.bzl b/python/private/repo_utils.bzl index 0e3f7b024b..e5c78be815 100644 --- a/python/private/repo_utils.bzl +++ b/python/private/repo_utils.bzl @@ -256,7 +256,7 @@ def _which_checked(mrctx, binary_name): def _which_unchecked(mrctx, binary_name): """Tests to see if a binary exists. - This is also watch the `PATH` environment variable. + Watches the `PATH` environment variable if the binary doesn't exist. Args: binary_name: name of the binary to find. @@ -268,12 +268,12 @@ def _which_unchecked(mrctx, binary_name): * `describe_failure`: `Callable | None`; takes no args. If the binary couldn't be found, provides a detailed error description. """ - path = _getenv(mrctx, "PATH", "") binary = mrctx.which(binary_name) if binary: _watch(mrctx, binary) describe_failure = None else: + path = _getenv(mrctx, "PATH", "") describe_failure = lambda: _which_describe_failure(binary_name, path) return struct(