You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
generate: python dx_ignore_import drops the hand-written deps for that import (part of #9237) #9296
# gazelle:dx_ignore_import python <module> stops the import from resolving, and the merge then deletes the hand-written deps that provide that module. The test still imports it, so it fails at runtime.
python/tests/BUILD.bazel ignores rpds; generate removes deps = ["@rust_sdist_pypi//rpds_py"] from rust_sdist_test, which imports rpds (rust_sdist_test.py:46, :70).
python/tests/fixtures/native_ext/BUILD.bazel ignores dxlinked, dxnative and python; generate removes :dxlinked, :dxnative and the Windows @rules_python//python/runfiles select from native_ext_test, which imports all three. The test is Windows-only, so a Linux run never shows the ImportError.
reports ignored_import notices for rpds, dxlinked, dxnative, python and proposes modifying both BUILD files; --apply drops the deps listed above.
Minimal case: a package with # gazelle:dx_ignore_import python foo, a python_test whose source does import foo, and deps = [":foo"]. Generate removes :foo.
Fix
Either keep existing deps on a rule that has an ignored import, or document that such deps need # keep and make generate report the drop. The first matches what users expect from "skip one import".
Done when
Generate on main proposes no change to these two packages and both tests keep their deps.
Activity