The originating issue here (supporting environment variables in -r and -c paths, within requirements files) is now fixed by https://github.com/astral-sh/uv/pull/2143. If folks want environment variable expansion for other parts of the file (like version specifiers), we need to handle those on a case-by-case basis, so feel free to open a new issue to track it.
We could probably support this, but I don't think we would preserve the environment variables in the output file (unlike for URLs, where we go to great lengths to support it).
Specifying the versions of related packages via envvar would be really useful for us!
Here's an example of what we used to be able to do via
pip-tools
:Originally posted by @charliermarsh in https://github.com/astral-sh/uv/issues/1473#issuecomment-1975402403