I want to install the streamlink Python package to my corporate environment. For licencing issue, it needs to be:
--no-binary option for streamlink package.STREAMLINK_USE_PYCOUNTRY=1 environment variable so that it doesn't include GPL dependencies.With our current workflow using pip, this is done the following: STREAMLINK_USE_PYCOUNTRY=1 pip install streamlink==1.3.1 --no-binary streamlink. Now we are migrating to uv and need to build an iso environment.
What I tried to do:
STREAMLINK_USE_PYCOUNTRY=1 uv add --group streamlink streamlink==1.3.1 --no-binary-package streamlinkSTREAMLINK_USE_PYCOUNTRY=1 uv pip install streamlink==1.3.1 --no-binary streamlinkThe --no-binary part is fine, but it just keeps ignoring the environment variable. It adds iso-639 and iso3166 dependencies that we can't ship, instead of pycountry as expected.
I checked UV documentation, and environment variables seem to be provided only to uv run command using --env-file, but I found nothing that I could use for adding a package.
For this setting the extra-build-variable setting in the pyproject.toml should work.
[tool.uv]
extra-build-variables = { streamlink = { STREAMLINK_USE_PYCOUNTRY = "1" } }
This will ensure that the environment variable is injected into the isolated build environment used by uv for building Streamlink.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With