Open patrick-kidger opened 5 months ago
Def a bug, thanks.
\cc @konstin - could this be related to any of your URL work?
I've confirmed that this bug exists since 0.1.25 when env vars in pyproject.toml was introduced. The problem is complex to solve: When we cache requirements, we store them as string with their env var resolved, losing the verbatim representation on the url. I tried to change the cache representation of requirements to the extended from (0cb98f419c01935da19b5a82c48d2ec1f2159407), but this clashes with the build hooks and toml parsing trying to return metadata through serde too, but having requirements as string because they come from python or toml respectively, with Metadata23
being used both with the stringly case and in the cache.
Reproduction: Given the following directories:
with contents:
then running
will (correctly) produce a
requirements.txt
with the contentshowever a second invocation of the same command now produces a
requirements.txt
with the contentswhich has had
PROJECT_ROOT
expanded in the transitive dependency!Expected behaviour is for
PROJECT_ROOT
to be preserved inrequirements.txt
, and foruv pip compile
to be idempotent.Calling
uv cache clean
will result in the next invocation ofuv pip compile
being correct, so this seems to be a caching issue. This is usinguv
version0.1.45
on macOS.