You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rsconnect write-manifest <framework> --force-generate fails even though -g was passed:
$ rsconnect write-manifest api -g .
Error: The requirements file 'requirements.txt' does not exist in '.'.
Please create the file or specify a different file with --requirements-file.
To have the requirements file generated using pip freeze, pass --force-generate.
Cause
manifest_writer resolves the requirements file with force_generate and passes None (meaning "use pip freeze") to _write_framework_manifest. _write_framework_manifest then resolves it again with force_generate=False (rsconnect/main.py:4485), which turns None back into the default requirements.txt.
This affects every framework subcommand built by generate_write_manifest_python (api, flask, fastapi, dash, streamlit, bokeh, shiny, gradio, panel). write-manifest notebook -g is not affected.
Fix
Use the already-resolved value in _write_framework_manifest instead of re-resolving it, and add a test that write-manifest api -g writes a manifest and requirements.txt without an existing requirements file.
Context: the Connect docs dropped --force-generate guidance partly because of this (posit-dev/connect#46493).
Activity
tdstein commentedon Oct 27, 2026
tdstein commentedon Oct 27, 2026
Codex Workpad
Plan
Acceptance Criteria
write-manifest api -gcreates a manifest and generatedrequirements.txtwithout a preexisting requirements file.Validation
Command:
.venv/bin/pytest -q tests/test_main.py::TestWriteManifestFramework tests/test_main.py::TestWriteManifestCRLF tests/test_main.py::TestWriteManifestExcludeRenv tests/test_write_manifest_pyproject.py tests/test_environment.pyCommit: 577cb37
Observed: 69 passed.
Command:
.venv/bin/ruff check rsconnect/main.py tests/test_main.pyCommit: 577cb37
Command:
.venv/bin/ruff format --check rsconnect/main.py tests/test_main.pyCommit: 577cb37
Command:
git diff HEAD^ HEAD --checkCommit: 577cb37
Evidence
Reproduction
project_dir=$(mktemp -d /tmp/rsconnect-888-XXXXXX); printf 'app = object()\n' > "$project_dir/app.py"; .venv/bin/rsconnect write-manifest api -g "$project_dir"-g.Notes
AGENTS.md.577cb379e7b33729bfa6cbe40baa75e6084113a6; 69 focused tests and Ruff and diff checks pass.Confusions