Skip to content

When parsing .python-version rsconnect-python should adapt the version constraint to UV behavior #661

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

Closed
amol- opened this issue Apr 25, 2025 · 0 comments
Assignees

Comments

@amol-
Copy link
Contributor

amol- commented Apr 25, 2025

In most cases the .python-version file will contain just a version number like "3.12".

This introduces two issues:

  1. "3.12" is not a valid PEP440 version specification, while uv handles it, connect does not as it expects ==3.12
  2. ==3.12 actually means ==3.12.0 as version numbers are 0 padded. But that's not the behaviour you get in UV, as uv will use any available patch version. So we should intend it as ==3.12.*.

Thus rsconnect-python when parsing .python-version should check if it's a valid version specifier ( https://packaging.python.org/en/latest/specifications/version-specifiers/#id5 ) and if none of the comparison operators is specified ( ~=, ==, !=, <=, >=, <, >) it should prefix it with ~= as it's the operator that matches default uv behaviour.

@amol- amol- self-assigned this Apr 25, 2025
@amol- amol- closed this as completed Apr 25, 2025
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