Skip to content

Commit

Permalink
fix: Remove --no-build-isolation from pip install command (#2360)
Browse files Browse the repository at this point in the history
Fixes #2328.

In #2126, we discussed and added `--no-build-isolation` to ensure that
sdist builds pulled from rules_python supplied dependencies. An
unanticipated/misunderstood side-effect of this is that pip will no
longer resolve necessary, declared build time dependencies from a
package index. That's a significant point of friction for users, and,
it's much harder to opt-out of the behavior than to opt-in given the
presence of `extra_pip_args`.
  • Loading branch information
mark-thm authored Oct 31, 2024
1 parent 2b6308c commit b6fc2a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ A brief description of the categories of changes:
([2310](https://github.com/bazelbuild/rules_python/issues/2310)).
* (publish) The dependencies have been updated to the latest available versions
for the `twine` publishing rule.
* (whl_library) Remove `--no-build-isolation` to allow non-hermetic sdist builds
by default. Users wishing to keep this argument and to enforce more hermetic
builds can do so by passing the argument in
[`pip.parse#extra_pip_args`](https://rules-python.readthedocs.io/en/latest/api/rules_python/python/extensions/pip.html#pip.parse.extra_pip_args)

{#v0-0-0-fixed}
### Fixed
Expand Down
4 changes: 2 additions & 2 deletions examples/bzlmod/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion python/private/pypi/whl_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def _whl_library_impl(rctx):
# and, allow getting build dependencies from PYTHONPATH, which we
# setup in this repository rule, but still download any necessary
# build deps from PyPI (e.g. `flit_core`) if they are missing.
extra_pip_args.extend(["--no-build-isolation", "--find-links", "."])
extra_pip_args.extend(["--find-links", "."])

args = _parse_optional_attrs(rctx, args, extra_pip_args)

Expand Down

0 comments on commit b6fc2a0

Please sign in to comment.