Skip to content

Commit 2301a1a

Browse files
committed
Merge branch 'main' into update-pyright
* main: (40 commits) Use a renderer generator to create sync/async render methods with full typing (#621) docs: Add Tooltip section in experimental (#673) Bump version to 0.5.1 Add missing sidebar stylesheet dep (#667) GitHub action cleanup (#662) Add a triage label to issues created by non-maintainers (#647) Bump version to 0.5.0.9000 Model score example (#650) Fix malformed changelog entry Update CHANGELOG.md for data frame filters (#654) Bump version to 0.5.0 Allow ui.update_slider to handle non-numeric values (#649) Add updated path to examples (#645) Bump griffe version Update README Fix jumpy cursor in numeric filter (#640) Build API docs (#633) Pyright: ignore docs dir Filtering feature for data grid/table (#592) Add E2E tests for accordion and autoresize (#601) ...
2 parents 5ab9106 + da69ea0 commit 2301a1a

File tree

309 files changed

+26388
-1804
lines changed

Some content is hidden

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

309 files changed

+26388
-1804
lines changed

.github/workflows/build-docs.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build API docs
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.11"]
15+
fail-fast: false
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Upgrade pip
26+
run: python -m pip install --upgrade pip
27+
28+
- name: Install Quarto
29+
uses: quarto-dev/quarto-actions/setup@v2
30+
with:
31+
version: 1.3.340
32+
33+
- name: Install dependencies
34+
run: |
35+
cd docs
36+
make deps
37+
38+
- name: Run quartodoc
39+
run: |
40+
cd docs
41+
make quartodoc
42+
43+
- name: Build site
44+
run: |
45+
cd docs
46+
make site

.github/workflows/create-issue.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/triage-issues.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Issue Management
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
triage_or_add_to_project:
9+
runs-on: ubuntu-latest
10+
11+
env:
12+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
14+
steps:
15+
- name: Check if the issue creator is a maintainer
16+
id: check_maintainer
17+
run: |
18+
IS_ADMIN=`gh api /repos/rstudio/py-shiny/collaborators/${{ github.event.issue.user.login }}/permission --jq='.user.permissions.admin'`
19+
echo "is_maintainer=$IS_ADMIN" >> "$GITHUB_OUTPUT"
20+
21+
- name: Apply "needs triage" label to issues created by non-maintainers
22+
if: steps.check_maintainer.outputs.is_maintainer == 'false'
23+
run: |
24+
gh issue edit ${{ github.event.issue.number }} --add-label "needs-triage" --repo ${{ github.repository }}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Extract node version from .nvmrc
1616
id: nvm
1717
run: echo "::set-output name=version::$(cat .nvmrc)"
18-
working-directory: shiny/ui/dataframe/js
18+
working-directory: js
1919

2020
- name: Use Node.js
2121
uses: actions/setup-node@v2
@@ -24,13 +24,13 @@ jobs:
2424

2525
- name: Install dependencies
2626
run: npm ci
27-
working-directory: shiny/ui/dataframe/js
27+
working-directory: js
2828
env:
2929
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
3030

3131
- name: Build
3232
run: npm run build
33-
working-directory: shiny/ui/dataframe/js
33+
working-directory: js
3434

3535
- name: Check for uncommitted changes
3636
run: |
@@ -41,4 +41,4 @@ jobs:
4141
else
4242
echo "No uncommitted changes found."
4343
fi
44-
working-directory: shiny/ui/dataframe/js
44+
working-directory: js

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,5 @@ docs/source/reference/
107107

108108
.DS_Store
109109
.Rproj.user
110+
111+
/.luarc.json

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,36 @@ 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)
14+
1315
### Bug fixes
1416

1517
### Other changes
1618

