Skip to content

pip freeze filtering drops any line containing "rsconnect" but keeps local editable installs #899

Closed

Description

@tdstein

🤖 The filtering applied to pip freeze output in rsconnect/subprocesses/inspect_environment.py both drops too much and keeps too much.

1. Over-matching: any line containing rsconnect is dropped

[line for line in pip_stdout.split("\n") if (("rsconnect" not in line) and ...)]

This is meant to remove rsconnect-python itself, but it is a substring match. It also drops:

  • unrelated packages whose name contains rsconnect (e.g. my-rsconnect-utils==0.1)
  • every -e /path or name @ file:///path line whose path contains rsconnect (e.g. a project under ~/src/rsconnect-python/... or ~/work/rsconnect-demo/)

These lines disappear from requirements.txt without any message.

2. Under-matching: local editable installs are kept

strip_ref only rewrites name @ file:... lines. -e /local/path lines from editable installs, and pip's # Editable install with no version control (...) comment, pass through into the bundle. Connect can't install from a local path on the publisher's machine, so the build fails.

Repro

uv venv --seed .venv
uv pip install -p .venv/bin/python -e ./localpkg six   # localpkg: any local project
.venv/bin/python -m pip freeze
# -e /abs/path/localpkg   <- passes through into requirements.txt (unless the path contains "rsconnect", then silently dropped)

Suggested direction

Match the rsconnect distribution by exact project name (rsconnect-python / rsconnect_python, case-insensitive, followed by ==, @, or end of line). Warn about, or drop, editable local-path requirements. Related: #857 (the same filter is applied to user-provided requirements files).

Found during live QA of #892 against Posit Connect. Reproduced on 1.32.0 and current main (0287aca3).

Activity

  1. added
    bugSomething isn't working
    ready-for-agentFully specified, ready for an autonomous coding agent
    on Oct 28, 2026
  2. removed
    ready-for-agentFully specified, ready for an autonomous coding agent
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions