Skip to content

Commit 4d3b8c8

Browse files
committed
Merge branch 'main' into update-pyright
* main: (56 commits) Add actions step for nightly reporting -> Testrail (#774) Remove unused entry in manifest Bump version to 0.6.0.9000 Use latest htmltools Bump version to v0.6.0; Rearrange news to have API changes last Tweaks from testing Fix default width/height with implicit plot output (#792) Update deps (#794) Remove deprecated 'name' parameter from `Outputs` (#791) api(ui): Drop `toggle_` methods. Consolidate update accordion methods. Stronger typing for `layout_sidebar(sidebar)` and `page_sidebar(sidebar)` (#788) bug(sidebar): Revert sidebar icon back to chevron (#789) For `input_action_button`, default to having whitespace around button (#758) Remove output from template app (#775) Add output_args and suspend_display decorators (#786) Update value_box; Update to bootstrap 5.3; Update htmldeps (#772) tests: add sidebar test (#787) Seaborn plots should fill their output_plot (#785) Kwargs to uvicorn run (#780) Add width and height arguments to `@render.plot` (#783) gitgnore dist/ ...
2 parents 2301a1a + c6d6bee commit 4d3b8c8

File tree

366 files changed

+16544
-48913
lines changed

Some content is hidden

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

366 files changed

+16544
-48913
lines changed

.github/workflows/pytest.yaml

Lines changed: 85 additions & 2 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:
@@ -66,7 +68,7 @@ jobs:
6668
run: |
6769
make e2e
6870
69-
examples:
71+
e2e-examples:
7072
runs-on: ${{ matrix.os }}
7173
if: github.event_name != 'release'
7274
strategy:
@@ -97,7 +99,35 @@ jobs:
9799
run: |
98100
make e2e-examples
99101
100-
deploy:
102+
e2e-deploys:
103+
# Only allow one `e2e-deploys` job to run at a time. (Independent of branch / PR)
104+
concurrency: e2e-deploys
105+
runs-on: ${{ matrix.os }}
106+
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'deploy')) }}
107+
strategy:
108+
matrix:
109+
python-version: ["3.10"]
110+
os: [ubuntu-latest]
111+
fail-fast: false
112+
113+
steps:
114+
- uses: actions/checkout@v3
115+
- name: Setup py-shiny
116+
uses: ./.github/py-shiny/setup
117+
with:
118+
python-version: ${{ matrix.python-version }}
119+
120+
- name: Run example app tests
121+
env:
122+
DEPLOY_CONNECT_SERVER_URL: "https://rsc.radixu.com/"
123+
DEPLOY_CONNECT_SERVER_API_KEY: "${{ secrets.DEPLOY_CONNECT_SERVER_API_KEY }}"
124+
DEPLOY_SHINYAPPS_NAME: "${{ secrets.DEPLOY_SHINYAPPS_NAME }}"
125+
DEPLOY_SHINYAPPS_TOKEN: "${{ secrets.DEPLOY_SHINYAPPS_TOKEN }}"
126+
DEPLOY_SHINYAPPS_SECRET: "${{ secrets.DEPLOY_SHINYAPPS_SECRET }}"
127+
run: |
128+
make e2e-deploys
129+
130+
pypi:
101131
name: "Deploy to PyPI"
102132
runs-on: ubuntu-latest
103133
if: github.event_name == 'release'
@@ -133,3 +163,56 @@ jobs:
133163
with:
134164
user: __token__
135165
password: ${{ secrets.PYPI_API_TOKEN }}
166+
167+
testrail-reporting-nightly:
168+
runs-on: ${{ matrix.os }}
169+
if: ${{ github.event_name == 'schedule' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'testrail')) }}
170+
strategy:
171+
matrix:
172+
python-version:
173+
- "3.11"
174+
- "3.10"
175+
- "3.9"
176+
# - "3.8" # Testrail has errors when running on python 3.8; Skipping
177+
os: [ubuntu-latest]
178+
fail-fast: false
179+
180+
steps:
181+
- uses: actions/checkout@v3
182+
- name: Setup py-shiny
183+
uses: ./.github/py-shiny/setup
184+
with:
185+
python-version: ${{ matrix.python-version }}
186+
187+
- name: Install node.js
188+
uses: actions/setup-node@v3
189+
with:
190+
node-version: "18"
191+
cache: npm
192+
cache-dependency-path: examples/brownian/shinymediapipe/package-lock.json
193+
- name: Install node.js package
194+
working-directory: examples/brownian/shinymediapipe
195+
run: |
196+
npm ci
197+
198+
- name: Run End-to-End tests
199+
run: |
200+
make e2e-junit
201+
- name: Report results to Testrail
202+
env:
203+
TESTRAIL_URL: "https://posit.testrail.io"
204+
TESTRAIL_PROJECT: "Shiny-Python"
205+
TESTRAIL_USER: "${{ secrets.TESTRAIL_USER }}"
206+
TESTRAIL_PASSWORD: "${{ secrets.TESTRAIL_PASSWORD }}"
207+
run: |
208+
CURRENT_DATE="$(date +'%Y-%m-%d %H:%M:%S') Nightly tests"
209+
trcli \
210+
--yes \
211+
--host "$TESTRAIL_URL" \
212+
--project "$TESTRAIL_PROJECT" \
213+
--username "$TESTRAIL_USER" \
214+
--password "$TESTRAIL_PASSWORD" \
215+
parse_junit \
216+
--file "report.xml" \
217+
--title "$CURRENT_DATE" \
218+
--close-run

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ parts/
2020
sdist/
2121
var/
2222
wheels/
23+
dist/
2324
*.egg-info/
2425
.installed.cfg
2526
*.egg

CHANGELOG.md

Lines changed: 107 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,109 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
### New features
1212

13-
* Added `shiny.render.renderer_components` decorator to help create new output renderers. (#621)
13+
### Bug fixes
14+
15+
### Other changes
16+
17+
18+
## [0.6.0] - 2023-08-08
19+
20+
### Breaking Changes
21+
* `shiny.run` only allows positional arguments for `app`, `host`, and `port`, all other arguments must be specified with keywords.
22+
23+
### New features
24+
* `shiny run` now takes `reload-includes` and `reload-excludes` to allow you to define which files trigger a reload (#780).
25+
* `shiny.run` now passes keyword arguments to `uvicorn.run` (#780).
26+
* The `@output` decorator is no longer required for rendering functions; `@render.xxx` decorators now register themselves automatically. You can still use `@output` explicitly if you need to set specific output options (#747).
27+
* Added support for integration with Quarto (#746).
28+
* Added `shiny.render.renderer_components` decorator to help create new output renderers (#621).
29+
* Added `shiny.experimental.ui.popover()`, `update_popover()`, and `toggle_popover()` for easy creation (and server-side updating) of [Bootstrap popovers](https://getbootstrap.com/docs/5.3/components/popovers/). Popovers are similar to tooltips, but are more persistent, and should primarily be used with button-like UI elements (e.g. `input_action_button()` or icons) (#680).
30+
* Added CSS classes to UI input methods (#680) .
31+
* `Session` objects can now accept an asynchronous (or synchronous) function for `.on_flush(fn=)`, `.on_flushed(fn=)`, and `.on_ended(fn=)` (#686).
32+
* `App()` now allows `static_assets` to represent multiple paths. To do this, pass in a dictionary instead of a string (#763).
33+
* The `showcase_layout` argument of `value_box()` now accepts one of three character values: `"left center"`, `"top right"`, `"bottom"`. (#772)
34+
* `value_box()` now supports many new themes and styles, or fully customizable themes using the new `value_box_theme()` function. To reflect the new capabilities, we've replaced `theme_color` with a new `theme` argument. The previous argument will continue work as expected, but with a deprecation warning. (#772)
35+
36+
In addition to the Bootstrap theme names (`primary` ,`secondary`, etc.), you can now use the main Boostrap colors (`purple`, `blue`, `red`, etc.). You can also choose to apply the color to the background or foreground by prepending a `bg-` or `text-` prefix to the theme or color name. Finally, we've also added new gradient themes allowing you to pair any two color names as `bg-gradient-{from}-{to}` (e.g., `bg-gradient-purple-blue`).
37+
38+
These named color themes aren't limited to value boxes: because they're powered by small utility classes, you can use them anywhere within your bslib-powered UI.
39+
40+
* 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)
1441

1542
### Bug fixes
1643

44+
* `shiny run` now respects the user provided `reload-dir` argument (#765).
45+
* Fixed #646: Wrap bare value box value in `<p />` tags. (#668)
46+
* 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)
47+
* Added tests to verify that ui input methods, ui labels, ui update (value) methods, and ui output methods work within modules (#696).
48+
* Adjusted the `@render.plot` input type to be `object` to allow for any object (if any) to be returned (#712).
49+
* 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)
50+
1751
### Other changes
1852

53+
* `input_action_button()` now defaults to having whitespace around it. (#758)
54+
* `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)
55+
* `layout_sidebar()` no longer gives the sidebar main content area the `role="main"` attribute. (#772)
56+
* 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)
57+
58+
### API changes
59+
60+
* 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)
61+
* `shiny.ui.layout_column_wrap(width, *args)` was rearranged to `shiny.ui.layout_column_wrap(*args, width)`. Now, `width` will default to `200px` is no value is provided. (#772)
62+
* `shiny.ui.showcase_left_center()` and `shiny.ui.showcase_top_right()` no longer take two values for the `width` argument. Instead, they now take a single value (e.g., `width = "30%"`) representing the width of the showcase are in the value box. Furthermore, they've both gained `width_full_screen` arguments that determine the width of the showcase area when the value box is expanded to fill the screen. (#772)
63+
* `shiny.ui.panel_main()` and `shiny.ui.panel_sidebar()` are deprecated in favor of new API for `shiny.ui.layout_sidebar()`. Please use `shiny.ui.sidebar()` to construct a `sidebar=` and supply it to `shiny.ui.layout_sidebar(sidebar, *args, **kwargs)`. (#788)
64+
* `shiny.experimental.ui.toggle_sidebar()` has been renamed to `shiny.ui.update_sidebar()`. It's `open` value now only supports `bool` values. (#788)
65+
66+
#### API relocations
67+
68+
* `shiny.ui`'s `navset_pill_card()` and `navset_tab_card()` have been renamed to `navset_card_pill()` and `navset_card_tab()` respectively (#492).
69+
70+
The following methods have been moved from `shiny.experimental.ui` and integrated into `shiny.ui` (final locations under `shiny.ui` are displayed) (#680):
71+
72+
* Sidebar - Sidebar layout or manipulation
73+
* `sidebar()`, `page_sidebar()`, `update_sidebar()`, `layout_sidebar()`, `Sidebar`
74+
* Filling layout - Allow UI components to expand into the parent container and/or allow its content to expand
75+
* `page_fillable()`, `fill.as_fillable_container()`, `fill.as_fill_item()`, `fill.remove_all_fill()`
76+
* `output_plot(fill=)`, `output_image(fill=)`, `output_ui(fill=, fillable=)`
77+
* CSS units - CSS units and padding
78+
* `css.as_css_unit()`, `css.as_css_padding()`, `css.CssUnit`
79+
* Tooltip - Hover-based context UI element
80+
* `tooltip()`, `update_tooltip()`
81+
* Popover - Click-based context UI element
82+
* `popover()`, `update_popover()`
83+
* Accordion - Vertically collapsible UI element
84+
* `accordion()`, `accordion_panel()`, `insert_accordion_panel()`, `remove_accordion_panel()`, `update_accordion()`, `update_accordion_panel()`, `Accordion`, `AccordionPanel`
85+
* Card - A general purpose container for grouping related UI elements together
86+
* `card()`, `card_header()`, `card_footer()`, `CardItem`
87+
* Valuebox - Opinionated container for displaying a value and title
88+
* `valuebox()`
89+
* `showcase_left_center()`
90+
* `showcase_top_right()`
91+
* Navs - Navigation within a page
92+
* `navset_bar()`, `navset_tab_card()`, `navset_pill_card()`
93+
* `page_navbar(sidebar=, fillable=, fillable_mobile=, gap=, padding=)`, `navset_card_tab(sidebar=)`, `navset_card_pill(sidebar=)`, `navset_bar(sidebar=, fillable=, gap=, padding=)`
94+
* Layout - Layout of UI elements
95+
* `layout_column_wrap()`
96+
* Inputs - UI elements for user input
97+
* `input_text_area(autoresize=)`
98+
99+
If a ported method is called from `shiny.experimental.ui`, a deprecation warning will be displayed.
100+
101+
Methods still under consideration in `shiny.experimental.ui`:
102+
* `card(wrapper=)`: A function (which returns a UI element) to call on unnamed arguments in `card(*args)` which are not already `shiny.ui.CardItem` objects.
103+
* `card_body()`: A container for grouping related UI elements together
104+
* `card_image()`: A general container for an image within a `shiny.ui.card`.
105+
* `card_title()`: A general container for the "title" of a `shiny.ui.card`.
106+
107+
#### API removals
108+
109+
* `shiny.experimental.ui.FillingLayout` has been removed. (#481)
110+
* `shiny.experimental.ui.toggle_switch()` has been made defunct. Please remove it from your code and use `shiny.ui.update_switch()` instead. (#772)
111+
* `shiny.experimental.ui.as_width_unit()` has been made defunct. Please remove it from your code. (#772)
112+
* `shiny.experimental.ui`' `as_fill_carrier()`, `is_fill_carrier()`, `is_fillable_container()`, and `is_fill_item()` have been made defunct. Remove them from your code. (#680, #788)
113+
* Support for `min_height=`, `max_height=`, and `gap=` in `shiny.experimental.ui.as_fillable_container()` and `as_fill_item()` has been removed. (#481)
114+
* `shiny.experimental.ui.TagCallable` has been made defunct. Please use its type is equivalent to `htmltools.TagFunction`. (#680)
115+
19116

20117
## [0.5.1] - 2023-08-08
21118

@@ -166,35 +263,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
166263

167264
### New features
168265

169-
* Closed [#312](https://github.com/rstudio/py-shiny/issues/312): Matplotlib plots in a `@render.plot` can now use the global figure, instead of returning a `figure` object. ([#314](https://github.com/rstudio/py-shiny/pull/314))
266+
* Closed [#312](https://github.com/posit-dev/py-shiny/issues/312): Matplotlib plots in a `@render.plot` can now use the global figure, instead of returning a `figure` object. ([#314](https://github.com/posit-dev/py-shiny/pull/314))
170267

171-
* Disabled `shiny static` command, in favor of `shinylive export` from the shinylive package. ([#326](https://github.com/rstudio/py-shiny/pull/326))
268+
* Disabled `shiny static` command, in favor of `shinylive export` from the shinylive package. ([#326](https://github.com/posit-dev/py-shiny/pull/326))
172269

173270

174271
## [0.2.5] - 2022-08-12
175272

176273
### New features
177274

178-
* Closed [#269](https://github.com/rstudio/py-shiny/issues/269): The UI for a `shiny.App` object can now be provided as a function. ([#299](https://github.com/rstudio/py-shiny/pull/299))
179-
* When a Shinylive deployment is made with `shiny static`, it the deployment code is now delegated to Shinylive. ([#310](https://github.com/rstudio/py-shiny/pull/310))
275+
* Closed [#269](https://github.com/posit-dev/py-shiny/issues/269): The UI for a `shiny.App` object can now be provided as a function. ([#299](https://github.com/posit-dev/py-shiny/pull/299))
276+
* When a Shinylive deployment is made with `shiny static`, it the deployment code is now delegated to Shinylive. ([#310](https://github.com/posit-dev/py-shiny/pull/310))
180277

181278
### Bug fixes
182279

183-
* Fixed [#279](https://github.com/rstudio/py-shiny/issues/279): When a Shiny application is mounted to a Starlette route, reactivity did not work. ([#294](https://github.com/rstudio/py-shiny/pull/294))
184-
* Fixed [#290](https://github.com/rstudio/py-shiny/issues/290): `@render.plot` now works as intended inside `@module.server`. ([#292](https://github.com/rstudio/py-shiny/pull/292))
185-
* Fixed [#289](https://github.com/rstudio/py-shiny/issues/289): `input_selectize()` now resolves the input id before using for other id-like attributes ([#291](https://github.com/rstudio/py-shiny/pull/291))
280+
* Fixed [#279](https://github.com/posit-dev/py-shiny/issues/279): When a Shiny application is mounted to a Starlette route, reactivity did not work. ([#294](https://github.com/posit-dev/py-shiny/pull/294))
281+
* Fixed [#290](https://github.com/posit-dev/py-shiny/issues/290): `@render.plot` now works as intended inside `@module.server`. ([#292](https://github.com/posit-dev/py-shiny/pull/292))
282+
* Fixed [#289](https://github.com/posit-dev/py-shiny/issues/289): `input_selectize()` now resolves the input id before using for other id-like attributes ([#291](https://github.com/posit-dev/py-shiny/pull/291))
186283

187284
## [0.2.4] - 2022-08-01
188285

189286
### Bug fixes
190287

191-
* Fixed [#287](https://github.com/rstudio/py-shiny/issues/287): Running `shiny static` on Windows failed with `PermissionError`. ([#288](https://github.com/rstudio/py-shiny/pull/288))
288+
* Fixed [#287](https://github.com/posit-dev/py-shiny/issues/287): Running `shiny static` on Windows failed with `PermissionError`. ([#288](https://github.com/posit-dev/py-shiny/pull/288))
192289

193290
## [0.2.3] - 2022-07-28
194291

195292
### Bug fixes
196293

197-
* Fixed [#281](https://github.com/rstudio/py-shiny/issues/281): Directory creation for Shinylive assets could fail if the parent directory did not exist. ([#283](https://github.com/rstudio/py-shiny/pull/283))
294+
* Fixed [#281](https://github.com/posit-dev/py-shiny/issues/281): Directory creation for Shinylive assets could fail if the parent directory did not exist. ([#283](https://github.com/posit-dev/py-shiny/pull/283))
198295

199296
## [0.2.2] - 2022-07-27
200297

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ message: "If you use this software, please cite it as below."
44
authors:
55
- name: "The Shiny development team"
66
license: MIT
7-
license-url: "https://github.com/rstudio/py-shiny/blob/main/LICENSE"
8-
repository-code: "https://github.com/rstudio/py-shiny"
7+
license-url: "https://github.com/posit-dev/py-shiny/blob/main/LICENSE"
8+
repository-code: "https://github.com/posit-dev/py-shiny"
99
type: software
1010
url: "https://shiny.posit.co/py/"

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ 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 *

Makefile

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ typings/matplotlib/__init__.pyi: ## grab type stubs from GitHub
5757
mv typings/python-type-stubs/stubs/matplotlib typings/
5858
rm -rf typings/python-type-stubs
5959

60-
pyright: typings/uvicorn typings/matplotlib/__init__.pyi ## type check with pyright
60+
typings/seaborn:
61+
pyright --createstub seaborn
62+
63+
pyright: typings/uvicorn typings/matplotlib/__init__.pyi typings/seaborn ## type check with pyright
6164
pyright
6265

6366
lint: ## check style with flake8
@@ -77,27 +80,37 @@ check: ## check code quality with black and isort
7780
isort --check-only --diff .
7881

7982
test: ## run tests quickly with the default Python
80-
python3 tests/asyncio_prevent.py
81-
pytest tests
83+
python3 tests/pytest/asyncio_prevent.py
84+
pytest
8285

8386
# Default `FILE` to `e2e` if not specified
84-
FILE:=e2e
87+
FILE:=tests/e2e
8588

86-
e2e: ## end-to-end tests with playwright
87-
playwright install --with-deps
88-
pytest $(FILE) -m "not examples"
89+
DEPLOYS_FILE:=tests/deploys
8990

90-
e2e-examples: ## end-to-end tests on examples with playwright
91+
playwright-install:
9192
playwright install --with-deps
93+
94+
trcli-install:
95+
which trcli || pip install trcli
96+
97+
e2e: playwright-install ## end-to-end tests with playwright
98+
pytest $(FILE) -m "not examples and not integrationtest"
99+
100+
e2e-examples: playwright-install ## end-to-end tests on examples with playwright
92101
pytest $(FILE) -m "examples"
93102

94-
coverage: ## check code coverage quickly with the default Python
95-
coverage run --source shiny -m pytest
96-
coverage report -m
103+
e2e-deploys: playwright-install ## end-to-end tests on deploys with playwright
104+
pytest $(DEPLOYS_FILE) -s -m "integrationtest"
105+
106+
e2e-junit: playwright-install trcli-install ## end-to-end tests with playwright and generate junit report
107+
pytest $(FILE) --junitxml=report.xml
108+
109+
coverage: ## check combined code coverage (must run e2e last)
110+
pytest --cov-report term-missing --cov=shiny tests/pytest/ tests/e2e/ -m "not examples and not integrationtest"
97111
coverage html
98112
$(BROWSER) htmlcov/index.html
99113

100-
101114
release: dist ## package and upload a release
102115
twine upload dist/*
103116

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pip install shiny
3333
To install the latest development version from this repository:
3434

3535
``` sh
36-
pip install https://github.com/rstudio/py-shiny/tarball/main
36+
pip install https://github.com/posit-dev/py-shiny/tarball/main
3737
```
3838

3939
You can create and run your first application with:

0 commit comments

Comments
 (0)