Skip to content

Decide requirements generation from files present, not app mode - #84

Merged
dotNomad merged 1 commit into
mainfrom
dotnomad/simplify-requirements-generation
Aug 5, 2026
Merged

Decide requirements generation from files present, not app mode#84
dotNomad merged 1 commit into
mainfrom
dotnomad/simplify-requirements-generation

Conversation

@dotNomad

@dotNomad dotNomad commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

generate-requirements.sh now branches only on which files are in the working directory, and a missing dependency source is a no-op instead of an exit 1.

posit connect deploy already decides whether content needs a requirements.txt, and it does so more precisely than an app_mode lookup can: it inspects the Python environment for a jupyter-engine Quarto doc but not a knitr-engine one, and never for Node.js. When one is required and missing, it raises an error naming the file.

That removes the reason for needs_requirements, so it comes out of AppType, resolve_app_type, the CLI output, and the deploy step's if: condition, along with REQUIREMENTS_DEPLOY_TYPES.

One case the app_mode gate got wrong and this fixes: a knitr-engine Quarto doc with no Python anywhere resolved to needs_requirements=true and failed at the generate step with "No uv.lock or pyproject.toml file found."

Fixes #82.

@dotNomad
dotNomad force-pushed the dotnomad/simplify-requirements-generation branch from ea603ff to d97671f Compare August 5, 2026 19:48
generate-requirements.sh now branches only on which files are in the
working directory, and treats a missing dependency source as a no-op
rather than an error. `posit connect deploy` already decides whether
content needs a requirements.txt, and it does so precisely: it inspects
the Python environment for a jupyter-engine Quarto doc but not a
knitr-engine one, and never for Node.js. It raises a clear error naming
the missing file when one is required.

That makes needs_requirements unnecessary, so it comes out of AppType,
resolve_app_type, the CLI output, and the deploy step's condition, along
with REQUIREMENTS_DEPLOY_TYPES.

Fixes #82.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dotNomad
dotNomad force-pushed the dotnomad/simplify-requirements-generation branch from d97671f to 979a51b Compare August 5, 2026 19:49
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Preview deployed to Connect (localhost:3941): http://localhost:3941/connect/#/apps/4cb2ff58-289e-48bf-9efa-a8e0923a9c9d/draft/8

Deployed from commit 979a51b.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Preview deployed to Connect (localhost:3940): http://localhost:3940/connect/#/apps/d7f0b656-d56d-4819-989d-ffc08de54abd/draft/8

Deployed from commit 979a51b.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Preview deployed to Connect (localhost:3942): http://localhost:3942/connect/#/apps/7e5614d1-729d-4b76-8b65-da025af0aeac/draft/8

Deployed from commit 979a51b.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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

@dotNomad
dotNomad marked this pull request as ready for review August 5, 2026 20:02
@dotNomad
dotNomad requested a review from nealrichardson August 5, 2026 20:02

@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.

Makes sense to me, thank you!

@dotNomad
dotNomad merged commit 6671489 into main Aug 5, 2026
7 checks passed
@dotNomad
dotNomad deleted the dotnomad/simplify-requirements-generation branch August 5, 2026 20:18
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.

Refactor logic around requirements generation

2 participants