DataDog / riot

A Python virtual env builder and command runner
https://ddriot.readthedocs.io/
Apache License 2.0
23 stars 15 forks source link

Add pip_install_args Venv option #158

Closed brettlangdon closed 2 years ago

brettlangdon commented 2 years ago

This is a draft/proposal to add the ability to add extra pip arguments when installing packages.

This is mostly useful if we need to add --no-binary for some packages.

venv = Venv(
    pkgs={
        "gevent": latest
    },
    pip_install_args="--no-binary=gevent",  # this has to be defined where the dependency/pkg is set
    venvs=[
        Venv(
            name="gevent",
            command="python test_gevent.py",
        )
    ]
)
brettlangdon commented 2 years ago

I forgot, you can do this via env variables: https://pip.pypa.io/en/stable/topics/configuration/#environment-variables

PIP_NO_BINARY=gevent pip install gevent