Skip to content

Commit 25f9b71

Browse files
committed
Merge branch 'main' into drop_fn_session_param
* main: (33 commits) test: Test apps locally before deploying via pytest fixtures. (#1055) docs: Add ExtendedTask to API index (#1088) Fix `render.download` in Shiny Express, take 2 (#1085) Bump version to 0.7.0.9000 Create two different api doc folders, one for Core and one for Express (#1053) chore: Pin black to version 23 (#1077) chore: Remove github link to shinylive (#1069) Bump version to 0.7.0 Raise when `express.[input,output,session]` are used outside of Express app (#1067) Update dashboard template (#1056) chore: Remove many broken quartodoc links (#1061) Update {bslib} (#1062) Update docstrings for `expressify`, `hold`, and `render.express` (#1066) Add `fill` to `__all__` in `ui` and `express.ui` (#1064) Update shiny.js (#1059) docs(examples): Use refactored shinylive syntax (#1048) Update `shiny.js` (#1052) Add `express.ui.panel_title` (#1039) Don't run `effect`s created in a `MockSession` (#1049) Delete shiny/api-examples/Calc directory (#1044) ...
2 parents 4d8cbc7 + aba9459 commit 25f9b71

File tree

373 files changed

+18458
-11392
lines changed

Some content is hidden

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

373 files changed

+18458
-11392
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,23 @@ runs:
99
using: "composite"
1010
steps:
1111
- name: Set up Python ${{ inputs.python-version }}
12-
uses: actions/setup-python@v4
12+
uses: actions/setup-python@v5
1313
with:
1414
python-version: ${{ inputs.python-version }}
15+
# # Caching with pip only saves ~15 seconds. Not work risks of confusion.
16+
# cache: 'pip'
17+
# cache-dependency-path: |
18+
# setup.cfg
1519

1620
- name: Upgrade pip
1721
shell: bash
1822
run: python -m pip install --upgrade pip
1923

20-
# TODO-future; Cache pip dependencies; See if installed library can be hashed
21-
2224
- name: Install dependencies
2325
shell: bash
2426
run: |
2527
pip install https://github.com/rstudio/py-htmltools/tarball/main
28+
pip install https://github.com/posit-dev/py-shinylive/tarball/main
2629
make install-deps
2730
2831
- name: Install

.github/workflows/build-docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
run: |
3535
cd docs
3636
make ../venv
37-
. ../venv/bin/activate && pip install https://github.com/rstudio/py-htmltools/tarball/main
37+
. ../venv/bin/activate && pip install https://github.com/posit-dev/py-htmltools/tarball/main https://github.com/posit-dev/py-shinylive/tarball/main
3838
make deps
3939
4040
- name: Run quartodoc

.github/workflows/pytest.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- name: Run End-to-End tests
6868
timeout-minutes: 20
6969
run: |
70-
make playwright-shiny
70+
make playwright-shiny SUB_FILE=". -vv"
7171
7272
playwright-examples:
7373
runs-on: ${{ matrix.os }}
@@ -99,15 +99,15 @@ jobs:
9999
- name: Run example app tests
100100
timeout-minutes: 20
101101
run: |
102-
make playwright-examples
102+
make playwright-examples SUB_FILE=". -vv"
103103
104104
playwright-deploys:
105105
# Only allow one `playwright-deploys` job to run at a time. (Independent of branch / PR)
106106
concurrency: playwright-deploys
107107
runs-on: ${{ matrix.os }}
108-
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'deploy')) }}
109108
strategy:
110109
matrix:
110+
# Matches deploy server python version
111111
python-version: ["3.10"]
112112
os: [ubuntu-latest]
113113
fail-fast: false
@@ -119,16 +119,27 @@ jobs:
119119
with:
120120
python-version: ${{ matrix.python-version }}
121121

122-
- name: Run tests for deploys
122+
- name: Test deploys example apps locally
123+
timeout-minutes: 5
123124
env:
125+
DEPLOY_APPS: "false"
126+
run: |
127+
make playwright-deploys SUB_FILE=". -vv"
128+
129+
- name: Deploy apps and run tests (on `push` or on `pull_request` w/ `deploy**` branch)
130+
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'deploy')) }}
131+
env:
132+
DEPLOY_APPS: "true"
124133
DEPLOY_CONNECT_SERVER_URL: "https://rsc.radixu.com/"
125134
DEPLOY_CONNECT_SERVER_API_KEY: "${{ secrets.DEPLOY_CONNECT_SERVER_API_KEY }}"
126135
DEPLOY_SHINYAPPS_NAME: "${{ secrets.DEPLOY_SHINYAPPS_NAME }}"
127136
DEPLOY_SHINYAPPS_TOKEN: "${{ secrets.DEPLOY_SHINYAPPS_TOKEN }}"
128137
DEPLOY_SHINYAPPS_SECRET: "${{ secrets.DEPLOY_SHINYAPPS_SECRET }}"
129138
timeout-minutes: 30
139+
# Given we are waiting for external servers to finish,
140+
# we can have many local processes waiting for deployment to finish
130141
run: |
131-
make playwright-deploys
142+
make playwright-deploys SUB_FILE=". -vv --numprocesses 12"
132143
133144
pypi:
134145
name: "Deploy to PyPI"

