Open michaelboyd2 opened 3 months ago
I feel like this patch fixes the immediate issue:
--- python/pip_install/tools/dependency_resolver/dependency_resolver.py
+++ python/pip_install/tools/dependency_resolver/dependency_resolver.py
@@ -25,7 +25,7 @@ import click
import piptools.writer as piptools_writer
from piptools.scripts.compile import cli
-from python.runfiles import runfiles
+from rules_python.python.runfiles import runfiles
# Replace the os.replace function with shutil.copy to work around os.replace not being able to
# replace or move files across filesystems.
I could raise a PR with this change if it was thought to be a good idea.
Edit: Now think this may not work with bazlmod where the directory is rules_python~
It is also possible to fix with legacy_create_init = True
but I feel this shouldn't be needed? This issue implies that this will not be an option long term (although I imagine this may not change quickly).
I think this is the same issue that I saw below:
I found this when working on an unrelated change. This means that technically, a root
module could break the non-root
module if a toolchain with coverage is added and the non-root module has not verified that everything works with and without coverage
, which itself would be annoying. This would only manifest in breakage when executing bazel coverage
.
π bug report
Affected Rule
compile_pip_requirements
Is this a regression?
Not sure.
Description
In some situations it is possible to get a conflict between the python module from the coverage package and the python package from the runfiles library. I would say this is due to the slightly risky use of "python" as a module/package name and the import
from python.runfiles import runfiles
in dependency_resolver.py.π¬ Minimal Reproduction
π₯ Exception or Error
π Your Environment
Operating System:
Output of
bazel version
:Rules_python version: