Skip to content

Commit 65829a3

Browse files
committed
Merge branch 'main' into drop_fn_session_param
* main: (76 commits) Add shiny/templates to MANIFEST.in files (#926) docs: Function Reference Proofreads (#919) Fix failing deploy tests (#925) Add GitHub sources to shiny create Make changelog styling more consistent Function reference edits (#857) docs: Use definition lists for parameter descriptions to enable full markdown support (#901) docs(layout_columns): Add example app (#903) fix(layout_columns): Remove use of enum for breakpoints (#912) Express: don't automatically put strings in a `<pre>` block (#905) Deprecate `nav()` in favor of `nav_panel()` (#876) chore: Remove unused import refactor(layout_column_wrap): Use helper for wrapping children (#910) fix(layout_columns): Don't apply fillable class to layout container (#909) Add output to React template (#908) fix(layout_columns): Add missing `bslib-mb-spacing` class (#906) Custom component template updates (#874) fix(layout_columns): If the breakpoint name is an enum, need to collect the value (#902) chore: exclude `_dev/` folder (#897) feat: Add `ui.layout_columns()` (#856) ...
2 parents 772b114 + c19bf27 commit 65829a3

File tree

312 files changed

+10354
-1406
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

312 files changed

+10354
-1406
lines changed

.github/py-shiny/setup/action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ runs:
2222
- name: Install dependencies
2323
shell: bash
2424
run: |
25+
pip install https://github.com/rstudio/py-htmltools/tarball/main
2526
make install-deps
2627
2728
- name: Install

.github/workflows/build-docs.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
- name: Install dependencies
3434
run: |
3535
cd docs
36+
make ../venv
37+
. ../venv/bin/activate && pip install https://github.com/rstudio/py-htmltools/tarball/main
3638
make deps
3739
3840
- name: Run quartodoc
@@ -44,3 +46,31 @@ jobs:
4446
run: |
4547
cd docs
4648
make site
49+
50+
- name: Upload site artifact
51+
if: github.ref == 'refs/heads/main'
52+
uses: actions/upload-pages-artifact@v1
53+
with:
54+
path: "docs/_site"
55+
56+
57+
deploy:
58+
if: github.ref == 'refs/heads/main'
59+
needs: build
60+
61+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
62+
permissions:
63+
pages: write # to deploy to Pages
64+
id-token: write # to verify the deployment originates from an appropriate source
65+
66+
# Deploy to the github-pages environment
67+
environment:
68+
name: github-pages
69+
url: ${{ steps.deployment.outputs.page_url }}
70+
71+
# Specify runner + deployment step
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: Deploy to GitHub Pages
75+
id: deployment
76+
uses: actions/deploy-pages@v1

.github/workflows/pytest.yaml

Lines changed: 69 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
pull_request:
88
release:
99
types: [published]
10+
schedule:
11+
- cron: "0 8 * * *"
1012

1113
jobs:
1214
build:
@@ -46,7 +48,7 @@ jobs:
4648
run: |
4749
make check
4850
49-
e2e:
51+
playwright-shiny:
5052
runs-on: ${{ matrix.os }}
5153
if: github.event_name != 'release'
5254
strategy:
@@ -63,10 +65,11 @@ jobs:
6365
python-version: ${{ matrix.python-version }}
6466

6567
- name: Run End-to-End tests
68+
timeout-minutes: 20
6669
run: |
67-
make e2e
70+
make playwright-shiny
6871
69-
e2e-examples:
72+
playwright-examples:
7073
runs-on: ${{ matrix.os }}
7174
if: github.event_name != 'release'
7275
strategy:
@@ -94,12 +97,13 @@ jobs:
9497
npm ci
9598
9699
- name: Run example app tests
100+
timeout-minutes: 20
97101
run: |
98-
make e2e-examples
102+
make playwright-examples
99103
100-
e2e-deploys:
101-
# Only allow one `e2e-deploys` job to run at a time. (Independent of branch / PR)
102-
concurrency: e2e-deploys
104+
playwright-deploys:
105+
# Only allow one `playwright-deploys` job to run at a time. (Independent of branch / PR)
106+
concurrency: playwright-deploys
103107
runs-on: ${{ matrix.os }}
104108
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'deploy')) }}
105109
strategy:
@@ -122,8 +126,10 @@ jobs:
122126
DEPLOY_SHINYAPPS_NAME: "${{ secrets.DEPLOY_SHINYAPPS_NAME }}"
123127
DEPLOY_SHINYAPPS_TOKEN: "${{ secrets.DEPLOY_SHINYAPPS_TOKEN }}"
124128
DEPLOY_SHINYAPPS_SECRET: "${{ secrets.DEPLOY_SHINYAPPS_SECRET }}"
129+
timeout-minutes: 30
125130
run: |
126-
make e2e-deploys
131+
make playwright-deploys
132+
127133
pypi:
128134
name: "Deploy to PyPI"
129135
runs-on: ubuntu-latest
@@ -138,6 +144,7 @@ jobs:
138144
- name: Install dependencies
139145
run: |
140146
python -m pip install --upgrade pip
147+
pip install https://github.com/rstudio/py-htmltools/tarball/main
141148
make install-deps
142149
make install
143150
- name: "Build Package"
@@ -160,3 +167,57 @@ jobs:
160167
with:
161168
user: __token__
162169
password: ${{ secrets.PYPI_API_TOKEN }}
170+
171+
testrail-reporting-nightly:
172+
runs-on: ${{ matrix.os }}
173+
if: ${{ github.event_name == 'schedule' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'testrail')) }}
174+
strategy:
175+
matrix:
176+
python-version:
177+
- "3.11"
178+
- "3.10"
179+
- "3.9"
180+
# - "3.8" # Testrail has errors when running on python 3.8; Skipping
181+
os: [ubuntu-latest]
182+
fail-fast: false
183+
184+
steps:
185+
- uses: actions/checkout@v3
186+
- name: Setup py-shiny
187+
uses: ./.github/py-shiny/setup
188+
with:
189+
python-version: ${{ matrix.python-version }}
190+
191+
- name: Install node.js
192+
uses: actions/setup-node@v3
193+
with:
194+
node-version: "18"
195+
cache: npm
196+
cache-dependency-path: examples/brownian/shinymediapipe/package-lock.json
197+
- name: Install node.js package
198+
working-directory: examples/brownian/shinymediapipe
199+
run: |
200+
npm ci
201+
202+
- name: Run End-to-End tests
203+
timeout-minutes: 20
204+
run: |
205+
make testrail-junit
206+
- name: Report results to Testrail
207+
env:
208+
TESTRAIL_URL: "https://posit.testrail.io"
209+
TESTRAIL_PROJECT: "Shiny-Python"
210+
TESTRAIL_USER: "${{ secrets.TESTRAIL_USER }}"
211+
TESTRAIL_PASSWORD: "${{ secrets.TESTRAIL_PASSWORD }}"
212+
run: |
213+
CURRENT_DATE="$(date +'%Y-%m-%d %H:%M:%S') Nightly tests"
214+
trcli \
215+
--yes \
216+
--host "$TESTRAIL_URL" \
217+
--project "$TESTRAIL_PROJECT" \
218+
--username "$TESTRAIL_USER" \
219+
--password "$TESTRAIL_PASSWORD" \
220+
parse_junit \
221+
--file "report.xml" \
222+
--title "$CURRENT_DATE" \
223+
--close-run

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Byte-compiled / optimized / DLL files
2-
__pycache__/
2+
**/__pycache__/
33
*.py[cod]
44
*$py.class
55

