-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
enhancementNew feature or improvement to existing functionalityNew feature or improvement to existing functionalityneeds-decisionUndecided if this should be doneUndecided if this should be done
Description
Summary
When using the uv python pin --global command, it currently requires a specific Python version to be provided. As opposed to showing an error: "No pinned Python version found," it would be more user-friendly if the command could automatically determine and use the latest available Python version or the version currently selected in the current project (if a .python-version file exists).
Steps to Reproduce
- Run uv python pin --global without specifying a version.
- Observe the error message: "No pinned Python version found."
Expected Behavior
- If no version is specified, uv python pin --global should:
- Check for the latest available Python version and use that.
- Alternatively, if a .python-version file exists in the current project, use the version specified in that file.
Actual Behavior
- The command fails with the error message "No pinned Python version found" and requires a specific version to be provided.
System Information
UV Version: 0.7.11
Python Version: 3.13
Operating System: Linux
Related Documentation
UV Python Version Management
UV Install Python Guide
Thank you for considering this enhancement!
Example
- Use Case: Users often want to set a global Python version that matches their current project or the latest available version without having to manually specify it each time.
- Proposed Solution:
- Add a flag to automatically determine the latest version or use the current project's version.
- Example: uv python pin --global --latest to use the latest available version.
- Example: uv python pin --global --set-current-to-global to use the version specified in the current project's .python-version file.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or improvement to existing functionalityNew feature or improvement to existing functionalityneeds-decisionUndecided if this should be doneUndecided if this should be done