Repository navigation
fix: inspect the project Python environment - #920
Merged
tdstein merged 16 commits intoNov 6, 2026
Merged
Conversation
- Pass --python through to deploy quarto. - Run the inspector and pip with -E instead of -I so user site-packages are still visible, from the inspector's directory so a stray pip.py in the working directory is not imported. - Resolve ".." in the project path before searching parents for .venv. - Fall back to uv on PATH when the bundled uv binary can't be found. - Report pyproject.toml parse errors with their details. - Make preflight check the selected interpreter's Python version and accept --python, matching deploy. - Isolate interpreter-lookup and preflight tests from the shell's VIRTUAL_ENV, CONDA_PREFIX, and working directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The inspector runs under rsconnect's own interpreter and imports its dependencies (packaging, toml). Starting it with -I hid user site-packages and PYTHONPATH, so `pip install --user` and PYTHONPATH installs failed with "No module named 'packaging'". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without the flush, Python 3.8 left nbconvert's diagnostics buffered when the error was raised, failing test_deploy_static_notebook_render_failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
joshyam-k
reviewed
Nov 5, 2026
tdstein
commented
Nov 6, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
joshyam-k
approved these changes
Nov 6, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…3cb0dbb9c6 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tdstein
deleted the
symphony/posit-dev_rsconnect-python_889-e922273cb0dbb9c6
branch
November 6, 2026 17:07
tdstein
added a commit
that referenced
this pull request
Nov 6, 2026
…atic #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>
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.
Summary
Resolve uv once for export and pip-free or old-pip environments. Preserve pip's bootstrap exclusions and validate editable dependencies for both freeze paths.
Evidence
Merge Danger
Door: Two-way
Blast Radius: Deployment environment discovery and generated requirements.
Closes #889