Skip to content

Conversation

@aronatkins
Copy link
Collaborator

Description

Allows rsconnect deploy quarto and rsconnect write-manifest quarto for single documents as well as projects.

Testing Notes / Validation Steps

Given a simple Quarto document named no-runtimes.qmd, rsconnect-python should be able to create a manifest and deploy to Connect.

---
title: no runtimes
---

This document does not use any runtimes. It is a vanilla Quarto document.
# Generate a manifest.
rsconnect write-manifest quarto no-runtimes.qmd
# Deploy. Adjust the deployment parameters as needed.
rsconnect deploy quarto -s http://localhost:3939 no-runtimes.qmd

Given a simple Quarto document named uses-python.qmd that uses the Python runtime, rsconnect-python should be able to create a manifest and deploy to Connect.

---
title: uses Python
---

This document uses Python.

```{python}
7 * 3 * 2
```

This document has no external package requirements; create an empty requirements.txt file to accompany the document.

touch requirements.txt
# Generate a manifest.
rsconnect write-manifest quarto uses-python.qmd
# Deploy. Adjust the deployment parameters as needed.
rsconnect deploy quarto -s http://localhost:3939 uses-python.qmd

Additionally, rsconnect-python should still be able to create manifest and deploy directories containing Quarto projects.

@aronatkins aronatkins requested a review from toph-allen June 13, 2022 18:15
Copy link
Contributor

@toph-allen toph-allen left a comment

Choose a reason for hiding this comment

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

This looks good at a read-through, and worked for me, deploying a basic Quarto doc with no runtime.

This probably requires some documentation updates. The README.md doesn't detail the Quarto function, but the Connect docs do, as does the dev wiki.

Should we change "help" on line 871 of main.py? Right now, it says "Deploy Quarto content to RStudio Connect", but that could read "document or project". The FILE_OR_DIRECTORY argument is not explained with --help — only named options.

Screen Shot 2022-06-13 at 03 30 12 PM@2x

@aronatkins
Copy link
Collaborator Author

Updated help text.

Usage: rsconnect write-manifest quarto [OPTIONS] FILE_OR_DIRECTORY
                                       [EXTRA_FILES]...

  Create a manifest.json file for a Quarto document or project for later
  deployment. Should the content use the Quarto Jupyter engine, an environment
  file ("requirements.txt") is created if one does not already exist. All
  files are created in the same directory as the project. Requires RStudio
  Connect 2021.08.0 or later.

  FILE_OR_DIRECTORY is the path to a single-file Quarto document or the
  directory containing a Quarto project.
Usage: rsconnect deploy quarto [OPTIONS] FILE_OR_DIRECTORY [EXTRA_FILES]...

  Deploy a Quarto document or project to RStudio Connect. Should the content
  use the Quarto Jupyter engine, an environment file ("requirements.txt") is
  created and included in the deployment if one does not already exist.
  Requires RStudio Connect 2021.08.0 or later.

  FILE_OR_DIRECTORY is the path to a single-file Quarto document or the
  directory containing a Quarto project.

The additional-paragraph-for-argument-documentation is the recommended approach, per https://click.palletsprojects.com/en/8.1.x/documentation/#documenting-arguments

@aronatkins aronatkins requested a review from mmarchetti June 14, 2022 13:17
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.

4 participants