19+
20+
## [0.5.1] - 2023-08-08
21+
22+
### Bug fixes
23+
24+
* Fixed #666: Added missing sidebar stylesheet dependency. (#667)
25+
26+
27+
## [0.5.0] - 2023-08-01
28+
29+
### New features
30+
31+
* The new fast-scrolling data table/grid feature (`ui.output_data_frame`/`render.data_frame`) now has a filtering feature. To enable, pass the argument `filters=True` to the `render.DataTable` or `render.DataGrid` constructors. (#592)
32+
* `shiny run` now takes a `--reload-dir <DIR>` argument that indicates a directory `--reload` should (recursively) monitor for changes, in addition to the app's parent directory. Can be used more than once. (#353)
33+
* The default theme has been updated to use Bootstrap 5 with custom Shiny style enhancements. (#624)
34+
* Added experimental UI `tooltip()`, `update_tooltip()`, and `toggle_tooltip()` for easy creation (and server-side updating) of [Bootstrap tooltips](https://getbootstrap.com/docs/5.2/components/tooltips/) (a way to display additional information when focusing (or hovering over) a UI element). (#629)
35+
36+
37+
### Bug fixes
38+
39+
* Using `update_slider` to update a slider's value to a `datetime` object or other non-numeric value would result in an error. (#649)
40+
41+
### Other changes
42+
1743
* Documentation updates. (#591)
1844
* Removed Python 3.7 support. (#590)
1945

CITATION.cff

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
cff-version: 1.2.0
2+
title: "Shiny for Python"
3+
message: "If you use this software, please cite it as below."
4+
authors:
5+
- name: "The Shiny development team"
6+
license: MIT
7+
license-url: "https://github.com/rstudio/py-shiny/blob/main/LICENSE"
8+
repository-code: "https://github.com/rstudio/py-shiny"
9+
type: software
10+
url: "https://shiny.posit.co/py/"

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
88

99
recursive-include shiny/www *
1010
recursive-include shiny/experimental/www *
11-
recursive-include shiny/examples *
11+
recursive-include shiny/api-examples *
1212
recursive-include shiny/ui/dataframe/js/dist *

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,13 @@ clean-test: ## remove test and coverage artifacts
5151
typings/uvicorn:
5252
pyright --createstub uvicorn
5353

54-
typings/matplotlib:
55-
pyright --createstub matplotlib
54+
typings/matplotlib/__init__.pyi: ## grab type stubs from GitHub
55+
mkdir -p typings
56+
git clone --depth 1 https://github.com/microsoft/python-type-stubs typings/python-type-stubs
57+
mv typings/python-type-stubs/stubs/matplotlib typings/
58+
rm -rf typings/python-type-stubs
5659

57-
pyright: typings/uvicorn typings/matplotlib ## type check with pyright
60+
pyright: typings/uvicorn typings/matplotlib/__init__.pyi ## type check with pyright
5861
pyright
5962

6063
lint: ## check style with flake8

docs/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
_site/
2+
api/
3+
_inv/
4+
_sidebar.yml
5+
/.quarto/
6+
objects.json

docs/Makefile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
.PHONY: help Makefile
2+
.DEFAULT_GOAL := help
3+
4+
define BROWSER_PYSCRIPT
5+
import os, webbrowser, sys
6+
7+
from urllib.request import pathname2url
8+
9+
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
10+
endef
11+
export BROWSER_PYSCRIPT
12+
13+
define PRINT_HELP_PYSCRIPT
14+
import re, sys
15+
16+
for line in sys.stdin:
17+
match = re.match(r'^([a-zA-Z1-9_-]+):.*?## (.*)$$', line)
18+
if match:
19+
target, help = match.groups()
20+
print("%-20s %s" % (target, help))
21+
endef
22+
export PRINT_HELP_PYSCRIPT
23+
24+
BROWSER := python -c "$$BROWSER_PYSCRIPT"
25+
26+
# Use venv from parent
27+
VENV = ../venv
28+
PYBIN = $(VENV)/bin
29+
30+
# Any targets that depend on $(VENV) or $(PYBIN) will cause the venv to be
31+
# created. To use the venv, python scripts should run with the prefix $(PYBIN),
32+
# as in `$(PYBIN)/pip`.
33+
$(VENV):
34+
python3 -m venv $(VENV)
35+
36+
$(PYBIN): $(VENV)
37+
38+
39+
help:
40+
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
41+
42+
deps: $(PYBIN) ## Install build dependencies
43+
$(PYBIN)/pip install pip --upgrade
44+
$(PYBIN)/pip install -e ..[doc]
45+
46+
quartodoc: ## Build qmd files for API docs
47+
. $(PYBIN)/activate \
48+
&& quartodoc interlinks \
49+
&& quartodoc build --config _quartodoc.yml --verbose
50+
51+
site: ## Build website
52+
. $(PYBIN)/activate \
53+
&& quarto render
54+
55+
serve: ## Build website and serve
56+
. $(PYBIN)/activate \
57+
&& quarto preview --port 8080
58+
59+
clean: ## Clean build artifacts
60+
rm -rf _inv api _site .quarto

docs/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Shiny for Python API docs
2+
=========================
3+
4+
This directory contains files to generate Shiny for Python API documentation, using [Quartodoc](https://machow.github.io/quartodoc/get-started/overview.html) and [Quarto](https://quarto.org/).
5+
6+
## Building the docs
7+
8+
To build the docs, first install the Python dependencies and Quarto extensions:
9+
10+
```bash
11+
# Install build dependencies
12+
make deps
13+
```
14+
15+
After those dependencies are installed, build the .qmd files for Shiny, using quartodoc. This will go in the `api/` directory:
16+
17+
```bash
18+
make quartodoc
19+
```
20+
21+
Then build the web site using Quarto:
22+
23+
```bash
24+
make site
25+
```
26+
27+
Alternatively, running `make serve` will build the docs, and serve them locally, and watch for changes to the .qmd files:
28+
29+
```bash
30+
make serve
31+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.html
2+
*.pdf
3+
*_files/
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: Interlinks
2+
author: Michael Chow
3+
version: 1.0.0
4+
quarto-required: ">=1.2.0"
5+
contributes:
6+
filters:
7+
- interlinks.lua

0 commit comments

Comments
 (0)