Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Deploy to Connect Cloud buttons to app READMEs #1709

Merged
merged 9 commits into from
Oct 2, 2024

Conversation

garrettgman
Copy link
Contributor

@garrettgman garrettgman commented Sep 27, 2024

Related: posit-dev/py-shiny-templates#25
Related: posit-dev/py-shinywidgets#162


This PR adds a button to the README of each example app that allows users to quickly deploy the app to Connect Cloud and see it in action—with one click of the button. The PR does not otherwise affect the code in the apps or the repository.

The buttons look like this.

Screenshot 2024-09-26 at 1 11 34 PM

When I tested it, every app deployed within seconds.

Why add Deploy to Connect Cloud buttons?

Connect Cloud is part of Posit's strategy to provide value to Python users. With Connect Cloud, users can very quickly deploy and maintain Shiny apps straight from their Github repository. We believe in Connect Cloud as a company and want to highlight it alongside our own assets.

@icarusz
Copy link
Collaborator

icarusz commented Sep 28, 2024

This looks good to me though should we put the button at the bottom, the description is not too long and it seems like you might want to do it after reading the description rather than before.

@garrettgman
Copy link
Contributor Author

garrettgman commented Sep 30, 2024

@icarusz I placed the buttons at the top to imitate other sites I know of that use README buttons, which I admit usually do double duty as status indicators (example).

I do think there is value in showing readers what their options are before they read the readme. A button at the bottom is less likely to appear on screen in some github views.

@garrettgman
Copy link
Contributor Author

@schloerke I moved the buttons right as requested 👍

@schloerke
Copy link
Collaborator

New look:

Screenshot 2024-10-02 at 2 19 56 PM

Thank you! It will handle any description content as it is added.

@schloerke
Copy link
Collaborator

Q: Can we add them to all the /examples apps?

@schloerke
Copy link
Collaborator

A: Yes. It'll also require requirements.txt files for each app.

@schloerke
Copy link
Collaborator

@garrettgman I added (untested) requirements.txt files and readme.md files for each examples root app dir. When you have a chance, please verify deployment works and looks as you'd expect.

@garrettgman
Copy link
Contributor Author

@schloerke Thank you for added those. I verified that deployment works for all of the buttons, excepting a few which I removed:

  • Brownian app required us to include a large npm dependency in the repo to enable deployment, so I removed the deploy link
  • chat app requires openai keys to deploy, so I removed the deploy buttons
  • The hold app example in the Shiny express apps failed to deploy because within the app code, shiny.ui.output_code() called an unrecognized inline=TRUE argument, so I removed the argument. After that it deploys correctly.

@@ -25,4 +25,4 @@ def txt():

ui.input_slider("n", "N", 1, 100, 50)

shiny.ui.output_code("txt", inline=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you!

Reference: https://shiny.posit.co/py/api/core/ui.output_code.html

No inline argument

@schloerke
Copy link
Collaborator

Thank you! Merging

@schloerke schloerke merged commit ffd06d3 into posit-dev:main Oct 2, 2024
40 checks passed
schloerke added a commit that referenced this pull request Oct 7, 2024
* main:
  tests(sidebar): Add tests for sidebar (#1715)
  tests(accordion): Add kitchensink tests for accordion (#1710)
  tests(bug): Use locator instead of element handles (#1716)
  tests(deploys): Move import from htmltools into code to help with debugging deploys (#1718)
  build: set Narwhals 1.9.1 as minimum, remove upper bound, use narwhals.stable.v1 for dtypes and typing (#1717)
  feat: support DataFrames via narwhals (#1570)
  Adds Deploy to Connect Cloud buttons to app READMEs (#1709)
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.

3 participants