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

feat(pip-compile): support tool version constraints with uv #34029

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

maxbrunet
Copy link
Contributor

@maxbrunet maxbrunet commented Feb 4, 2025

Changes

  • Extract Python version constraint from uv's --python-version flag
  • Support uv tool constraint from config

Context

Follow up to #33952 (comment)

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

if (compileArgs.commandType === 'uv') {
pythonVersion = compileArgs.pythonVersion;
} else {
pythonVersion = extractPythonVersion(existingOutput, outputFileName);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you still fall back to this if python version is missing from the args?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would not be useful since uv does not write the Python version to the header. If the user does not specify the version with --python-version, uv's behavior is to use the latest version available in the environment

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it prefer config constraints from user config?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@viceice can you clarify what you mean by that?

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

Successfully merging this pull request may close these issues.

4 participants