Skip requirements generation for non-Python content - #75
Conversation
The "Generate requirements.txt if needed" step unconditionally required a Python dependency source (requirements.txt, uv.lock, or pyproject.toml), failing the deploy for content that legitimately has none — e.g. Node.js apps, whose dependencies come from package.json/package-lock.json. The app type is already resolved one step earlier, so thread it through: AppType gains a needs_requirements flag (true for the mapped Python/Quarto deploy types and fall-through python-*/jupyter-* app modes, false otherwise and for manifests), the CLI emits it as an output, and action.yml gates the requirements step on it — mirroring the existing needs_quarto pattern. generate-requirements.sh itself is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CLAUDE.md's project overview still claimed only Python app types are supported; the docstring's em dash broke the file's `--` convention; and generate-requirements.sh now notes that its manifest check is redundant on the action path since the step is gated on needs_requirements. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Preview deployed to Connect ( Deployed from commit 97063e6. |
|
Cleaned up 1 preview bundle(s) on http://localhost:3942: 8 |
|
Preview deployed to Connect ( Deployed from commit 97063e6. |
|
Cleaned up 1 preview bundle(s) on http://localhost:3941: 8 |
|
Preview deployed to Connect ( Deployed from commit 97063e6. |
|
Cleaned up 1 preview bundle(s) on http://localhost:3940: 8 |
| "quarto-static", | ||
| # Fall-through modes with a Python/Jupyter prefix are Python content | ||
| # even without a mapping. | ||
| "python-gradio", |
There was a problem hiding this comment.
I think this means that our mapping is incomplete, and a gradio app would fail to deploy. (There is effectively no "fall-through mode".) We should fix that and make sure that everything on https://docs.posit.co/connect/user/manifest/index.html#appmode is supported.
nealrichardson
left a comment
There was a problem hiding this comment.
Thank you for this. One note about another issue this reveals.
I don't love how complicated the implementation is getting here, so I'll make a followup about refactoring. I think the logic can be simpler.
Fixes #78.
Deploying Node.js content without a
manifest.jsonfailed at the "Generate requirements.txt if needed" step, which demanded a Python dependency source (requirements.txt,uv.lock, orpyproject.toml) for every app type, even though the resolved deploy subcommand (posit connect deploy nodejs) needs none.resolve_app_typenow also reportsneeds_requirements, mirroring the existingneeds_quartopattern, anddeploy/action.ymlgates the requirements step on it: true for the mapped Python/Quarto deploy types and fall-throughpython-*/jupyter-*app modes, false for manifests and everything else (e.g.nodejs).generate-requirements.shitself is unchanged.To verify: run the deploy action against existing Node.js content (app_mode
nodejs) with nomanifest.jsonin the app directory. Before this change the run failed with "No uv.lock or pyproject.toml file found"; now the step is skipped and the deploy proceeds.