aspect-build / rules_py

More compatible Bazel rules for running Python tools and building Python projects
Apache License 2.0
86 stars 28 forks source link

[Bug]: Conflicting symlinks for namespace packages (e.g. PyQt6) #361

Closed dizzy57 closed 4 months ago

dizzy57 commented 4 months ago

What happened?

After adding PyQt6 to the dependencies I see the following when trying to create a venv using this package:

  ├─▶ Conflicting symlinks found when attempting to create venv. More than one package provides the file at these paths
  ├─▶ django_pyqt6/site-packages/PyQt6/__init__.py
  ╰─▶ site-packages/PyQt6/__init__.py

Version

Development (host) and target OS/architectures: macOS aarch64 targeting macOS aarch64, also verified on linux amd64 targeting amd64

Output of bazel --version: 7.0.2

Version of the Aspect rules, or other relevant rules from your WORKSPACE or MODULE.bazel file: HEAD (v0.7.3+)

Language(s) and/or frameworks involved: python namespace packages

How to reproduce

Check out https://github.com/dizzy57/rules_py/tree/venv-namespace
Run `bazel run //py/tests/virtual/django:manage`

Any other information?

It looks like one of the conflicting __init__.py files is provided by the python package, another is created by rules_python.

We encountered this error after upgrading to v0.7.3

thesayyn commented 4 months ago

Possibly duplicate of https://github.com/aspect-build/rules_py/issues/358

mattem commented 4 months ago

Thanks for the repro, this is a duplicate of #358, it's just more obvious with namespace packages. Closing this as the fix is likely the same.