.github/workflows/verify-js-built.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414

1515
- name: Extract node version from .nvmrc
1616
id: nvm
17-
run: echo "::set-output name=version::$(cat .nvmrc)"
1817
working-directory: js
18+
run: |
19+
echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT
1920
2021
- name: Use Node.js
21-
uses: actions/setup-node@v2
22+
uses: actions/setup-node@v4
2223
with:
2324
node-version: "${{ steps.nvm.outputs.version }}"
2425

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@ docs/source/reference/
113113

114114
# Developer scratch area
115115
_dev/
116-
tests/playwright/deploys/apps/*/requirements.txt
116+
tests/playwright/deploys/**/requirements.txt

CHANGELOG.md

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

99
## [UNRELEASED]
1010

11+
* Fixed `render.download` not working in Express. (#1085)
12+
13+
14+
## [0.7.0] - 2024-01-25
15+
1116
### Breaking Changes
1217

1318
* Closed #938: `page_sidebar()` and `page_navbar()` now use `fillable=False` by default. (#990)
1419

1520
### New features
1621

22+
* Added `shiny.ui.input_task_button()` for creating buttons that launch longer-running tasks than `shiny.ui.input_action_button()` was designed for. Task buttons give visual feedback that the task is running, and cannot be clicked again until the task is complete. (#907)
23+
24+
* Added `@extended_task` decorator for creating long-running tasks that can be cancelled. (#907)
25+
1726
* Added `@render.download` as a replacement for `@session.download`, which is now deprecated. (#977)
1827

1928
* Added `ui.output_code()`, which is currently an alias for `ui.output_text_verbatim()`. (#997)
2029

2130
* Added `@render.code`, which is an alias for `@render.text`, but in Express mode, it displays the result using `ui.output_code()`. (#997)
2231

32+
* Added `App.on_shutdown` method for registering a callback to be called when the app is shutting down. (#907)
33+
34+
* You can now pass options to `ui.input_selectize` see the [selectize.js](https://selectize.dev/docs/API/selectize) docs for available options. (#914, #158)
35+
36+
* `ui.input_selectize` gains the `remove_button` argument which allows you to control the visibility of the remove button.
37+
2338
### Bug fixes
2439

2540
* CLI command `shiny create`... (#965)

Makefile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ test: ## run tests quickly with the default Python
8686
# Default `SUB_FILE` to empty
8787
SUB_FILE:=
8888

89-
DEPLOYS_FILE:=tests/playwright/deploys
90-
9189
install-playwright:
9290
playwright install --with-deps
9391

@@ -100,11 +98,11 @@ install-rsconnect: ## install the main version of rsconnect till pypi version su
10098
playwright-shiny: install-playwright ## end-to-end tests with playwright
10199
pytest tests/playwright/shiny/$(SUB_FILE)
102100

103-
playwright-examples: install-playwright ## end-to-end tests on examples with playwright
104-
pytest tests/playwright/examples
101+
playwright-deploys: install-playwright install-rsconnect ## end-to-end tests on examples with playwright
102+
pytest tests/playwright/deploys/$(SUB_FILE)
105103

106-
playwright-deploys: install-playwright install-rsconnect ## end-to-end tests on deploys with playwright
107-
pytest tests/playwright/deploys/$(SUB_FILE) -s
104+
playwright-examples: install-playwright ## end-to-end tests on examples with playwright
105+
pytest tests/playwright/examples/$(SUB_FILE)
108106

109107
testrail-junit: install-playwright install-trcli ## end-to-end tests with playwright and generate junit report
110108
pytest tests/playwright/shiny/$(SUB_FILE) --junitxml=report.xml
@@ -131,7 +129,7 @@ install: dist
131129
python3 -m pip install dist/shiny*.whl
132130

133131
install-deps: ## install dependencies
134-
pip install -e ".[dev,test]"
132+
pip install -e ".[dev,test]" --upgrade
135133

136134
# ## If caching is ever used, we could run:
137135
# install-deps: ## install latest dependencies

docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ _sidebar.yml
55
/.quarto/
66
objects.json
77
site_libs/
8+
_objects_core.json
9+
_objects_express.json

docs/Makefile

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,39 @@ deps: $(PYBIN) ## Install build dependencies
4646
$(PYBIN)/pip install pip --upgrade
4747
$(PYBIN)/pip install -e ..[doc]
4848

49-
quartodoc: $(PYBIN) ## Build qmd files for API docs
49+
quartodoc: quartodoc_build_core quartodoc_build_express quartodoc_post ## Build quartodocs for express and core
50+
51+
## Build interlinks for API docs
52+
quartodoc_interlinks: $(PYBIN)
53+
. $(PYBIN)/activate \
54+
&& quartodoc interlinks
55+
56+
## Build core API docs
57+
quartodoc_build_core: $(PYBIN) quartodoc_interlinks
58+
$(eval export SHINY_ADD_EXAMPLES=true)
59+
$(eval export IN_QUARTODOC=true)
60+
$(eval export SHINY_MODE=core)
61+
. $(PYBIN)/activate \
62+
&& echo "::group::quartodoc build core docs" \
63+
&& quartodoc build --config _quartodoc-core.yml --verbose \
64+
&& mv objects.json _objects_core.json \
65+
&& echo "::endgroup::"
66+
67+
## Build express API docs
68+
quartodoc_build_express: $(PYBIN) quartodoc_interlinks
69+
$(eval export SHINY_ADD_EXAMPLES=true)
70+
$(eval export IN_QUARTODOC=true)
71+
$(eval export SHINY_MODE=express)
72+
. $(PYBIN)/activate \
73+
&& echo "::group::quartodoc build express docs" \
74+
&& quartodoc build --config _quartodoc-express.yml --verbose \
75+
&& mv objects.json _objects_express.json \
76+
&& echo "::endgroup::"
77+
78+
## Clean up after quartodoc build
79+
quartodoc_post: $(PYBIN)
5080
. $(PYBIN)/activate \
51-
&& quartodoc interlinks \
52-
&& quartodoc build --config _quartodoc.yml --verbose
81+
&& python _combine_objects_json.py
5382

5483
site: ## Build website
5584
. $(PYBIN)/activate \

docs/_combine_objects_json.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import json
2+
from dataclasses import asdict, dataclass
3+
from typing import Literal, TypedDict
4+
5+
6+
@dataclass
7+
class QuartodocObject:
8+
project: str
9+
version: str
10+
count: int
11+
items: list["QuartodocObjectItem"]
12+
13+
14+
@dataclass
15+
class QuartodocObjectItem:
16+
name: str
17+
domain: str
18+
19+
# function: "shiny.ui.page_sidebar"
20+
# class: "shiny.render.renderer._renderer.Renderer"
21+
# attribute: "shiny.render.renderer._renderer.Renderer.output_id"
22+
role: Literal["function", "class", "attribute", "module"]
23+
priority: str
24+
uri: str
25+
dispname: str
26+
27+
28+
def read_objects_file(path: str) -> QuartodocObject:
29+
with open(path) as file:
30+
content = json.load(file)
31+
items = [QuartodocObjectItem(**item) for item in content.pop("items")]
32+
return QuartodocObject(**content, items=items)
33+
34+
35+
def write_objects_file(objects: QuartodocObject, path: str) -> None:
36+
with open(path, "w") as file:
37+
json.dump(objects, file, indent=4, default=lambda dc: dc.__dict__)
38+
39+
40+
print("\nCombining objects json files...")
41+
objects_core = read_objects_file("_objects_core.json")
42+
objects_express = read_objects_file("_objects_express.json")
43+
44+
items_map: dict[str, QuartodocObjectItem] = {}
45+
46+
for item in [*objects_core.items, *objects_express.items]:
47+
if item.name in items_map:
48+
continue
49+
items_map[item.name] = item
50+
51+
objects_ret = QuartodocObject(
52+
project="shiny",
53+
version="1",
54+
count=len(items_map.values()),
55+
items=[*items_map.values()],
56+
)
57+
58+
59+
print("Core:", objects_core.count)
60+
print("Express:", objects_express.count)
61+
print("Combined:", objects_ret.count)
62+
63+
# Save combined objects file info
64+
write_objects_file(objects_ret, "objects.json")

0 commit comments

Comments
 (0)