-
-
Notifications
You must be signed in to change notification settings - Fork 635
Description
🚀 feature request
Relevant Rules
pip.parse
Description
Currently the pip.parse needs the hub_name parameter, which in reality is quite often set to pypi or pip in the root module. In the non-root modules the users should be also able to use pip or pypi names and this could be the default hub_name value.
Describe the solution you'd like
Minimum (for 1.0.0):
- Set the
hub_namedefault value topypi(it should not bepipbecause we are not usingpiphere andpypiis a more generic term). - Support isolation of
pip.parseextension usage via theisolateparameter. - We could force users to use the
isolateparameter if thehub_nameis not set, or if it is set topiporpypivalues
Extra (post 1.0.0):
- Support passing
pyproject.tomland/or constraint files topip.parseinstead of the lock file itself. Enable users to lock the dependency tree via@pypi//:locktarget to generate a lock file in the users workspace. An alternative would be to merge the requirements in some way, but that could be harder. This greatly depends on Supportuvas part ofrules_python#1975 becauseuvhas a lot of different flags to allow overriding dependencies in the constraint files and may enable us to have a working solution. Merging the lock file by just blindly using the lowest version of all could work, but may not be reliable and the solution to properly do the locking may be required.
The lock file merging is used in the go ecosystem and requiring users to either name the hub repo that collects the spoke repos or using a default name is the convention of rules_go/gazelle, see bazel-contrib/bazel-gazelle#1584. Also see bazelbuild/bazel#20186, which talks about stabilizing extension isolation feature. Having rules_python supporting it may be a good way to give feedback to bazel devs.
See #2088 for a slightly related topic.
Describe alternatives you've considered
The main alternative would be to not support it and keep things as they are, but that could make it harder to implement the isolation later down the line. What is more, supporting isolation of the extensions could make the pip code simpler, because we could just ask the user to use isolate if we see clashes.