Skip to content

deploy and write-manifest don't warn when the frozen environment doesn't satisfy the Python version requirement #927

Closed

Description

@tdstein

deploy and write-manifest don't warn when the Python environment they freeze doesn't satisfy the project's Python version requirement. rsconnect preflight already detects this case and warns.

Repro

With #920 (rsconnect selects the project .venv). On main or 1.32.0, the same mismatch occurs between the Python running rsconnect and the requirement.

mkdir proj && cd proj
printf 'from flask import Flask\napp = Flask(__name__)\n' > app.py
echo 3.11 > .python-version
uv venv -p 3.12 .venv && uv pip install -p .venv/bin/python flask
rsconnect write-manifest api . --force-generate

The command succeeds with no warning. The manifest records:

"python": {"version": "3.12.12", ...},
"environment": {"python": {"requires": "~=3.11.0"}}

Connect honors requires and builds with Python 3.11, installing packages that were frozen on 3.12. That works for pure-Python packages, but pins can differ, or be missing, for packages whose wheels or dependencies depend on the Python version.

rsconnect preflight on the same directory reports:

Local Python 3.12.12 does not satisfy the project requirement ~=3.11.0; dependency compatibility has not been tested.

Expected

When generating requirements from an environment, deploy and write-manifest should give the same warning as preflight (rsconnect/preflight.py) if the selected interpreter doesn't satisfy the detected version requirement (.python-version, requires-python, or python_requires).

Context

This isn't new: 1.32.0 had the same mismatch, but between the Python running rsconnect and the requirement. With #920 (#889), rsconnect freezes the project's own environment, so the frozen packages and the recorded version come from the environment the user actually uses. A mismatch there is more likely a mistake worth surfacing.

Found during manual QA of #920 against a local Posit Connect.

Activity

  1. self-assigned this
    on Nov 6, 2026
  2. added
    ready-for-agentFully specified, ready for an autonomous coding agent
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ready-for-agentFully specified, ready for an autonomous coding agent

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions