rules_pyvenv icon indicating copy to clipboard operation
rules_pyvenv copied to clipboard

setuptools requirement broken in venv

Open bbonenfant opened this issue 1 year ago • 0 comments

When py_venv attempts to install a setuptools dependency into the virtual environment, that setuptools package is broken. I believe this is due to the fact that the venv stdlib module will automatically install a version of setuptools into the fresh virtual environment. Then when the py_venv rule begins creating symlinks to the setuptools package files, it only symlinks to files that do not already exist, resulting in a mangled combination of the pre-installed setuptools package and the desired setuptools package.

I am currently able to work around this using the following extra_pip_commands:

py_venv(
    ...
    extra_pip_commands = [
        "install --ignore-installed setuptools"
    ]
)

which fixes the corrupted setuptools package but is not ideal since I do not believe it's using the "locked" version of setuptools which I am expecting.

bbonenfant avatar Mar 25 '24 22:03 bbonenfant