-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
base: main
Are you sure you want to change the base?
feat(pip-compile): support tool version constraints with uv #34029
Conversation
if (compileArgs.commandType === 'uv') { | ||
pythonVersion = compileArgs.pythonVersion; | ||
} else { | ||
pythonVersion = extractPythonVersion(existingOutput, outputFileName); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to say, yes, but I'm not clear on what you mean either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
He is referring to what does take priority? The python version extracted from the package file or user configuration in renovate.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so, yes, it prefers the value in renovate.json
over the extracted value, I have not changed this part of the code:
renovate/lib/modules/manager/pip-compile/common.ts
Lines 18 to 36 in 4e48b5f
export function getPythonVersionConstraint( | |
config: UpdateArtifactsConfig, | |
extractedPythonVersion: string | undefined, | |
): string | undefined | null { | |
const { constraints = {} } = config; | |
const { python } = constraints; | |
if (python) { | |
logger.debug('Using python constraint from config'); | |
return python; | |
} | |
if (extractedPythonVersion) { | |
logger.debug('Using python constraint extracted from the lock file'); | |
return `==${extractedPythonVersion}`; | |
} | |
return undefined; | |
} |
Changes
--python-version
flaguv
tool constraint from configContext
Follow up to #33952 (comment)
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: