Skip to content

Quickstart#767

Open
amol- wants to merge 27 commits into
mainfrom
quickstart
Open

Quickstart#767
amol- wants to merge 27 commits into
mainfrom
quickstart

Conversation

@amol-
Copy link
Copy Markdown
Collaborator

@amol- amol- commented May 19, 2026

Intent

  • Implement rsconnect deploy pyproject to deploy via a pyproject file instead of manifest
  • Implement rsconnect quickstart apptype APP_NAME to create a new content with a skeleton

Closes #766

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change

Approach

  • rsconnect deploy pyproject detects some connect specific options from pyproject.toml and use the standard pyproject options to generate the manifest of the deployed bundle. Allows a reproducible deploy across systems (compared to rsconnect deploy automode that reruns the detection of environment etc every time) without the constraint of rsconnect deploy manifest which is too specific (like listing the exact files)
  • rsconnect quickstart AppType will create a new application of the specified app type with a preconfigured pyproject.toml and uv environment.
  • AppModes has support for command line aliases, so that deploy,write-manifest and quickstart can share the same alias for the same types.

Automated Tests

  • Tests for the command themselves are there
  • Tests for the skeletons exist, but I might go back and simplify them as the testing infrastructure currently goes as far as actually starting those projects and checking they serve requests.

Directions for Reviewers

  • rsconnect/quickstart/quickstart.py is the logic for the quickstart command itself, each supported template is implemented by a TemplateSpec that points to the template files.
  • quickstart will also setup a local environment for the quickstart project inside .venv of the project when possible, so that the project is immediately runnable.
  • rsconnect/main.py:deploy_pyproject is the entry point for rsconnect deploy pyproject, it primarily uses read_tool_rsconnect helper to read the project configuration from pyproject.toml itself.
  • uv was added as a dependency because we already required it anyway for the --requirement-file=uv.lock support, as quickstart requires it too it made sense to promote it to an actual dependency.

Checklist

  • I have updated CHANGELOG.md to cover notable changes.
  • I have updated all related GitHub issues to reflect their current state.
  • I have run the rsconnect-python-tests-at-night workflow in Connect against this feature branch.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://posit-dev.github.io/rsconnect-python/pr-preview/pr-767/

Built to branch gh-pages at 2026-05-21 09:21 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
5871 4568 78% 0% 🟢

New Files

File Coverage Status
rsconnect/quickstart/init.py 100% 🟢
rsconnect/quickstart/quickstart.py 96% 🟢
rsconnect/quickstart/templates/init.py 100% 🟢
TOTAL 99% 🟢

Modified Files

File Coverage Status
rsconnect/api.py 76% 🟢
rsconnect/main.py 71% 🟢
rsconnect/models.py 92% 🟢
rsconnect/pyproject.py 98% 🟢
TOTAL 84% 🟢

updated for commit: fecb0b0 by action🐍

@amol- amol- marked this pull request as ready for review May 20, 2026 18:01
@amol- amol- requested a review from tdstein May 20, 2026 18:02
@amol- amol- requested review from jonkeane and removed request for tdstein June 1, 2026 09:05
Copy link
Copy Markdown
Collaborator

@jonkeane jonkeane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +71 to +73
# 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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 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?

Comment thread rsconnect/api.py
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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this cleanup

Comment thread rsconnect/main.py
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")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it intentional that this one line with ..., alias="...", desc="..." is kept?

Comment thread docs/CHANGELOG.md
`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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

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.

Quickstart command to create new projects

2 participants