File tree 15 files changed +109
-96
lines changed
15 files changed +109
-96
lines changed Original file line number Diff line number Diff line change 29
29
30
30
- name : Build site
31
31
run : |
32
- make docs
32
+ make docs-site
33
33
34
34
- name : Upload site artifact
35
35
if : github.ref == 'refs/heads/main'
Original file line number Diff line number Diff line change
1
+ # For the rare case that you'd like to commit with no pre-commit hooks, you can use `--no-verify` in the commit call.
2
+ # ```
3
+ # git commit --no-verify -m "MSG"
4
+ # ```
1
5
repos :
2
6
- repo : https://github.com/astral-sh/ruff-pre-commit
3
7
rev : v0.3.2
Original file line number Diff line number Diff line change 1
- # .PHONY: help clean% check% format% docs% lint test pyright playwright% install% testrail% coverage release
2
-
3
1
# Depend on `FORCE` to ensure the target is always run
4
2
FORCE :
5
3
@@ -60,8 +58,10 @@ $(VENV):
60
58
$(PYBIN ) /pip install --upgrade pip
61
59
62
60
$(PYBIN ) : $(VENV )
61
+ $(PYTHON ) : $(PYBIN )
63
62
$(PIP ) : $(PYBIN )
64
63
64
+
65
65
UV = $(SITE_PACKAGES ) /uv
66
66
$(UV ) :
67
67
$(MAKE ) $(PYBIN )
@@ -80,7 +80,7 @@ PYTEST = $(SITE_PACKAGES)/pytest
80
80
COVERAGE = $(SITE_PACKAGES ) /coverage
81
81
PYRIGHT = $(SITE_PACKAGES ) /pyright
82
82
PLAYWRIGHT = $(SITE_PACKAGES ) /playwright
83
- $(PYTEST ) $(COVERAGE ) $(PYRIGHT ) $(PLAYWRIGHT ) :
83
+ $(RUFF ) $( PYTEST ) $(COVERAGE ) $(PYRIGHT ) $(PLAYWRIGHT ) :
84
84
@$(MAKE ) install-deps
85
85
86
86
Original file line number Diff line number Diff line change @@ -57,3 +57,5 @@ pre-commit install
57
57
# To disable:
58
58
# pre-commit uninstall
59
59
```
60
+
61
+ If you absolutely need to skip the pre-commit hooks, you can use the [ ` --no-verify ` flag when you commit] ( https://git-scm.com/docs/githooks#_pre_commit ) (` git commit --no-verify -m "MSG" ` ).
Original file line number Diff line number Diff line change 16
16
THRESHOLD_LOW = 0.5
17
17
THRESHOLD_LOW_COLOR = "rgb(193, 0, 0)"
18
18
19
+
20
+ def value_box_theme (score ):
21
+ if score > THRESHOLD_MID :
22
+ return "text-success"
23
+ elif score < THRESHOLD_LOW :
24
+ return "bg-danger"
25
+ else :
26
+ return "text-warning"
27
+
28
+
19
29
# Start a background thread that writes fake data to the SQLite database every second
20
30
scoredata .begin ()
21
31
@@ -192,13 +202,7 @@ def value_boxes():
192
202
ui .value_box (
193
203
model ,
194
204
ui .h2 (score ),
195
- theme = (
196
- "text-success"
197
- if score > THRESHOLD_MID
198
- else "text-warning"
199
- if score > THRESHOLD_LOW
200
- else "bg-danger"
201
- ),
205
+ theme = value_box_theme (score ),
202
206
)
203
207
for model , score in scores_by_model .items ()
204
208
],
Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ extend-select = [
88
88
]
89
89
90
90
[lint .extend-per-file-ignores ]
91
+ # I: isort; Do not reformat imports in `__init__.py` files.
92
+ "**/__init__.py" = [" I" ]
91
93
# F403: 'from module import *' used; unable to detect undefined names
92
94
# Also ignore `F403` in all `__init__.py` files.
93
95
"shiny/__init__.py" = [" F403" ]
@@ -102,8 +104,6 @@ extend-select = [
102
104
"shiny/templates/**" = [" T20" ]
103
105
"shiny/api-examples/**" = [" T20" ]
104
106
"tests/**" = [" T20" ]
105
- # I: isort
106
- "shiny/experimental/ui/__init__.py" = [" I" ]
107
107
# PT019: pytest
108
108
"tests/pytest/test_output_transformer.py" = [" PT019" ]
109
109
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
- from .. import render
4
-
5
3
# Import these with underscore names so they won't show in autocomplete from the Python
6
4
# console.
7
5
from ..session import (
8
6
Inputs as _Inputs ,
9
- )
10
- from ..session import (
11
7
Outputs as _Outputs ,
12
- )
13
- from ..session import (
14
8
Session as _Session ,
15
- )
16
- from ..session import (
17
9
get_current_session as _get_current_session ,
18
10
)
11
+ from .. import render
19
12
from . import ui
20
13
from ._is_express import is_express_app
21
14
from ._output import ( # noqa: F401
25
18
from ._run import app_opts , wrap_express_app
26
19
from .expressify_decorator import expressify
27
20
21
+
28
22
__all__ = (
29
23
"render" ,
30
24
"input" ,
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
+
3
4
from htmltools import (
4
- HTML ,
5
+ TagList ,
5
6
Tag ,
7
+ TagChild ,
6
8
TagAttrs ,
7
9
TagAttrValue ,
8
- TagChild ,
9
- TagList ,
10
+ tags ,
11
+ HTML ,
12
+ head_content ,
10
13
a ,
11
14
br ,
12
15
code ,
18
21
h4 ,
19
22
h5 ,
20
23
h6 ,
21
- head_content ,
22
24
hr ,
23
25
img ,
24
26
p ,
25
27
pre ,
26
28
span ,
27
29
strong ,
28
- tags ,
30
+ )
31
+
32
+ from ...ui import (
33
+ fill ,
29
34
)
30
35
31
36
from ...ui import (
32
37
AccordionPanel ,
33
38
AnimationOptions ,
34
39
CardItem ,
35
- Progress ,
36
40
ShowcaseLayout ,
37
41
Sidebar ,
38
42
SliderStepArg ,
39
43
SliderValueArg ,
40
44
ValueBoxTheme ,
41
- bind_task_button ,
42
45
brush_opts ,
43
46
click_opts ,
44
47
dblclick_opts ,
45
- fill ,
46
48
help_text ,
47
49
hover_opts ,
48
50
include_css ,
51
53
input_action_link ,
52
54
input_checkbox ,
53
55
input_checkbox_group ,
56
+ input_switch ,
57
+ input_radio_buttons ,
54
58
input_dark_mode ,
55
59
input_date ,
56
60
input_date_range ,
57
61
input_file ,
58
62
input_numeric ,
59
63
input_password ,
60
- input_radio_buttons ,
61
64
input_select ,
62
65
input_selectize ,
63
66
input_slider ,
64
- input_switch ,
67
+ bind_task_button ,
65
68
input_task_button ,
66
69
input_text ,
67
70
input_text_area ,
68
- insert_accordion_panel ,
69
- insert_ui ,
70
- js_eval ,
71
- markdown ,
72
- modal ,
73
- modal_button ,
74
- modal_remove ,
75
- modal_show ,
76
- nav_spacer ,
77
- notification_remove ,
78
- notification_show ,
79
71
panel_title ,
72
+ insert_accordion_panel ,
80
73
remove_accordion_panel ,
81
- remove_ui ,
82
74
update_accordion ,
83
75
update_accordion_panel ,
76
+ update_sidebar ,
84
77
update_action_button ,
85
78
update_action_link ,
86
79
update_checkbox ,
80
+ update_switch ,
87
81
update_checkbox_group ,
82
+ update_radio_buttons ,
88
83
update_dark_mode ,
89
84
update_date ,
90
85
update_date_range ,
91
- update_navs ,
92
86
update_numeric ,
93
- update_popover ,
94
- update_radio_buttons ,
95
87
update_select ,
96
88
update_selectize ,
97
- update_sidebar ,
98
89
update_slider ,
99
- update_switch ,
100
90
update_task_button ,
101
91
update_text ,
102
92
update_text_area ,
93
+ update_navs ,
103
94
update_tooltip ,
95
+ update_popover ,
96
+ insert_ui ,
97
+ remove_ui ,
98
+ markdown ,
99
+ modal_button ,
100
+ modal ,
101
+ modal_show ,
102
+ modal_remove ,
103
+ notification_show ,
104
+ notification_remove ,
105
+ nav_spacer ,
106
+ Progress ,
104
107
value_box_theme ,
108
+ js_eval ,
105
109
)
110
+
106
111
from ._cm_components import (
107
- accordion ,
108
- accordion_panel ,
109
- card ,
110
- card_footer ,
111
- card_header ,
112
+ sidebar ,
113
+ layout_sidebar ,
112
114
layout_column_wrap ,
113
115
layout_columns ,
114
- layout_sidebar ,
116
+ card ,
117
+ card_header ,
118
+ card_footer ,
119
+ accordion ,
120
+ accordion_panel ,
121
+ nav_panel ,
115
122
nav_control ,
116
123
nav_menu ,
117
- nav_panel ,
118
124
navset_bar ,
119
125
navset_card_pill ,
120
126
navset_card_tab ,
124
130
navset_pill_list ,
125
131
navset_tab ,
126
132
navset_underline ,
127
- panel_absolute ,
133
+ value_box ,
134
+ panel_well ,
128
135
panel_conditional ,
129
136
panel_fixed ,
130
- panel_well ,
131
- popover ,
132
- sidebar ,
137
+ panel_absolute ,
133
138
tooltip ,
134
- value_box ,
135
- )
136
- from ._hold import (
137
- hold ,
139
+ popover ,
138
140
)
141
+
139
142
from ._page import (
140
143
page_opts ,
141
144
)
142
145
146
+ from ._hold import (
147
+ hold ,
148
+ )
149
+
143
150
__all__ = (
144
151
# Imports from htmltools
145
152
"TagList" ,
Original file line number Diff line number Diff line change 1
1
from ._core import ( # noqa: F401
2
2
Context ,
3
- flush ,
4
- get_current_context , # pyright: ignore[reportUnusedImport]
5
- invalidate_later ,
6
3
isolate ,
4
+ invalidate_later ,
5
+ flush ,
7
6
lock ,
8
7
on_flushed ,
8
+ get_current_context , # pyright: ignore[reportUnusedImport]
9
9
)
10
- from ._extended_task import ExtendedTask , extended_task
11
- from ._poll import file_reader , poll
10
+ from ._poll import poll , file_reader
12
11
from ._reactives import ( # noqa: F401
12
+ value ,
13
+ Value ,
14
+ calc ,
13
15
Calc ,
14
16
Calc_ , # pyright: ignore[reportUnusedImport]
15
17
CalcAsync_ , # pyright: ignore[reportUnusedImport]
18
+ effect ,
16
19
Effect ,
17
20
Effect_ , # pyright: ignore[reportUnusedImport]
18
- Value ,
19
- calc ,
20
- effect ,
21
21
event ,
22
- value ,
23
22
)
23
+ from ._extended_task import ExtendedTask , extended_task
24
+
24
25
25
26
__all__ = (
26
27
"Context" ,
Original file line number Diff line number Diff line change 10
10
DataTable ,
11
11
data_frame ,
12
12
)
13
- from ._deprecated import ( # noqa: F401
14
- RenderFunction , # pyright: ignore[reportUnusedImport]
15
- RenderFunctionAsync , # pyright: ignore[reportUnusedImport]
16
- )
17
13
from ._express import (
18
14
express ,
19
15
)
20
16
from ._render import (
21
17
code ,
22
- download ,
23
18
image ,
24
19
plot ,
25
20
table ,
26
21
text ,
27
22
ui ,
23
+ download ,
24
+ )
25
+ from ._deprecated import ( # noqa: F401
26
+ RenderFunction , # pyright: ignore[reportUnusedImport]
27
+ RenderFunctionAsync , # pyright: ignore[reportUnusedImport]
28
28
)
29
29
30
30
__all__ = (
Original file line number Diff line number Diff line change 1
1
from ._renderer import (
2
- AsyncValueFn ,
3
- Jsonifiable ,
4
2
Renderer ,
5
- RendererT ,
6
3
ValueFn ,
4
+ Jsonifiable ,
5
+ RendererT ,
6
+ AsyncValueFn ,
7
+ # IT, # pyright: ignore[reportUnusedImport]
7
8
)
8
9
9
10
__all__ = (
You can’t perform that action at this time.
0 commit comments