-
-
Notifications
You must be signed in to change notification settings - Fork 639
Description
🚀 feature request
Relevant Rules
pip_repository, whl_library and py_library
Description
rules_python does dependency resolution at the level of a wheel and sets up the entire wheel as one py_library. This difference in the level of granularity here is why we can not handle cyclic dependencies in wheels. Some pip wheels have cyclic dependencies which is valid Python, and pip handles them well. For example, the upcoming PyTorch 2.0 release has a cyclic dependency between the torch (.whl file) and pytorch-triton (.whl file) wheels.
Describe the solution you'd like
The proper solution for this would be to have more granular build units which would also be better from a sandboxing and build caching efficiency perspective. But as an intermediate solution, maybe we could install the wheels with cyclical dependencies between them into one repo (through one whl_library call) and set up the composite of such wheels as one py_library. For gazelle, a resolve directive can ensure that all packages point to the same py_library target.
Describe alternatives you've considered
An alternative could be that I manually build a composite wheel and set it up as a whl_library in my WORKSPACE.