@@ -110,3 +110,6 @@ docs/source/reference/
110110
.Rproj.user
111111

112112
/.luarc.json
113+
114+
# Developer scratch area
115+
_dev/

.vscode/settings.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
22
"files.trimTrailingWhitespace": true,
33
"files.insertFinalNewline": true,
4-
"python.formatting.provider": "black",
5-
"python.linting.flake8Enabled": true,
64
"editor.tabSize": 2,
75
"files.encoding": "utf8",
86
"files.eol": "\n",
@@ -27,10 +25,11 @@
2725
"editor.defaultFormatter": "esbenp.prettier-vscode"
2826
},
2927
"[python]": {
28+
"editor.defaultFormatter": "ms-python.black-formatter",
3029
"editor.formatOnSave": true,
3130
"editor.tabSize": 4,
3231
"editor.codeActionsOnSave": {
33-
"source.organizeImports": true
32+
"source.organizeImports": "explicit"
3433
}
3534
},
3635
"isort.args": ["--profile", "black"],
@@ -42,5 +41,5 @@
4241
"autoDocstring.guessTypes": false,
4342
"search.exclude": {
4443
"build/**": true
45-
}
44+
},
4645
}

CHANGELOG.md

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [UNRELEASED]
1010

11+
### New features
12+
13+
* `shiny create` now allows you to select from a list of template apps.
14+
* `shiny create` provides templates which help you build your own custom JavaScript components.
15+
* Closed #814: The functions `reactive.Calc` and `reactive.Effect` have been changed to have lowercase names: `reactive.calc`, and `reactive.effect`. The old capitalized names are now aliases to the new lowercase names, so existing code will continue to work. Similarly, the class `reactive.Value` has a new alias, `reactive.value`, but in this case, since the original was a class, it keeps the original capitalized name as the primary name. The examples have not been changed yet, but will be changed in a future release. (#822)
16+
* Added `ui.layout_columns()` for creating responsive column-forward layouts based on Bootstrap's 12-column CSS Grid. (#856)
17+
18+
### Bug fixes
19+
20+
* Fix support for `shiny.ui.accordion(multiple=)` (#799).
21+
22+
### Other changes
23+
24+
* Closed #492: `shiny.ui.nav()` is now deprecated in favor of the more aptly named `shiny.ui.nav_panel()` (#876).
25+
* Update penguins example to credit Allison Horst and drop usage of `shiny.experimental` (#798).
26+
* `as_fillable_container()` and `as_fill_item()` no longer mutate the `Tag` object that was passed in. Instead, it returns a new `Tag` object. Also closed #856: these functions now put the `html-fill-container` and `html-fill-item` CSS classes last, instead of first. (#862)
27+
28+
29+
## [0.6.0] - 2023-10-30
30+
1131
### Breaking Changes
1232
* `shiny.run` only allows positional arguments for `app`, `host`, and `port`, all other arguments must be specified with keywords.
1333

@@ -30,6 +50,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3050

3151
* Added `shiny.ui.showcase_bottom()`, a new `shiny.ui.value_box()` layout that places the showcase below the value box `title` and `value`, perfect for a full-bleed plot. (#772)
3252

53+
### Bug fixes
54+
55+
* `shiny run` now respects the user provided `reload-dir` argument (#765).
56+
* Fixed #646: Wrap bare value box value in `<p />` tags. (#668)
57+
* Fixed #676: The `render.data_frame` selection feature was underdocumented and buggy (sometimes returning `None` as a row identifier if the pandas data frame's index had gaps in it). With this release, the selection is consistently a tuple of the 0-based row numbers of the selected rows--or `None` if no rows are selected. (#677)
58+
* Added tests to verify that ui input methods, ui labels, ui update (value) methods, and ui output methods work within modules (#696).
59+
* Adjusted the `@render.plot` input type to be `object` to allow for any object (if any) to be returned (#712).
60+
* In `layout_column_wrap()`, when `width` is a CSS unit -- e.g. `width = "400px"` or `width = "25%"` -- and `fixed_width = FALSE`, `layout_column_wrap()` will ensure that the columns are at least `width` wide, unless the parent container is narrower than `width`. (#772)
61+
62+
### Other changes
63+
64+
* `input_action_button()` now defaults to having whitespace around it. (#758)
65+
* `layout_sidebar()` now uses an `<aside>` element for the sidebar's container and a `<header>` element for the sidebar title. The classes of each element remain the same, but the semantic meaning of the elements is now better reflected in the HTML markup. (#772)
66+
* `layout_sidebar()` no longer gives the sidebar main content area the `role="main"` attribute. (#772)
67+
* Improved the style and appearance of the button to enter full screen in `card()`s and `value_box()`es to better adapt to Bootstrap's dark mode. (#772)
68+
3369
### API changes
3470

3571
* Added `shiny.ui.navset_underline()` and `shiny.ui.navset_card_underline()` whose navigation container is similar to `shiny.ui.navset_tab()` and `shiny.ui.navset_card_tab()` respectively, but its active/focused navigation links are styled with an underline. (#772)
@@ -88,22 +124,6 @@ Methods still under consideration in `shiny.experimental.ui`:
88124
* Support for `min_height=`, `max_height=`, and `gap=` in `shiny.experimental.ui.as_fillable_container()` and `as_fill_item()` has been removed. (#481)
89125
* `shiny.experimental.ui.TagCallable` has been made defunct. Please use its type is equivalent to `htmltools.TagFunction`. (#680)
90126

91-
### Bug fixes
92-
93-
* `shiny run` now respects the user provided `reload-dir` argument (#765).
94-
* Fixed #646: Wrap bare value box value in `<p />` tags. (#668)
95-
* Fixed #676: The `render.data_frame` selection feature was underdocumented and buggy (sometimes returning `None` as a row identifier if the pandas data frame's index had gaps in it). With this release, the selection is consistently a tuple of the 0-based row numbers of the selected rows--or `None` if no rows are selected. (#677)
96-
* Added tests to verify that ui input methods, ui labels, ui update (value) methods, and ui output methods work within modules (#696).
97-
* Adjusted the `@render.plot` input type to be `object` to allow for any object (if any) to be returned (#712).
98-
* In `layout_column_wrap()`, when `width` is a CSS unit -- e.g. `width = "400px"` or `width = "25%"` -- and `fixed_width = FALSE`, `layout_column_wrap()` will ensure that the columns are at least `width` wide, unless the parent container is narrower than `width`. (#772)
99-
100-
### Other changes
101-
102-
* `input_action_button()` now defaults to having whitespace around it. (#758)
103-
* `layout_sidebar()` now uses an `<aside>` element for the sidebar's container and a `<header>` element for the sidebar title. The classes of each element remain the same, but the semantic meaning of the elements is now better reflected in the HTML markup. (#772)
104-
* `layout_sidebar()` no longer gives the sidebar main content area the `role="main"` attribute. (#772)
105-
* Improved the style and appearance of the button to enter full screen in `card()`s and `value_box()`es to better adapt to Bootstrap's dark mode. (#772)
106-
107127

108128
## [0.5.1] - 2023-08-08
109129

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
99
recursive-include shiny/www *
1010
recursive-include shiny/experimental/www *
1111
recursive-include shiny/api-examples *
12-
recursive-include shiny/ui/dataframe/js/dist *
12+
recursive-include shiny/templates *

Makefile

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help clean clean-test clean-pyc clean-build help lint test e2e e2e-examples
1+
.PHONY: help clean clean-test clean-pyc clean-build help lint test playwright-shiny playwright-examples playwright-deploys install-trcli install-playwright
22
.DEFAULT_GOAL := help
33

44
define BROWSER_PYSCRIPT
@@ -83,25 +83,34 @@ test: ## run tests quickly with the default Python
8383
python3 tests/pytest/asyncio_prevent.py
8484
pytest
8585

86-
# Default `FILE` to `e2e` if not specified
87-
FILE:=tests/e2e
86+
# Default `SUB_FILE` to empty
87+
SUB_FILE:=
8888

89-
DEPLOYS_FILE:=tests/deploys
89+
DEPLOYS_FILE:=tests/playwright/deploys
9090

91-
playwright-install:
91+
install-playwright:
9292
playwright install --with-deps
9393

94-
e2e: playwright-install ## end-to-end tests with playwright
95-
pytest $(FILE) -m "not examples and not integrationtest"
94+
install-trcli:
95+
which trcli || pip install trcli
9696

97-
e2e-examples: playwright-install ## end-to-end tests on examples with playwright
98-
pytest $(FILE) -m "examples"
97+
install-rsconnect: ## install the main version of rsconnect till pypi version supports shiny express
98+
pip install git+https://github.com/rstudio/rsconnect-python.git#egg=rsconnect-python
9999

100-
e2e-deploys: playwright-install ## end-to-end tests on deploys with playwright
101-
pytest $(DEPLOYS_FILE) -s -m "integrationtest"
100+
playwright-shiny: install-playwright ## end-to-end tests with playwright
101+
pytest tests/playwright/shiny/$(SUB_FILE)
102+
103+
playwright-examples: install-playwright ## end-to-end tests on examples with playwright
104+
pytest tests/playwright/examples
105+
106+
playwright-deploys: install-playwright install-rsconnect ## end-to-end tests on deploys with playwright
107+
pytest tests/playwright/deploys/$(SUB_FILE) -s
108+
109+
testrail-junit: install-playwright install-trcli ## end-to-end tests with playwright and generate junit report
110+
pytest tests/playwright/shiny/$(SUB_FILE) --junitxml=report.xml
102111

103112
coverage: ## check combined code coverage (must run e2e last)
104-
pytest --cov-report term-missing --cov=shiny tests/pytest/ tests/e2e/ -m "not examples and not integrationtest"
113+
pytest --cov-report term-missing --cov=shiny tests/pytest/ tests/playwright/shiny/$(SUB_FILE)
105114
coverage html
106115
$(BROWSER) htmlcov/index.html
107116

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ To get started with shiny follow the [installation instructions](https://shiny.p
3030
pip install shiny
3131
```
3232

33-
To install the latest development version from this repository:
33+
To install the latest development version:
3434

3535
``` sh
36+
# First install htmltools, then shiny
37+
pip install https://github.com/posit-dev/py-htmltools/tarball/main
3638
pip install https://github.com/posit-dev/py-shiny/tarball/main
3739
```
3840

@@ -45,6 +47,8 @@ shiny run app.py --reload
4547

4648
## Development
4749

50+
API documentation for the `main` branch of Shiny: https://posit-dev.github.io/py-shiny/api/
51+
4852
If you want to do development on Shiny for Python:
4953

5054
``` sh

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ _inv/
44
_sidebar.yml
55
/.quarto/
66
objects.json
7+
site_libs/

0 commit comments

Comments
 (0)