-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__init__.py still created, despite --incompatible_default_to_explicit_init_py #12238
Labels
P3
We're not considering working on this, but happy to review a PR. (No assignee)
team-Rules-Python
Native rules for Python
type: bug
Comments
lberki
added
P3
We're not considering working on this, but happy to review a PR. (No assignee)
and removed
untriaged
labels
Nov 18, 2020
Is there a workaround for this? |
fmeum
added a commit
to fmeum/bazel
that referenced
this issue
Oct 11, 2022
Adding incompatible options is error-prone as it is easy to forget to add them to their corresponding `FragmentOption`'s `getHost` method. If this is not done, the flag will have no effect in the exec configuration, which has already caused very surprising, buggy behavior in numerous cases. This commit adds a test to verify that all non-deprecated incompatible flags: 1. are tagged with the `INCOMPATIBLE_CHANGE` metadata tag; 2. are preserved in the exec configuration. Fixes bazelbuild#12238 Fixes bazelbuild#16388
fmeum
added a commit
to fmeum/bazel
that referenced
this issue
Oct 11, 2022
Adding incompatible options is error-prone as adding them to their corresponding `FragmentOption`'s `getHost` method is easily forgotten. In that case, the flag will have no effect in the exec configuration, which has already caused very surprising, buggy behavior in numerous cases. This commit adds a test to verify that all non-deprecated incompatible flags: 1. are tagged with the `INCOMPATIBLE_CHANGE` metadata tag; 2. are preserved in the exec configuration. Fixes bazelbuild#12238 Fixes bazelbuild#16388
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
P3
We're not considering working on this, but happy to review a PR. (No assignee)
team-Rules-Python
Native rules for Python
type: bug
Description of the problem / feature request:
When
--incompatible_default_to_explicit_init_py
is passed, no__init__.py
files are created for apy_binary
target. However, when that target is used in agenrule
, still the__init__.py
files are created.Feature requests: what underlying problem are you trying to solve with this feature?
I have a code generator written in Python, which depends on third party code which uses python namespace packages.
Invoking the
py_binary
target of the code generator works fine (provided that--incompatible_default_to_explicit_init_py
is passed to Bazel). Using this target as a tool in agenrule
or withctx.actions.run
fails because Bazel still creates__init__.py
files in that case.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Consider the following
BUILD
file:And
test.py
:Furthermore, the following empty files exist:
WORKSPACE
pylib1/foo/bar/a.py
pylib2/foo/bar/b.py
This command works as expected:
bazel run --incompatible_default_to_explicit_init_py :test
While this command unexpectedly fails:
bazel build --incompatible_default_to_explicit_init_py :gen
... with this error:
Probably caused because Bazel created
__init__.py
files:What operating system are you running Bazel on?
This issue is reproducible on both Linux and Windows.
What's the output of
bazel info release
?release 3.4.1
andrelease 3.6.0
on Linuxrelease 3.5.0
on WindowsHave you found anything relevant by searching the web?
I tried to search the github issue database and stackoverflow/google.
Any other information, logs, or outputs that you want to share?
Nope.
The text was updated successfully, but these errors were encountered: