Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validation to function vars #4379

Open
wants to merge 101 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
56f0d63
add typing to function vars
adhami3310 Nov 13, 2024
9b06d68
import ParamSpec from typing_extensions
adhami3310 Nov 13, 2024
7aa9245
remove ellipsis as they are not supported in 3.9
adhami3310 Nov 13, 2024
48951db
try importing everything from extensions
adhami3310 Nov 13, 2024
7ada0ea
special case 3.9
adhami3310 Nov 13, 2024
6745d6c
don't use Any from extensions
adhami3310 Nov 13, 2024
f9b24fe
get typevar from extensions
adhami3310 Nov 13, 2024
05bd41c
add validation
adhami3310 Nov 13, 2024
1e9743d
Merge branch 'main' into add-validation-to-function-vars
adhami3310 Nov 13, 2024
ebc8181
fix silly mistakes
adhami3310 Nov 13, 2024
f4aa1f5
implement type computers
adhami3310 Nov 14, 2024
9d7e353
fix pyright issues
adhami3310 Nov 14, 2024
3cdd209
fix pyright issues outside of vars
adhami3310 Nov 14, 2024
a9db61b
get it right pyright
adhami3310 Nov 14, 2024
2c04153
special case ellipsis types
adhami3310 Nov 14, 2024
5f0546f
what am i doing anymore
adhami3310 Nov 15, 2024
53b9854
default factory
adhami3310 Nov 15, 2024
88cfb3b
handle var at top level
adhami3310 Nov 15, 2024
702670f
add components to var data
adhami3310 Nov 15, 2024
eac54d6
call guess type
adhami3310 Nov 15, 2024
7f1dc7c
remove .bool
adhami3310 Nov 15, 2024
92b1232
would this fix it? no clue
adhami3310 Nov 16, 2024
079cc56
more types
adhami3310 Nov 16, 2024
7d0a4f7
make safe issubclass
adhami3310 Nov 16, 2024
ed1ae0d
add missing return
adhami3310 Nov 16, 2024
2b05ee9
make it handle slice
adhami3310 Nov 16, 2024
2e1bc05
aaaaa
adhami3310 Nov 16, 2024
06eb04f
Merge branch 'main' into add-validation-to-function-vars
adhami3310 Dec 12, 2024
8830d5a
update poetry
adhami3310 Dec 12, 2024
bd2ea5b
update poetry version
adhami3310 Dec 12, 2024
99a3090
Merge branch 'main' into add-validation-to-function-vars
adhami3310 Jan 2, 2025
a5526af
update pyright once again
adhami3310 Jan 2, 2025
d31510c
Merge branch 'main' into add-validation-to-function-vars
adhami3310 Jan 15, 2025
056de9e
poetry update
adhami3310 Jan 15, 2025
2a02e96
make the thing compile again
adhami3310 Jan 15, 2025
45dde00
handle vars with var_type being BaseComponent
adhami3310 Jan 15, 2025
f0f84d5
fix some tests
adhami3310 Jan 16, 2025
f257122
Merge branch 'main' into add-validation-to-function-vars
adhami3310 Jan 16, 2025
990bf13
fix that test
adhami3310 Jan 16, 2025
713f907
silly me
adhami3310 Jan 16, 2025
1aa728e
use infallible guy
adhami3310 Jan 16, 2025
19b6fe9
handle component at largest scope
adhami3310 Jan 16, 2025
d0208e6
change range a bit
adhami3310 Jan 16, 2025
076cfea
fix and and or
adhami3310 Jan 16, 2025
a488fe0
i missed up that
adhami3310 Jan 16, 2025
f42d1f4
fix component state
adhami3310 Jan 16, 2025
4300f33
add wrap components override
adhami3310 Jan 16, 2025
94c9e52
fix convert to component logic
adhami3310 Jan 16, 2025
f9d45d5
fix tests for cond and var
adhami3310 Jan 17, 2025
94b4443
what if we simply didn't have match
adhami3310 Jan 17, 2025
72f1fa7
make the var type actually work
adhami3310 Jan 17, 2025
3d73f56
can't have ohio
adhami3310 Jan 17, 2025
112b2ed
solve some but not all pyright issues
adhami3310 Jan 17, 2025
57d8ea0
down to only two pyright error
adhami3310 Jan 17, 2025
270fcb9
Merge branch 'main' into add-validation-to-function-vars
adhami3310 Jan 17, 2025
0798cb8
fix version python 3.10
adhami3310 Jan 17, 2025
a7230f1
resolve pyright issues
adhami3310 Jan 17, 2025
0e539a2
fix syntax for soy 3.10
adhami3310 Jan 17, 2025
c6f05bb
fix lineno
adhami3310 Jan 17, 2025
9a987ca
dang it darglint
adhami3310 Jan 17, 2025
f4aa122
don't delete thomas code that's rude
adhami3310 Jan 17, 2025
fa6c12e
remove unnecessary comment
adhami3310 Jan 17, 2025
aadd8b5
do silly things
adhami3310 Jan 17, 2025
36af825
remove unused format functions
adhami3310 Jan 18, 2025
00019da
get rid of match class
adhami3310 Jan 18, 2025
b11fc5a
update pyi
adhami3310 Jan 18, 2025
392c5b5
who likes cond
adhami3310 Jan 18, 2025
b7579f4
why not, remove cond
adhami3310 Jan 18, 2025
9e7eeb2
fix imports
adhami3310 Jan 18, 2025
db89a71
reformat color_mode pyi
adhami3310 Jan 18, 2025
b10f6e8
remove even more cond and match
adhami3310 Jan 18, 2025
5d6b51c
what if i deleted rx.foreach
adhami3310 Jan 18, 2025
be92063
dang it darglint
adhami3310 Jan 18, 2025
5e45ca5
remove iterable from jinja
adhami3310 Jan 18, 2025
68b8c12
Merge branch 'main' into add-validation-to-function-vars
adhami3310 Jan 22, 2025
1f9fbd8
resolve merge mistakes
adhami3310 Jan 22, 2025
8173e10
ok we can unbreak foreach just for you
adhami3310 Jan 22, 2025
84d3a2b
unbreak cond why not
adhami3310 Jan 22, 2025
e10cf07
make icon to static methods
adhami3310 Jan 22, 2025
c6e2368
callable vars are not good
adhami3310 Jan 22, 2025
540382d
kill callable var
adhami3310 Jan 22, 2025
b2a27cb
fix list of component is a component
adhami3310 Jan 23, 2025
6a50b3a
i was a bit silly
adhami3310 Jan 23, 2025
19dd15b
Banner components that return Fragment inherit from Fragment
masenf Jan 22, 2025
29fc4b0
make the match logic better
adhami3310 Jan 23, 2025
24f341d
Merge branch 'main' into add-validation-to-function-vars
adhami3310 Jan 23, 2025
6604784
update pydantic requirement
adhami3310 Jan 23, 2025
d3b12a8
optimize var operation output
adhami3310 Jan 23, 2025
0d746bf
handle default args
adhami3310 Jan 23, 2025
2ffa698
improve match and cond checking
adhami3310 Jan 23, 2025
8fab30e
Merge branch 'main' into add-validation-to-function-vars
adhami3310 Jan 31, 2025
46c66b2
lock poetry
adhami3310 Jan 31, 2025
749577f
precommit
adhami3310 Jan 31, 2025
06b751f
remove caching things
adhami3310 Jan 31, 2025
1bb8ba5
Merge branch 'main' into add-validation-to-function-vars
adhami3310 Jan 31, 2025
aef6ace
clear cache on add style recursive
adhami3310 Jan 31, 2025
cabb9b4
Merge branch 'main' into add-validation-to-function-vars
adhami3310 Feb 13, 2025
a2074b9
Merge branch 'main' into add-validation-to-function-vars
adhami3310 Feb 13, 2025
3080cad
some random fixes after merge
adhami3310 Feb 13, 2025
d1ff6d5
bring back UntypedVarError
adhami3310 Feb 13, 2025
c743139
refactor match code
adhami3310 Feb 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make icon to static methods
  • Loading branch information
adhami3310 committed Jan 22, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit e10cf07506bc5ff7e430fd7910226a1c553ba2dd
2 changes: 1 addition & 1 deletion reflex/components/radix/themes/color_mode.py
Original file line number Diff line number Diff line change
@@ -190,7 +190,7 @@ def create(cls, *children, **props):
class ColorModeNamespace(Var):
"""Namespace for color mode components."""

icon = color_mode_icon
icon = staticmethod(color_mode_icon)
button = staticmethod(ColorModeIconButton.create)
switch = staticmethod(ColorModeSwitch.create)

2 changes: 1 addition & 1 deletion reflex/components/radix/themes/color_mode.pyi
Original file line number Diff line number Diff line change
@@ -403,7 +403,7 @@ class ColorModeSwitch(Switch):
...

class ColorModeNamespace(Var):
icon = color_mode_icon
icon = staticmethod(color_mode_icon)
button = staticmethod(ColorModeIconButton.create)
switch = staticmethod(ColorModeSwitch.create)

2 changes: 1 addition & 1 deletion reflex/utils/exec.py
Original file line number Diff line number Diff line change
@@ -262,7 +262,7 @@ def get_reload_dirs() -> list[Path]:
break

reload_dirs = [module_path]
return reload_dirs
return list(map(Path.absolute, reload_dirs))


def run_uvicorn_backend(host, port, loglevel: LogLevel):
Loading