Skip to content

fix: report Python-incompatible upgrades - #953

Merged
tdstein merged 3 commits into
mainfrom
symphony/posit-dev_rsconnect-python_945-7367361bbf354bac
Nov 10, 2026
Merged

tdstein merged 3 commits into
mainfrom
symphony/posit-dev_rsconnect-python_945-7367361bbf354bac

Conversation

@tdstein

@tdstein tdstein commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

newer PyPI release
  compatible or unknown Python requirement → existing pip upgrade hint
  incompatible Python requirement → Python version notice and uv install command

Cache the release's Python requirement and refresh legacy cache entries. The uv command selects a compatible Python and adds --force when the current installation has no uv receipt.

Evidence

  • Before: an incompatible newer release received the pip upgrade hint.
  • After: deploy CLI tests cover compatible, incompatible, legacy-cache, and disabled checks, including both uv receipt states.
  • Python 3.14 deploy and CLI tests: 192 passed, 12 skipped; Python 3.8 version-check tests: 18 passed; Ruff checks passed.

Merge Danger

Door: Two-way

Blast Radius: Deploy notices

Closes #945

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.2
Preview removed because the pull request was closed.
2026-11-10 19:37 UTC

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
11208 9990 89% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
rsconnect/version_check.py 93% 🟢
TOTAL 93% 🟢

updated for commit: b421dee by action🐍

@tdstein tdstein left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖 I ran the version check by hand on Python 3.8, 3.13, 3.15 and 3.16.0a1, using a wheel stamped 1.0.0, real deploy runs and an isolated HOME. Detection works in every case: the incompatible notice, upper bounds, prerelease interpreters, old-format caches, invalid specifiers, RSCONNECT_DISABLE_VERSION_CHECK, --quiet and non-deploy commands.

The suggested command is the one problem; details inline. Users who see this notice are, by definition, running a Python the latest release doesn't support, so a bare uv tool install rsconnect-python usually lands them on an older release.

Comment thread rsconnect/version_check.py Resolved
f"Upgrade with: pip install --upgrade rsconnect-python"
f"The latest version of rsconnect-python ({release.version}) requires Python "
f"{release.requires_python}, but you are running Python {python_version}.\n"
f'Install it with: uv tool install {force}--python "{release.requires_python}" rsconnect-python'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I know this is the direction we're going in so its fine, but this instruction being uv specific means that anyone who installed a different way gets a command for a tool they may not have (or they could end up with two installed versions in different locations right?). Again, probably fine, just calling it out here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

anyone who installed a different way gets a command for a tool they may not have

It's entirely possible, but given how well uv tool fits into the problem space we are addressing here, I think its an ok tradeoff for the time being. If it turns out that access to uv ends up being a blocker, then we should investigate other solutions.

@tdstein
tdstein merged commit eb859fd into main Nov 10, 2026
54 checks passed
@tdstein
tdstein deleted the symphony/posit-dev_rsconnect-python_945-7367361bbf354bac branch November 10, 2026 19:37
This was referenced Nov 10, 2026
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.

Version check: notice when the latest release excludes the running Python

2 participants