-
Notifications
You must be signed in to change notification settings - Fork 24.9k
[BE] Always use python 3.9 for pre-push hook's lintrunner #158693
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/158693
Note: Links to docs will display an error until the docs builds have been completed. ⏳ 15 Pending, 1 Unrelated FailureAs of commit ffdcc40 with merge base 1b5fdb2 ( UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot merge -f "No trunk needed" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
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.
Sounds good!
Mostly questions
@@ -94,7 +101,7 @@ def ensure_tool_installed(tool: str, force_update: bool = False) -> None: | |||
ensure_uv() | |||
|
|||
# Ensure pre-commit is installed globally via uv | |||
ensure_tool_installed("pre-commit", force_update=True) | |||
ensure_tool_installed("pre-commit", force_update=True, python_ver=(3, 9)) |
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 expect this is because it's the version we use for lintrunner in CI?
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.
Yup
command = ["uv", "tool", "install", "--force", tool] | ||
if python_ver: | ||
# Add the Python version to the command if specified | ||
command.extend(["--python", f"{python_ver[0]}.{python_ver[1]}"]) |
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.
nit: do you expect some people will not want you to install this? Should we ask the user to say yes before force installing stuff into their env here?
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.
Right now the process is opt-in, and I'm inclined to default to keep the setup as homogeneous as possible in order to minimize differences in what people end up with.
If folks end up having complaints about their pre-commit check installation using a specific version python, then we can figure out a workaround that that point. But I'm expecting/hoping this will not be a big deal.
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.
Ideally it should be isolated to the point where this shouldn't matter too much.
A follow up to #158389
Sets up the pre-push lintrunner to always use python 3.9, which is what's used in CI