Repository navigation
Conversation
A static notebook bundle contains only the rendered HTML, so options that shape a source bundle's Python or R environment (--requirements-file, --force-generate, --package-installer, --override-python-version, --image, the environment management options, --exclude-renv) and extra files have no effect. Warn when any of them is given explicitly instead of silently ignoring it.
|
joshyam-k
approved these changes
Nov 6, 2026
joshyam-k
left a comment
Contributor
There was a problem hiding this comment.
nice! this was going to be my one piece of feedback on the base PR
mconflitti-pbc
approved these changes
Nov 6, 2026
…tebook-ignored-options # Conflicts: # docs/CHANGELOG.md # rsconnect/main.py
Cover deploy notebook without --static passing options --static ignores, so moving the warning out of the static branch fails a test. Compare the warned options as a set, since their order comes from the decorators.
jmwoliver
merged commit Nov 6, 2026
439a675
into
fix/static-notebook-no-requirements
3 checks passed
jmwoliver
added a commit
that referenced
this pull request
Nov 6, 2026
* fix: Don't resolve dependencies for deploy notebook --static (#923) The static bundle contains only the HTML rendered locally by nbconvert, but deploy_notebook resolved a requirements file, inspected the Python environment and read renv.lock before branching on --static, then threw all of it away. This required a requirements file (or --force-generate), failed on an incompatible renv.lock, and required rsconnect in the --python interpreter. With --static, only look up the interpreter that runs nbconvert. * fix: Find the notebook's project environment for deploy notebook --static #920 added project environment discovery relative to the content directory, but the static path called which_python without one, so it searched from the current working directory instead of the notebook's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * review: Clarify static notebook requirements and test invalid --python The rendering environment runs the notebook, so it needs ipykernel and the notebook's imports, not only nbconvert. Cover --python validation on the static path with a directory, which reaches which_python on every platform. * feat: Warn about options that deploy notebook --static ignores (#925) * feat: Warn about options that deploy notebook --static ignores A static notebook bundle contains only the rendered HTML, so options that shape a source bundle's Python or R environment (--requirements-file, --force-generate, --package-installer, --override-python-version, --image, the environment management options, --exclude-renv) and extra files have no effect. Warn when any of them is given explicitly instead of silently ignoring it. * review: Test that only --static warns, and ignore option order Cover deploy notebook without --static passing options --static ignores, so moving the warning out of the static branch fails a test. Compare the warned options as a set, since their order comes from the decorators. --------- Co-authored-by: Taylor Steinberg <taylor@steinberg.xyz> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #924. This PR's base is that branch, so the diff shows only this change. Merge #924 first, then retarget this PR to
main.Problem
After #924,
deploy notebook --staticno longer resolves a Python or R environment, but it still accepts options that only shape one and silently ignores them. Extra files are also ignored: the static bundle contains only the rendered HTML.Change
With
--static,deploy notebookwarns when any of these is given explicitly:--requirements-file,--force-generate,--package-installer,--override-python-version,--image,--disable-env-management,--disable-env-management-py,--disable-env-management-r,--exclude-renv. "Explicitly" means the parameter source isn't the default, using the existingvalidation.get_parameter_source_name_from_ctx. So, for example, the defaultrequirements.txtdoesn't trigger a warning. It also warns if extra files are passed. The deploy still goes ahead; these are warnings, not errors.Tests
test_deploy_notebook_static_warns_on_ignored_options: one case per option, plus a combined case using short flags.test_deploy_notebook_static_warns_on_extra_files.test_deploy_notebook_static_needs_no_environmentnow also asserts that no warning appears when no ignored options are given.The full suite passes locally (1861 passed, 15 skipped) and ruff is clean.