Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to read --python-version from file with pip-compile hook #34

Open
ollie-bell opened this issue Jan 6, 2025 · 0 comments
Open

How to read --python-version from file with pip-compile hook #34

ollie-bell opened this issue Jan 6, 2025 · 0 comments

Comments

@ollie-bell
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant