bazelbuild / rules_python

Bazel Python Rules
https://rules-python.readthedocs.io
Apache License 2.0
538 stars 542 forks source link

[pypi] Support requirements.txt lockfiles without `extras` in them #2399

Open aignas opened 1 week ago

aignas commented 1 week ago

As of now pip.parse has a requirement on being provided with a lockfile with the extras annotations in the file. This is not the default setting for pip-compile >=8.0 and uv pip compile. It also means that we are sometimes pulling unnecessary dependencies into the dependency closure. The way we could in theory remove this requirement is by changing the following parts.

Lock files which have this information that we would need to retrieve from METADATA could be alternatively supported without fetching of the METADATA from the PyPI server (e.g. uv.lock has all of the info we need).

I am writing this idea down in case someone would like to contribute as I would be happy to mentor the contributor and help with finishing the design here.