rules_python icon indicating copy to clipboard operation
rules_python copied to clipboard

Add extra packages to the python runtime before pip-parse is executed

Open gdippolito opened this issue 3 years ago • 0 comments

🚀 feature request

Hi! thanks for your great project. This really makes Python in Bazel a much better experience.

Relevant Rules

python_register_toolchains

Description

I was wondering if it would be possible to add the ability to add specific packages to the python runtime before pip-parse or pip-compile run.

In my case I would like to have Pytorch available to the runtime when pip-parse is invoked so that some packages can build extension that depends on the Pytorch APIs.

Describe the solution you'd like

For example something like this would work:

python_register_toolchains(
    name = "python_runtime_with_extra_packages",
    python_version = "3.8",
    toolchain_requiremets_lock = //:my_requirements_file.txt
)

Describe alternatives you've considered

I have tried to download a custom built toolchain with the packages I need. However, I think rules_python will remove any user packages when moving things around?

gdippolito avatar Mar 31 '22 21:03 gdippolito