Quickstart#767
Conversation
|
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
jonkeane
left a comment
There was a problem hiding this comment.
I tried this locally, and I'm not sure if I'm messing this up or there's somethign wrong with the template, but this is what I ran the following:
rsconnect quickstart shiny myshiny
rsconnect deploy pyproject -n dogfood myshiny
And then the app it deployed doesn't seem to function
2026/06/01 1:07:24 PM: LANG: C.UTF-8
2026/06/01 1:07:24 PM: Working directory: /opt/rstudio-connect/mnt/app
2026/06/01 1:07:24 PM: Bootstrapping environment using Python 3.13.3 (main, Apr 22 2025, 14:51:02) [GCC 11.4.0] at /opt/python/3.13.3/bin/python3.13
2026/06/01 1:07:24 PM: Running content with the Python virtual environment /opt/rstudio-connect/mnt/app/python/env (/opt/rstudio-connect/mnt/python-environments/_nocache/107745/345188/uv/3.13.3/afBgBmio6WnsFpxwFmQl1g_20260601180607_8fcfd4005de411f184a797abaa2ad926)
2026/06/01 1:07:24 PM: Environment ready
2026/06/01 1:07:27 PM: Running content using Python "3.13.3 (main, Apr 22 2025, 14:51:02) [GCC 11.4.0]" at "/opt/rstudio-connect/mnt/app/python/env/bin/python"
2026/06/01 1:07:27 PM: Loading code from "app.py"
2026/06/01 1:07:27 PM: Error while loading Python API: Failed to find an application object (('app', 'application', 'demo')) or factory function (('create_app', 'make_app')) in module 'app'. You can specify a different entrypoint in your deployment configuration.
I haven't dug too much to see what the issue is, but want to get these comments up before digging too deeply.
| @@ -0,0 +1,3 @@ | |||
| from .app import create_app | |||
There was a problem hiding this comment.
I presume that the stuff under templates is all similar boilerplate, so I'm not going to go into too much detail here, but LMK if there's something I should look at in more detail.
| # check has passed. Type validation now lives in Click's argument | ||
| # parser (see ``rsconnect/main.py``), so it has already passed before | ||
| # we get here. |
There was a problem hiding this comment.
| # check has passed. Type validation now lives in Click's argument | |
| # parser (see ``rsconnect/main.py``), so it has already passed before | |
| # we get here. | |
| # check has passed. Type validation lives in Click's argument | |
| # parser (see ``rsconnect/main.py``), so it has already passed before | |
| # we get here. |
Super minor, but this looked like a bit of claude implementation cruft?
| if response.exception: | ||
| raise RSConnectException( | ||
| "Exception trying to connect to %s - %s" % (self.url, response.exception), cause=response.exception | ||
| "Could not connect to %s - %s" % (self.url, response.exception), cause=response.exception |
| generate_write_manifest_python(AppModes.BOKEH_APP) | ||
| generate_write_manifest_python(AppModes.DASH_APP) | ||
| generate_write_manifest_python(AppModes.PYTHON_API) | ||
| generate_write_manifest_python(AppModes.PYTHON_API, alias="flask", desc="Flask API") |
There was a problem hiding this comment.
is it intentional that this one line with ..., alias="...", desc="..." is kept?
| `voila`, `quarto`, `quarto-shiny`. Creates a uv-managed virtualenv and prints | ||
| the local-run and deploy commands. | ||
| - `rsconnect deploy pyproject` command for deploying a project described by | ||
| `pyproject.toml` with a `[tool.rsconnect]` table containing `app_mode` and |
There was a problem hiding this comment.
I wish this were tool.connect rather than tool.rsconnect but I imagine this was done since the CLI is still rsconnect (and we aren't migrating away from that yet), yeah?
Intent
rsconnect deploy pyprojectto deploy via a pyproject file instead of manifestrsconnect quickstart apptype APP_NAMEto create a new content with a skeletonCloses #766
Type of Change
Approach
rsconnect deploy pyprojectdetects some connect specific options frompyproject.tomland use the standard pyproject options to generate the manifest of the deployed bundle. Allows a reproducible deploy across systems (compared torsconnect deploy automodethat reruns the detection of environment etc every time) without the constraint ofrsconnect deploy manifestwhich is too specific (like listing the exact files)rsconnect quickstart AppTypewill create a new application of the specified app type with a preconfiguredpyproject.tomlanduvenvironment.AppModeshas support for command line aliases, so thatdeploy,write-manifestandquickstartcan share the same alias for the same types.Automated Tests
Directions for Reviewers
rsconnect/quickstart/quickstart.pyis the logic for the quickstart command itself, each supported template is implemented by aTemplateSpecthat points to the template files.quickstartwill also setup a local environment for the quickstart project inside.venvof the project when possible, so that the project is immediately runnable.rsconnect/main.py:deploy_pyprojectis the entry point forrsconnect deploy pyproject, it primarily usesread_tool_rsconnecthelper to read the project configuration frompyproject.tomlitself.uvwas added as a dependency because we already required it anyway for the--requirement-file=uv.locksupport, asquickstartrequires it too it made sense to promote it to an actual dependency.Checklist
rsconnect-python-tests-at-nightworkflow in Connect against this feature branch.