Skip to content

Skip requirements generation for non-Python content - #75

Merged
dotNomad merged 5 commits into
mainfrom
dotnomad/skip-requirements-non-python
Aug 5, 2026
Merged

Skip requirements generation for non-Python content#75
dotNomad merged 5 commits into
mainfrom
dotnomad/skip-requirements-non-python

Conversation

@dotNomad

@dotNomad dotNomad commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #78.

Deploying Node.js content without a manifest.json failed at the "Generate requirements.txt if needed" step, which demanded a Python dependency source (requirements.txt, uv.lock, or pyproject.toml) for every app type, even though the resolved deploy subcommand (posit connect deploy nodejs) needs none.

resolve_app_type now also reports needs_requirements, mirroring the existing needs_quarto pattern, and deploy/action.yml gates the requirements step on it: true for the mapped Python/Quarto deploy types and fall-through python-*/jupyter-* app modes, false for manifests and everything else (e.g. nodejs). generate-requirements.sh itself is unchanged.

To verify: run the deploy action against existing Node.js content (app_mode nodejs) with no manifest.json in 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.

dotNomad and others added 5 commits August 4, 2026 11:12
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>
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Preview deployed to Connect (localhost:3942): http://localhost:3942/connect/#/apps/0974801b-fa61-4f23-8f70-46da67faea56/draft/8

Deployed from commit 97063e6.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Cleaned up 1 preview bundle(s) on http://localhost:3942: 8

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Preview deployed to Connect (localhost:3941): http://localhost:3941/connect/#/apps/5c59fc02-d526-478e-ae24-4cea8fa73e5a/draft/8

Deployed from commit 97063e6.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Cleaned up 1 preview bundle(s) on http://localhost:3941: 8

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Preview deployed to Connect (localhost:3940): http://localhost:3940/connect/#/apps/4c47fd76-79e9-4658-bce5-f1dd9e515d3e/draft/8

Deployed from commit 97063e6.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Cleaned up 1 preview bundle(s) on http://localhost:3940: 8

@dotNomad
dotNomad marked this pull request as ready for review August 4, 2026 21:35
Comment thread tests/test_apptype.py
"quarto-static",
# Fall-through modes with a Python/Jupyter prefix are Python content
# even without a mapping.
"python-gradio",

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 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 nealrichardson left a comment

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.

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.

@dotNomad
dotNomad merged commit ed4b52b into main Aug 5, 2026
9 checks passed
@dotNomad
dotNomad deleted the dotnomad/skip-requirements-non-python branch August 5, 2026 19:39
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.

Deploying Node.js content fails at the requirements-generation step

2 participants