Repository navigation
fix: pass --package-installer to write-manifest <framework> and deploy quarto - #877
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
…y quarto `_write_framework_manifest` and `deploy_quarto` accepted `package_installer` but never forwarded it to `Environment.create_python_environment`, so `write-manifest shiny --package-installer uv` wrote `package_manager: pip`. The other commands already pass `package_manager=package_installer`. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
karawoo
requested changes
Oct 22, 2026
karawoo
left a comment
Collaborator
There was a problem hiding this comment.
thanks for the PR, I think the logic looks right but the tests need a few small tweaks
| from .utils import apply_common_args | ||
|
|
||
|
|
||
| def _fake_create(captured: dict[str, typing.Any]): |
Collaborator
There was a problem hiding this comment.
could you please update this to work against python 3.8?
| assert result.exit_code == 0, result.output | ||
| assert captured["package_manager"].value == installer | ||
| manifest = json.loads((tmp_path / "manifest.json").read_text()) | ||
| assert manifest["python"]["package_manager"]["name"] == installer |
Collaborator
There was a problem hiding this comment.
This mostly tests the fake, since the fake builds the environment from the kwarg it was passed. It also misses allow_uv, which the real create_python_environment sets. Could you mock Environment._get_python_env_info instead and assert both name and allow_uv?
This branch has not been deployed
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.
Part 1 of #852; the second part of that issue (click >= 8.2
Choicematching) is noted at the end.--package-installeris accepted bywrite-manifest <framework>(streamlit|dash|bokeh|panel|shiny|api|fastapi|flask) and bydeploy quarto, but both code paths drop it before callingEnvironment.create_python_environment. The other commands from #708 passpackage_manager=package_installer. As a resultrsconnect write-manifest shiny --package-installer uv ./appexits 0 and writespython.package_manager.name: pipintomanifest.json.What changed.
package_manager=package_installeris now passed in thecreate_python_environmentcalls in_write_framework_manifestanddeploy_quarto(2 lines), plus a CHANGELOG entry.Tests. New
tests/test_package_installer.pydrives the CLI withCliRunner:write-manifestforshiny,streamlitandfastapiwith--package-installer uv|pipasserts the value reachescreate_python_environmentand thatmanifest["python"]["package_manager"]["name"]matches.deploy quarto --package-installer uv(withcreate_python_environment, Quarto and the executor mocked) asserts the value is forwarded.All 7 cases fail on
mainand pass with the change.ruff format --checkandruff checkare clean. The rest of the suite passes; the failures seen were environment-dependent and unrelated to this change (test_quickstart.pytests that boot a process or need a writable cwd, which fail the same way onmain, plus one intermittent timing test intests/test_agent_cli_e2e.py).Not included. Part 2 of the issue (
click.Choice(PackageInstaller)matching by name instead of value on click >= 8.2, souvis rejected) is a maintainer decision (click.Choice(["pip", "uv"])plus conversion, or bounding click), so it is left as a possible follow-up.This change was made with Claude Code.
🤖 Generated with Claude Code