uv pip compile doesn't read pyproject.toml or .python-version to default the --python-version flag (astral-sh/uv#9581). Running uv pip compile --python-version=$(cat .python-version) is an acceptable workaround, but this doesn't work using the pip-compile pre-commit hook because pre-commit just passes the arguments as literal strings and uv pip compile can't do the variable expansion dynamically.
Are there any recommended ways to not have to hardcode --python-version here?
uv pip compiledoesn't readpyproject.tomlor.python-versionto default the--python-versionflag (astral-sh/uv#9581). Runninguv pip compile --python-version=$(cat .python-version)is an acceptable workaround, but this doesn't work using thepip-compilepre-commit hook because pre-commit just passes the arguments as literal strings anduv pip compilecan't do the variable expansion dynamically.Are there any recommended ways to not have to hardcode
--python-versionhere?