From 6494683c275b82ccfad503a302a6c04f1e78cfb4 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Mon, 18 Nov 2024 15:11:04 -0800 Subject: [PATCH 01/24] Fix ternary logic when printing template name (#4393) --- reflex/reflex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/reflex.py b/reflex/reflex.py index b0aa51090..a9a1e5455 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -120,7 +120,7 @@ def _init( # Initialize the requirements.txt. prerequisites.initialize_requirements_txt() - template_msg = "" if template else f" using the {template} template" + template_msg = "" if not template else f" using the {template} template" # Finish initializing the app. console.success(f"Initialized {app_name}{template_msg}") From 3f58ceef955f9c22c2f217ee2fc0a0761378800b Mon Sep 17 00:00:00 2001 From: Simon Young <40179067+Kastier1@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:59:54 -0800 Subject: [PATCH 02/24] update cli version (#4394) Co-authored-by: simon --- poetry.lock | 371 ++++++++++++++++++++++------------------------- pyproject.toml | 2 +- reflex/reflex.py | 15 +- 3 files changed, 187 insertions(+), 201 deletions(-) diff --git a/poetry.lock b/poetry.lock index 55ce64a09..c19780931 100644 --- a/poetry.lock +++ b/poetry.lock @@ -386,73 +386,73 @@ files = [ [[package]] name = "coverage" -version = "7.6.4" +version = "7.6.7" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.9" files = [ - {file = "coverage-7.6.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5f8ae553cba74085db385d489c7a792ad66f7f9ba2ee85bfa508aeb84cf0ba07"}, - {file = "coverage-7.6.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8165b796df0bd42e10527a3f493c592ba494f16ef3c8b531288e3d0d72c1f6f0"}, - {file = "coverage-7.6.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c7c8b95bf47db6d19096a5e052ffca0a05f335bc63cef281a6e8fe864d450a72"}, - {file = "coverage-7.6.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8ed9281d1b52628e81393f5eaee24a45cbd64965f41857559c2b7ff19385df51"}, - {file = "coverage-7.6.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0809082ee480bb8f7416507538243c8863ac74fd8a5d2485c46f0f7499f2b491"}, - {file = "coverage-7.6.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d541423cdd416b78626b55f123412fcf979d22a2c39fce251b350de38c15c15b"}, - {file = "coverage-7.6.4-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:58809e238a8a12a625c70450b48e8767cff9eb67c62e6154a642b21ddf79baea"}, - {file = "coverage-7.6.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c9b8e184898ed014884ca84c70562b4a82cbc63b044d366fedc68bc2b2f3394a"}, - {file = "coverage-7.6.4-cp310-cp310-win32.whl", hash = "sha256:6bd818b7ea14bc6e1f06e241e8234508b21edf1b242d49831831a9450e2f35fa"}, - {file = "coverage-7.6.4-cp310-cp310-win_amd64.whl", hash = "sha256:06babbb8f4e74b063dbaeb74ad68dfce9186c595a15f11f5d5683f748fa1d172"}, - {file = "coverage-7.6.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:73d2b73584446e66ee633eaad1a56aad577c077f46c35ca3283cd687b7715b0b"}, - {file = "coverage-7.6.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:51b44306032045b383a7a8a2c13878de375117946d68dcb54308111f39775a25"}, - {file = "coverage-7.6.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b3fb02fe73bed561fa12d279a417b432e5b50fe03e8d663d61b3d5990f29546"}, - {file = "coverage-7.6.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ed8fe9189d2beb6edc14d3ad19800626e1d9f2d975e436f84e19efb7fa19469b"}, - {file = "coverage-7.6.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b369ead6527d025a0fe7bd3864e46dbee3aa8f652d48df6174f8d0bac9e26e0e"}, - {file = "coverage-7.6.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:ade3ca1e5f0ff46b678b66201f7ff477e8fa11fb537f3b55c3f0568fbfe6e718"}, - {file = "coverage-7.6.4-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:27fb4a050aaf18772db513091c9c13f6cb94ed40eacdef8dad8411d92d9992db"}, - {file = "coverage-7.6.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:4f704f0998911abf728a7783799444fcbbe8261c4a6c166f667937ae6a8aa522"}, - {file = "coverage-7.6.4-cp311-cp311-win32.whl", hash = "sha256:29155cd511ee058e260db648b6182c419422a0d2e9a4fa44501898cf918866cf"}, - {file = "coverage-7.6.4-cp311-cp311-win_amd64.whl", hash = "sha256:8902dd6a30173d4ef09954bfcb24b5d7b5190cf14a43170e386979651e09ba19"}, - {file = "coverage-7.6.4-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:12394842a3a8affa3ba62b0d4ab7e9e210c5e366fbac3e8b2a68636fb19892c2"}, - {file = "coverage-7.6.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2b6b4c83d8e8ea79f27ab80778c19bc037759aea298da4b56621f4474ffeb117"}, - {file = "coverage-7.6.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d5b8007f81b88696d06f7df0cb9af0d3b835fe0c8dbf489bad70b45f0e45613"}, - {file = "coverage-7.6.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b57b768feb866f44eeed9f46975f3d6406380275c5ddfe22f531a2bf187eda27"}, - {file = "coverage-7.6.4-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5915fcdec0e54ee229926868e9b08586376cae1f5faa9bbaf8faf3561b393d52"}, - {file = "coverage-7.6.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:0b58c672d14f16ed92a48db984612f5ce3836ae7d72cdd161001cc54512571f2"}, - {file = "coverage-7.6.4-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:2fdef0d83a2d08d69b1f2210a93c416d54e14d9eb398f6ab2f0a209433db19e1"}, - {file = "coverage-7.6.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:8cf717ee42012be8c0cb205dbbf18ffa9003c4cbf4ad078db47b95e10748eec5"}, - {file = "coverage-7.6.4-cp312-cp312-win32.whl", hash = "sha256:7bb92c539a624cf86296dd0c68cd5cc286c9eef2d0c3b8b192b604ce9de20a17"}, - {file = "coverage-7.6.4-cp312-cp312-win_amd64.whl", hash = "sha256:1032e178b76a4e2b5b32e19d0fd0abbce4b58e77a1ca695820d10e491fa32b08"}, - {file = "coverage-7.6.4-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:023bf8ee3ec6d35af9c1c6ccc1d18fa69afa1cb29eaac57cb064dbb262a517f9"}, - {file = "coverage-7.6.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:b0ac3d42cb51c4b12df9c5f0dd2f13a4f24f01943627120ec4d293c9181219ba"}, - {file = "coverage-7.6.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f8fe4984b431f8621ca53d9380901f62bfb54ff759a1348cd140490ada7b693c"}, - {file = "coverage-7.6.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5fbd612f8a091954a0c8dd4c0b571b973487277d26476f8480bfa4b2a65b5d06"}, - {file = "coverage-7.6.4-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dacbc52de979f2823a819571f2e3a350a7e36b8cb7484cdb1e289bceaf35305f"}, - {file = "coverage-7.6.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:dab4d16dfef34b185032580e2f2f89253d302facba093d5fa9dbe04f569c4f4b"}, - {file = "coverage-7.6.4-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:862264b12ebb65ad8d863d51f17758b1684560b66ab02770d4f0baf2ff75da21"}, - {file = "coverage-7.6.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:5beb1ee382ad32afe424097de57134175fea3faf847b9af002cc7895be4e2a5a"}, - {file = "coverage-7.6.4-cp313-cp313-win32.whl", hash = "sha256:bf20494da9653f6410213424f5f8ad0ed885e01f7e8e59811f572bdb20b8972e"}, - {file = "coverage-7.6.4-cp313-cp313-win_amd64.whl", hash = "sha256:182e6cd5c040cec0a1c8d415a87b67ed01193ed9ad458ee427741c7d8513d963"}, - {file = "coverage-7.6.4-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:a181e99301a0ae128493a24cfe5cfb5b488c4e0bf2f8702091473d033494d04f"}, - {file = "coverage-7.6.4-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:df57bdbeffe694e7842092c5e2e0bc80fff7f43379d465f932ef36f027179806"}, - {file = "coverage-7.6.4-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0bcd1069e710600e8e4cf27f65c90c7843fa8edfb4520fb0ccb88894cad08b11"}, - {file = "coverage-7.6.4-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:99b41d18e6b2a48ba949418db48159d7a2e81c5cc290fc934b7d2380515bd0e3"}, - {file = "coverage-7.6.4-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a6b1e54712ba3474f34b7ef7a41e65bd9037ad47916ccb1cc78769bae324c01a"}, - {file = "coverage-7.6.4-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:53d202fd109416ce011578f321460795abfe10bb901b883cafd9b3ef851bacfc"}, - {file = "coverage-7.6.4-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:c48167910a8f644671de9f2083a23630fbf7a1cb70ce939440cd3328e0919f70"}, - {file = "coverage-7.6.4-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:cc8ff50b50ce532de2fa7a7daae9dd12f0a699bfcd47f20945364e5c31799fef"}, - {file = "coverage-7.6.4-cp313-cp313t-win32.whl", hash = "sha256:b8d3a03d9bfcaf5b0141d07a88456bb6a4c3ce55c080712fec8418ef3610230e"}, - {file = "coverage-7.6.4-cp313-cp313t-win_amd64.whl", hash = "sha256:f3ddf056d3ebcf6ce47bdaf56142af51bb7fad09e4af310241e9db7a3a8022e1"}, - {file = "coverage-7.6.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9cb7fa111d21a6b55cbf633039f7bc2749e74932e3aa7cb7333f675a58a58bf3"}, - {file = "coverage-7.6.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:11a223a14e91a4693d2d0755c7a043db43d96a7450b4f356d506c2562c48642c"}, - {file = "coverage-7.6.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a413a096c4cbac202433c850ee43fa326d2e871b24554da8327b01632673a076"}, - {file = "coverage-7.6.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:00a1d69c112ff5149cabe60d2e2ee948752c975d95f1e1096742e6077affd376"}, - {file = "coverage-7.6.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f76846299ba5c54d12c91d776d9605ae33f8ae2b9d1d3c3703cf2db1a67f2c0"}, - {file = "coverage-7.6.4-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:fe439416eb6380de434886b00c859304338f8b19f6f54811984f3420a2e03858"}, - {file = "coverage-7.6.4-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:0294ca37f1ba500667b1aef631e48d875ced93ad5e06fa665a3295bdd1d95111"}, - {file = "coverage-7.6.4-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:6f01ba56b1c0e9d149f9ac85a2f999724895229eb36bd997b61e62999e9b0901"}, - {file = "coverage-7.6.4-cp39-cp39-win32.whl", hash = "sha256:bc66f0bf1d7730a17430a50163bb264ba9ded56739112368ba985ddaa9c3bd09"}, - {file = "coverage-7.6.4-cp39-cp39-win_amd64.whl", hash = "sha256:c481b47f6b5845064c65a7bc78bc0860e635a9b055af0df46fdf1c58cebf8e8f"}, - {file = "coverage-7.6.4-pp39.pp310-none-any.whl", hash = "sha256:3c65d37f3a9ebb703e710befdc489a38683a5b152242664b973a7b7b22348a4e"}, - {file = "coverage-7.6.4.tar.gz", hash = "sha256:29fc0f17b1d3fea332f8001d4558f8214af7f1d87a345f3a133c901d60347c73"}, + {file = "coverage-7.6.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:108bb458827765d538abcbf8288599fee07d2743357bdd9b9dad456c287e121e"}, + {file = "coverage-7.6.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c973b2fe4dc445cb865ab369df7521df9c27bf40715c837a113edaa2aa9faf45"}, + {file = "coverage-7.6.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c6b24007c4bcd0b19fac25763a7cac5035c735ae017e9a349b927cfc88f31c1"}, + {file = "coverage-7.6.7-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:acbb8af78f8f91b3b51f58f288c0994ba63c646bc1a8a22ad072e4e7e0a49f1c"}, + {file = "coverage-7.6.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad32a981bcdedb8d2ace03b05e4fd8dace8901eec64a532b00b15217d3677dd2"}, + {file = "coverage-7.6.7-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:34d23e28ccb26236718a3a78ba72744212aa383141961dd6825f6595005c8b06"}, + {file = "coverage-7.6.7-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e25bacb53a8c7325e34d45dddd2f2fbae0dbc230d0e2642e264a64e17322a777"}, + {file = "coverage-7.6.7-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:af05bbba896c4472a29408455fe31b3797b4d8648ed0a2ccac03e074a77e2314"}, + {file = "coverage-7.6.7-cp310-cp310-win32.whl", hash = "sha256:796c9b107d11d2d69e1849b2dfe41730134b526a49d3acb98ca02f4985eeff7a"}, + {file = "coverage-7.6.7-cp310-cp310-win_amd64.whl", hash = "sha256:987a8e3da7da4eed10a20491cf790589a8e5e07656b6dc22d3814c4d88faf163"}, + {file = "coverage-7.6.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7e61b0e77ff4dddebb35a0e8bb5a68bf0f8b872407d8d9f0c726b65dfabe2469"}, + {file = "coverage-7.6.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1a5407a75ca4abc20d6252efeb238377a71ce7bda849c26c7a9bece8680a5d99"}, + {file = "coverage-7.6.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df002e59f2d29e889c37abd0b9ee0d0e6e38c24f5f55d71ff0e09e3412a340ec"}, + {file = "coverage-7.6.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:673184b3156cba06154825f25af33baa2671ddae6343f23175764e65a8c4c30b"}, + {file = "coverage-7.6.7-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e69ad502f1a2243f739f5bd60565d14a278be58be4c137d90799f2c263e7049a"}, + {file = "coverage-7.6.7-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:60dcf7605c50ea72a14490d0756daffef77a5be15ed1b9fea468b1c7bda1bc3b"}, + {file = "coverage-7.6.7-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:9c2eb378bebb2c8f65befcb5147877fc1c9fbc640fc0aad3add759b5df79d55d"}, + {file = "coverage-7.6.7-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3c0317288f032221d35fa4cbc35d9f4923ff0dfd176c79c9b356e8ef8ef2dff4"}, + {file = "coverage-7.6.7-cp311-cp311-win32.whl", hash = "sha256:951aade8297358f3618a6e0660dc74f6b52233c42089d28525749fc8267dccd2"}, + {file = "coverage-7.6.7-cp311-cp311-win_amd64.whl", hash = "sha256:5e444b8e88339a2a67ce07d41faabb1d60d1004820cee5a2c2b54e2d8e429a0f"}, + {file = "coverage-7.6.7-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:f07ff574986bc3edb80e2c36391678a271d555f91fd1d332a1e0f4b5ea4b6ea9"}, + {file = "coverage-7.6.7-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:49ed5ee4109258973630c1f9d099c7e72c5c36605029f3a91fe9982c6076c82b"}, + {file = "coverage-7.6.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3e8796434a8106b3ac025fd15417315d7a58ee3e600ad4dbcfddc3f4b14342c"}, + {file = "coverage-7.6.7-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a3b925300484a3294d1c70f6b2b810d6526f2929de954e5b6be2bf8caa1f12c1"}, + {file = "coverage-7.6.7-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c42ec2c522e3ddd683dec5cdce8e62817afb648caedad9da725001fa530d354"}, + {file = "coverage-7.6.7-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:0266b62cbea568bd5e93a4da364d05de422110cbed5056d69339bd5af5685433"}, + {file = "coverage-7.6.7-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:e5f2a0f161d126ccc7038f1f3029184dbdf8f018230af17ef6fd6a707a5b881f"}, + {file = "coverage-7.6.7-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c132b5a22821f9b143f87446805e13580b67c670a548b96da945a8f6b4f2efbb"}, + {file = "coverage-7.6.7-cp312-cp312-win32.whl", hash = "sha256:7c07de0d2a110f02af30883cd7dddbe704887617d5c27cf373362667445a4c76"}, + {file = "coverage-7.6.7-cp312-cp312-win_amd64.whl", hash = "sha256:fd49c01e5057a451c30c9b892948976f5d38f2cbd04dc556a82743ba8e27ed8c"}, + {file = "coverage-7.6.7-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:46f21663e358beae6b368429ffadf14ed0a329996248a847a4322fb2e35d64d3"}, + {file = "coverage-7.6.7-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:40cca284c7c310d622a1677f105e8507441d1bb7c226f41978ba7c86979609ab"}, + {file = "coverage-7.6.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77256ad2345c29fe59ae861aa11cfc74579c88d4e8dbf121cbe46b8e32aec808"}, + {file = "coverage-7.6.7-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:87ea64b9fa52bf395272e54020537990a28078478167ade6c61da7ac04dc14bc"}, + {file = "coverage-7.6.7-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2d608a7808793e3615e54e9267519351c3ae204a6d85764d8337bd95993581a8"}, + {file = "coverage-7.6.7-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:cdd94501d65adc5c24f8a1a0eda110452ba62b3f4aeaba01e021c1ed9cb8f34a"}, + {file = "coverage-7.6.7-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:82c809a62e953867cf57e0548c2b8464207f5f3a6ff0e1e961683e79b89f2c55"}, + {file = "coverage-7.6.7-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:bb684694e99d0b791a43e9fc0fa58efc15ec357ac48d25b619f207c41f2fd384"}, + {file = "coverage-7.6.7-cp313-cp313-win32.whl", hash = "sha256:963e4a08cbb0af6623e61492c0ec4c0ec5c5cf74db5f6564f98248d27ee57d30"}, + {file = "coverage-7.6.7-cp313-cp313-win_amd64.whl", hash = "sha256:14045b8bfd5909196a90da145a37f9d335a5d988a83db34e80f41e965fb7cb42"}, + {file = "coverage-7.6.7-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:f2c7a045eef561e9544359a0bf5784b44e55cefc7261a20e730baa9220c83413"}, + {file = "coverage-7.6.7-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:5dd4e4a49d9c72a38d18d641135d2fb0bdf7b726ca60a103836b3d00a1182acd"}, + {file = "coverage-7.6.7-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c95e0fa3d1547cb6f021ab72f5c23402da2358beec0a8e6d19a368bd7b0fb37"}, + {file = "coverage-7.6.7-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f63e21ed474edd23f7501f89b53280014436e383a14b9bd77a648366c81dce7b"}, + {file = "coverage-7.6.7-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ead9b9605c54d15be228687552916c89c9683c215370c4a44f1f217d2adcc34d"}, + {file = "coverage-7.6.7-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:0573f5cbf39114270842d01872952d301027d2d6e2d84013f30966313cadb529"}, + {file = "coverage-7.6.7-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:e2c8e3384c12dfa19fa9a52f23eb091a8fad93b5b81a41b14c17c78e23dd1d8b"}, + {file = "coverage-7.6.7-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:70a56a2ec1869e6e9fa69ef6b76b1a8a7ef709972b9cc473f9ce9d26b5997ce3"}, + {file = "coverage-7.6.7-cp313-cp313t-win32.whl", hash = "sha256:dbba8210f5067398b2c4d96b4e64d8fb943644d5eb70be0d989067c8ca40c0f8"}, + {file = "coverage-7.6.7-cp313-cp313t-win_amd64.whl", hash = "sha256:dfd14bcae0c94004baba5184d1c935ae0d1231b8409eb6c103a5fd75e8ecdc56"}, + {file = "coverage-7.6.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:37a15573f988b67f7348916077c6d8ad43adb75e478d0910957394df397d2874"}, + {file = "coverage-7.6.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b6cce5c76985f81da3769c52203ee94722cd5d5889731cd70d31fee939b74bf0"}, + {file = "coverage-7.6.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1ab9763d291a17b527ac6fd11d1a9a9c358280adb320e9c2672a97af346ac2c"}, + {file = "coverage-7.6.7-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6cf96ceaa275f071f1bea3067f8fd43bec184a25a962c754024c973af871e1b7"}, + {file = "coverage-7.6.7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aee9cf6b0134d6f932d219ce253ef0e624f4fa588ee64830fcba193269e4daa3"}, + {file = "coverage-7.6.7-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2bc3e45c16564cc72de09e37413262b9f99167803e5e48c6156bccdfb22c8327"}, + {file = "coverage-7.6.7-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:623e6965dcf4e28a3debaa6fcf4b99ee06d27218f46d43befe4db1c70841551c"}, + {file = "coverage-7.6.7-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:850cfd2d6fc26f8346f422920ac204e1d28814e32e3a58c19c91980fa74d8289"}, + {file = "coverage-7.6.7-cp39-cp39-win32.whl", hash = "sha256:c296263093f099da4f51b3dff1eff5d4959b527d4f2f419e16508c5da9e15e8c"}, + {file = "coverage-7.6.7-cp39-cp39-win_amd64.whl", hash = "sha256:90746521206c88bdb305a4bf3342b1b7316ab80f804d40c536fc7d329301ee13"}, + {file = "coverage-7.6.7-pp39.pp310-none-any.whl", hash = "sha256:0ddcb70b3a3a57581b450571b31cb774f23eb9519c2aaa6176d3a84c9fc57671"}, + {file = "coverage-7.6.7.tar.gz", hash = "sha256:d79d4826e41441c9a118ff045e4bccb9fdbdcb1d02413e7ea6eb5c87b5439d24"}, ] [package.dependencies] @@ -585,13 +585,13 @@ test = ["pytest (>=6)"] [[package]] name = "fastapi" -version = "0.115.4" +version = "0.115.5" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" files = [ - {file = "fastapi-0.115.4-py3-none-any.whl", hash = "sha256:0b504a063ffb3cf96a5e27dc1bc32c80ca743a2528574f9cdc77daa2d31b4742"}, - {file = "fastapi-0.115.4.tar.gz", hash = "sha256:db653475586b091cb8b2fec2ac54a680ac6a158e07406e1abae31679e8826349"}, + {file = "fastapi-0.115.5-py3-none-any.whl", hash = "sha256:596b95adbe1474da47049e802f9a65ab2ffa9c2b07e7efee70eb8a66c9f2f796"}, + {file = "fastapi-0.115.5.tar.gz", hash = "sha256:0e7a4d0dc0d01c68df21887cce0945e72d3c48b9f4f79dfe7a7d53aa08fbb289"}, ] [package.dependencies] @@ -739,13 +739,13 @@ files = [ [[package]] name = "httpcore" -version = "1.0.6" +version = "1.0.7" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" files = [ - {file = "httpcore-1.0.6-py3-none-any.whl", hash = "sha256:27b59625743b85577a8c0e10e55b50b5368a4f2cfe8cc7bcfa9cf00829c2682f"}, - {file = "httpcore-1.0.6.tar.gz", hash = "sha256:73f6dbd6eb8c21bbf7ef8efad555481853f5f6acdeaff1edb0694289269ee17f"}, + {file = "httpcore-1.0.7-py3-none-any.whl", hash = "sha256:a3fff8f43dc260d5bd363d9f9cf1830fa3a458b332856f34282de498ed420edd"}, + {file = "httpcore-1.0.7.tar.gz", hash = "sha256:8551cb62a169ec7162ac7be8d4817d561f60e08eaa485234898414bb5a8a0b4c"}, ] [package.dependencies] @@ -785,13 +785,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "identify" -version = "2.6.1" +version = "2.6.2" description = "File identification library for Python" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "identify-2.6.1-py2.py3-none-any.whl", hash = "sha256:53863bcac7caf8d2ed85bd20312ea5dcfc22226800f6d6881f232d861db5a8f0"}, - {file = "identify-2.6.1.tar.gz", hash = "sha256:91478c5fb7c3aac5ff7bf9b4344f803843dc586832d5f110d672b19aa1984c98"}, + {file = "identify-2.6.2-py2.py3-none-any.whl", hash = "sha256:c097384259f49e372f4ea00a19719d95ae27dd5ff0fd77ad630aa891306b82f3"}, + {file = "identify-2.6.2.tar.gz", hash = "sha256:fab5c716c24d7a789775228823797296a2994b075fb6080ac83a102772a98cbd"}, ] [package.extras] @@ -1288,13 +1288,13 @@ attrs = ">=19.2.0" [[package]] name = "packaging" -version = "24.1" +version = "24.2" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, - {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, + {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, + {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, ] [[package]] @@ -1350,8 +1350,8 @@ files = [ [package.dependencies] numpy = [ - {version = ">=1.23.2", markers = "python_version == \"3.11\""}, {version = ">=1.26.0", markers = "python_version >= \"3.12\""}, + {version = ">=1.23.2", markers = "python_version == \"3.11\""}, {version = ">=1.22.4", markers = "python_version < \"3.11\""}, ] python-dateutil = ">=2.8.2" @@ -1669,8 +1669,8 @@ files = [ annotated-types = ">=0.6.0" pydantic-core = "2.23.4" typing-extensions = [ - {version = ">=4.6.1", markers = "python_version < \"3.13\""}, {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, + {version = ">=4.6.1", markers = "python_version < \"3.13\""}, ] [package.extras] @@ -2198,13 +2198,13 @@ reflex = ">=0.6.0a" [[package]] name = "reflex-hosting-cli" -version = "0.1.15" +version = "0.1.16" description = "Reflex Hosting CLI" optional = false python-versions = "<4.0,>=3.8" files = [ - {file = "reflex_hosting_cli-0.1.15-py3-none-any.whl", hash = "sha256:c471f5570b8797e290844edcc079241aa27457112c01188dc0f8a5ccc2364003"}, - {file = "reflex_hosting_cli-0.1.15.tar.gz", hash = "sha256:42a2a030b8bfba728cbd2c5cc37df0fcc8c2966efc649c57806c6616efb994c4"}, + {file = "reflex_hosting_cli-0.1.16-py3-none-any.whl", hash = "sha256:1b12c2a76a27571102cacf5ec3028fb09816a51568bff793735e66aaad886605"}, + {file = "reflex_hosting_cli-0.1.16.tar.gz", hash = "sha256:9c9826318fd3d388b706be70f1f500a35e355f8f86f54138e7789fd6096a4ab9"}, ] [package.dependencies] @@ -2350,23 +2350,23 @@ websocket-client = ">=1.8,<2.0" [[package]] name = "setuptools" -version = "75.3.0" +version = "75.5.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "setuptools-75.3.0-py3-none-any.whl", hash = "sha256:f2504966861356aa38616760c0f66568e535562374995367b4e69c7143cf6bcd"}, - {file = "setuptools-75.3.0.tar.gz", hash = "sha256:fba5dd4d766e97be1b1681d98712680ae8f2f26d7881245f2ce9e40714f1a686"}, + {file = "setuptools-75.5.0-py3-none-any.whl", hash = "sha256:87cb777c3b96d638ca02031192d40390e0ad97737e27b6b4fa831bea86f2f829"}, + {file = "setuptools-75.5.0.tar.gz", hash = "sha256:5c4ccb41111392671f02bb5f8436dfc5a9a7185e80500531b133f5775c4163ef"}, ] [package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.5.2)"] -core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.collections", "jaraco.functools", "jaraco.text (>=3.7)", "more-itertools", "more-itertools (>=8.8)", "packaging", "packaging (>=24)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.7.0)"] +core = ["importlib-metadata (>=6)", "jaraco.collections", "jaraco.functools (>=4)", "jaraco.text (>=3.7)", "more-itertools", "more-itertools (>=8.8)", "packaging", "packaging (>=24.2)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"] enabler = ["pytest-enabler (>=2.2)"] -test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test (>=5.5)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] -type = ["importlib-metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.12.*)", "pytest-mypy"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test (>=5.5)", "packaging (>=24.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] +type = ["importlib-metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (>=1.12,<1.14)", "pytest-mypy"] [[package]] name = "shellingham" @@ -2542,13 +2542,13 @@ SQLAlchemy = ">=2.0.14,<2.1.0" [[package]] name = "starlette" -version = "0.41.2" +version = "0.41.3" description = "The little ASGI library that shines." optional = false python-versions = ">=3.8" files = [ - {file = "starlette-0.41.2-py3-none-any.whl", hash = "sha256:fbc189474b4731cf30fcef52f18a8d070e3f3b46c6a04c97579e85e6ffca942d"}, - {file = "starlette-0.41.2.tar.gz", hash = "sha256:9834fd799d1a87fd346deb76158668cfa0b0d56f85caefe8268e2d97c3468b62"}, + {file = "starlette-0.41.3-py3-none-any.whl", hash = "sha256:44cedb2b7c77a9de33a8b74b2b90e9f50d11fcf25d8270ea525ad71a25374ff7"}, + {file = "starlette-0.41.3.tar.gz", hash = "sha256:0e4ab3d16522a255be6b28260b938eae2482f98ce5cc934cb08dce8dc3ba5835"}, ] [package.dependencies] @@ -2634,13 +2634,13 @@ files = [ [[package]] name = "tomli" -version = "2.0.2" +version = "2.1.0" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" files = [ - {file = "tomli-2.0.2-py3-none-any.whl", hash = "sha256:2ebe24485c53d303f690b0ec092806a085f07af5a5aa1464f3931eec36caaa38"}, - {file = "tomli-2.0.2.tar.gz", hash = "sha256:d46d457a85337051c36524bc5349dd91b1877838e2979ac5ced3e710ed8a60ed"}, + {file = "tomli-2.1.0-py3-none-any.whl", hash = "sha256:a5c57c3d1c56f5ccdf89f6523458f60ef716e210fc47c4cfb188c5ba473e0391"}, + {file = "tomli-2.1.0.tar.gz", hash = "sha256:3f646cae2aec94e17d04973e4249548320197cfabdf130015d023de4b74d8ab8"}, ] [[package]] @@ -2714,13 +2714,13 @@ urllib3 = ">=1.26.0" [[package]] name = "typer" -version = "0.13.0" +version = "0.13.1" description = "Typer, build great CLIs. Easy to code. Based on Python type hints." optional = false python-versions = ">=3.7" files = [ - {file = "typer-0.13.0-py3-none-any.whl", hash = "sha256:d85fe0b777b2517cc99c8055ed735452f2659cd45e451507c76f48ce5c1d00e2"}, - {file = "typer-0.13.0.tar.gz", hash = "sha256:f1c7198347939361eec90139ffa0fd8b3df3a2259d5852a0f7400e476d95985c"}, + {file = "typer-0.13.1-py3-none-any.whl", hash = "sha256:5b59580fd925e89463a29d363e0a43245ec02765bde9fb77d39e5d0f29dd7157"}, + {file = "typer-0.13.1.tar.gz", hash = "sha256:9d444cb96cc268ce6f8b94e13b4335084cef4c079998a9f4851a90229a3bd25c"}, ] [package.dependencies] @@ -2828,108 +2828,91 @@ test = ["websockets"] [[package]] name = "websockets" -version = "13.1" +version = "14.1" description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "websockets-13.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f48c749857f8fb598fb890a75f540e3221d0976ed0bf879cf3c7eef34151acee"}, - {file = "websockets-13.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c7e72ce6bda6fb9409cc1e8164dd41d7c91466fb599eb047cfda72fe758a34a7"}, - {file = "websockets-13.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f779498eeec470295a2b1a5d97aa1bc9814ecd25e1eb637bd9d1c73a327387f6"}, - {file = "websockets-13.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4676df3fe46956fbb0437d8800cd5f2b6d41143b6e7e842e60554398432cf29b"}, - {file = "websockets-13.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a7affedeb43a70351bb811dadf49493c9cfd1ed94c9c70095fd177e9cc1541fa"}, - {file = "websockets-13.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1971e62d2caa443e57588e1d82d15f663b29ff9dfe7446d9964a4b6f12c1e700"}, - {file = "websockets-13.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5f2e75431f8dc4a47f31565a6e1355fb4f2ecaa99d6b89737527ea917066e26c"}, - {file = "websockets-13.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:58cf7e75dbf7e566088b07e36ea2e3e2bd5676e22216e4cad108d4df4a7402a0"}, - {file = "websockets-13.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c90d6dec6be2c7d03378a574de87af9b1efea77d0c52a8301dd831ece938452f"}, - {file = "websockets-13.1-cp310-cp310-win32.whl", hash = "sha256:730f42125ccb14602f455155084f978bd9e8e57e89b569b4d7f0f0c17a448ffe"}, - {file = "websockets-13.1-cp310-cp310-win_amd64.whl", hash = "sha256:5993260f483d05a9737073be197371940c01b257cc45ae3f1d5d7adb371b266a"}, - {file = "websockets-13.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:61fc0dfcda609cda0fc9fe7977694c0c59cf9d749fbb17f4e9483929e3c48a19"}, - {file = "websockets-13.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ceec59f59d092c5007e815def4ebb80c2de330e9588e101cf8bd94c143ec78a5"}, - {file = "websockets-13.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c1dca61c6db1166c48b95198c0b7d9c990b30c756fc2923cc66f68d17dc558fd"}, - {file = "websockets-13.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:308e20f22c2c77f3f39caca508e765f8725020b84aa963474e18c59accbf4c02"}, - {file = "websockets-13.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:62d516c325e6540e8a57b94abefc3459d7dab8ce52ac75c96cad5549e187e3a7"}, - {file = "websockets-13.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87c6e35319b46b99e168eb98472d6c7d8634ee37750d7693656dc766395df096"}, - {file = "websockets-13.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5f9fee94ebafbc3117c30be1844ed01a3b177bb6e39088bc6b2fa1dc15572084"}, - {file = "websockets-13.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:7c1e90228c2f5cdde263253fa5db63e6653f1c00e7ec64108065a0b9713fa1b3"}, - {file = "websockets-13.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:6548f29b0e401eea2b967b2fdc1c7c7b5ebb3eeb470ed23a54cd45ef078a0db9"}, - {file = "websockets-13.1-cp311-cp311-win32.whl", hash = "sha256:c11d4d16e133f6df8916cc5b7e3e96ee4c44c936717d684a94f48f82edb7c92f"}, - {file = "websockets-13.1-cp311-cp311-win_amd64.whl", hash = "sha256:d04f13a1d75cb2b8382bdc16ae6fa58c97337253826dfe136195b7f89f661557"}, - {file = "websockets-13.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:9d75baf00138f80b48f1eac72ad1535aac0b6461265a0bcad391fc5aba875cfc"}, - {file = "websockets-13.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:9b6f347deb3dcfbfde1c20baa21c2ac0751afaa73e64e5b693bb2b848efeaa49"}, - {file = "websockets-13.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:de58647e3f9c42f13f90ac7e5f58900c80a39019848c5547bc691693098ae1bd"}, - {file = "websockets-13.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1b54689e38d1279a51d11e3467dd2f3a50f5f2e879012ce8f2d6943f00e83f0"}, - {file = "websockets-13.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf1781ef73c073e6b0f90af841aaf98501f975d306bbf6221683dd594ccc52b6"}, - {file = "websockets-13.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d23b88b9388ed85c6faf0e74d8dec4f4d3baf3ecf20a65a47b836d56260d4b9"}, - {file = "websockets-13.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3c78383585f47ccb0fcf186dcb8a43f5438bd7d8f47d69e0b56f71bf431a0a68"}, - {file = "websockets-13.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:d6d300f8ec35c24025ceb9b9019ae9040c1ab2f01cddc2bcc0b518af31c75c14"}, - {file = "websockets-13.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a9dcaf8b0cc72a392760bb8755922c03e17a5a54e08cca58e8b74f6902b433cf"}, - {file = "websockets-13.1-cp312-cp312-win32.whl", hash = "sha256:2f85cf4f2a1ba8f602298a853cec8526c2ca42a9a4b947ec236eaedb8f2dc80c"}, - {file = "websockets-13.1-cp312-cp312-win_amd64.whl", hash = "sha256:38377f8b0cdeee97c552d20cf1865695fcd56aba155ad1b4ca8779a5b6ef4ac3"}, - {file = "websockets-13.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a9ab1e71d3d2e54a0aa646ab6d4eebfaa5f416fe78dfe4da2839525dc5d765c6"}, - {file = "websockets-13.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:b9d7439d7fab4dce00570bb906875734df13d9faa4b48e261c440a5fec6d9708"}, - {file = "websockets-13.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:327b74e915cf13c5931334c61e1a41040e365d380f812513a255aa804b183418"}, - {file = "websockets-13.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:325b1ccdbf5e5725fdcb1b0e9ad4d2545056479d0eee392c291c1bf76206435a"}, - {file = "websockets-13.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:346bee67a65f189e0e33f520f253d5147ab76ae42493804319b5716e46dddf0f"}, - {file = "websockets-13.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:91a0fa841646320ec0d3accdff5b757b06e2e5c86ba32af2e0815c96c7a603c5"}, - {file = "websockets-13.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:18503d2c5f3943e93819238bf20df71982d193f73dcecd26c94514f417f6b135"}, - {file = "websockets-13.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:a9cd1af7e18e5221d2878378fbc287a14cd527fdd5939ed56a18df8a31136bb2"}, - {file = "websockets-13.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:70c5be9f416aa72aab7a2a76c90ae0a4fe2755c1816c153c1a2bcc3333ce4ce6"}, - {file = "websockets-13.1-cp313-cp313-win32.whl", hash = "sha256:624459daabeb310d3815b276c1adef475b3e6804abaf2d9d2c061c319f7f187d"}, - {file = "websockets-13.1-cp313-cp313-win_amd64.whl", hash = "sha256:c518e84bb59c2baae725accd355c8dc517b4a3ed8db88b4bc93c78dae2974bf2"}, - {file = "websockets-13.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:c7934fd0e920e70468e676fe7f1b7261c1efa0d6c037c6722278ca0228ad9d0d"}, - {file = "websockets-13.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:149e622dc48c10ccc3d2760e5f36753db9cacf3ad7bc7bbbfd7d9c819e286f23"}, - {file = "websockets-13.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a569eb1b05d72f9bce2ebd28a1ce2054311b66677fcd46cf36204ad23acead8c"}, - {file = "websockets-13.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:95df24ca1e1bd93bbca51d94dd049a984609687cb2fb08a7f2c56ac84e9816ea"}, - {file = "websockets-13.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d8dbb1bf0c0a4ae8b40bdc9be7f644e2f3fb4e8a9aca7145bfa510d4a374eeb7"}, - {file = "websockets-13.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:035233b7531fb92a76beefcbf479504db8c72eb3bff41da55aecce3a0f729e54"}, - {file = "websockets-13.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:e4450fc83a3df53dec45922b576e91e94f5578d06436871dce3a6be38e40f5db"}, - {file = "websockets-13.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:463e1c6ec853202dd3657f156123d6b4dad0c546ea2e2e38be2b3f7c5b8e7295"}, - {file = "websockets-13.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:6d6855bbe70119872c05107e38fbc7f96b1d8cb047d95c2c50869a46c65a8e96"}, - {file = "websockets-13.1-cp38-cp38-win32.whl", hash = "sha256:204e5107f43095012b00f1451374693267adbb832d29966a01ecc4ce1db26faf"}, - {file = "websockets-13.1-cp38-cp38-win_amd64.whl", hash = "sha256:485307243237328c022bc908b90e4457d0daa8b5cf4b3723fd3c4a8012fce4c6"}, - {file = "websockets-13.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:9b37c184f8b976f0c0a231a5f3d6efe10807d41ccbe4488df8c74174805eea7d"}, - {file = "websockets-13.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:163e7277e1a0bd9fb3c8842a71661ad19c6aa7bb3d6678dc7f89b17fbcc4aeb7"}, - {file = "websockets-13.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4b889dbd1342820cc210ba44307cf75ae5f2f96226c0038094455a96e64fb07a"}, - {file = "websockets-13.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:586a356928692c1fed0eca68b4d1c2cbbd1ca2acf2ac7e7ebd3b9052582deefa"}, - {file = "websockets-13.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7bd6abf1e070a6b72bfeb71049d6ad286852e285f146682bf30d0296f5fbadfa"}, - {file = "websockets-13.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d2aad13a200e5934f5a6767492fb07151e1de1d6079c003ab31e1823733ae79"}, - {file = "websockets-13.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:df01aea34b6e9e33572c35cd16bae5a47785e7d5c8cb2b54b2acdb9678315a17"}, - {file = "websockets-13.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e54affdeb21026329fb0744ad187cf812f7d3c2aa702a5edb562b325191fcab6"}, - {file = "websockets-13.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:9ef8aa8bdbac47f4968a5d66462a2a0935d044bf35c0e5a8af152d58516dbeb5"}, - {file = "websockets-13.1-cp39-cp39-win32.whl", hash = "sha256:deeb929efe52bed518f6eb2ddc00cc496366a14c726005726ad62c2dd9017a3c"}, - {file = "websockets-13.1-cp39-cp39-win_amd64.whl", hash = "sha256:7c65ffa900e7cc958cd088b9a9157a8141c991f8c53d11087e6fb7277a03f81d"}, - {file = "websockets-13.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:5dd6da9bec02735931fccec99d97c29f47cc61f644264eb995ad6c0c27667238"}, - {file = "websockets-13.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:2510c09d8e8df777177ee3d40cd35450dc169a81e747455cc4197e63f7e7bfe5"}, - {file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f1c3cf67185543730888b20682fb186fc8d0fa6f07ccc3ef4390831ab4b388d9"}, - {file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bcc03c8b72267e97b49149e4863d57c2d77f13fae12066622dc78fe322490fe6"}, - {file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:004280a140f220c812e65f36944a9ca92d766b6cc4560be652a0a3883a79ed8a"}, - {file = "websockets-13.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:e2620453c075abeb0daa949a292e19f56de518988e079c36478bacf9546ced23"}, - {file = "websockets-13.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9156c45750b37337f7b0b00e6248991a047be4aa44554c9886fe6bdd605aab3b"}, - {file = "websockets-13.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:80c421e07973a89fbdd93e6f2003c17d20b69010458d3a8e37fb47874bd67d51"}, - {file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82d0ba76371769d6a4e56f7e83bb8e81846d17a6190971e38b5de108bde9b0d7"}, - {file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e9875a0143f07d74dc5e1ded1c4581f0d9f7ab86c78994e2ed9e95050073c94d"}, - {file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a11e38ad8922c7961447f35c7b17bffa15de4d17c70abd07bfbe12d6faa3e027"}, - {file = "websockets-13.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:4059f790b6ae8768471cddb65d3c4fe4792b0ab48e154c9f0a04cefaabcd5978"}, - {file = "websockets-13.1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:25c35bf84bf7c7369d247f0b8cfa157f989862c49104c5cf85cb5436a641d93e"}, - {file = "websockets-13.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:83f91d8a9bb404b8c2c41a707ac7f7f75b9442a0a876df295de27251a856ad09"}, - {file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7a43cfdcddd07f4ca2b1afb459824dd3c6d53a51410636a2c7fc97b9a8cf4842"}, - {file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:48a2ef1381632a2f0cb4efeff34efa97901c9fbc118e01951ad7cfc10601a9bb"}, - {file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:459bf774c754c35dbb487360b12c5727adab887f1622b8aed5755880a21c4a20"}, - {file = "websockets-13.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:95858ca14a9f6fa8413d29e0a585b31b278388aa775b8a81fa24830123874678"}, - {file = "websockets-13.1-py3-none-any.whl", hash = "sha256:a9a396a6ad26130cdae92ae10c36af09d9bfe6cafe69670fd3b6da9b07b4044f"}, - {file = "websockets-13.1.tar.gz", hash = "sha256:a3b3366087c1bc0a2795111edcadddb8b3b59509d5db5d7ea3fdd69f954a8878"}, + {file = "websockets-14.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a0adf84bc2e7c86e8a202537b4fd50e6f7f0e4a6b6bf64d7ccb96c4cd3330b29"}, + {file = "websockets-14.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:90b5d9dfbb6d07a84ed3e696012610b6da074d97453bd01e0e30744b472c8179"}, + {file = "websockets-14.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2177ee3901075167f01c5e335a6685e71b162a54a89a56001f1c3e9e3d2ad250"}, + {file = "websockets-14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f14a96a0034a27f9d47fd9788913924c89612225878f8078bb9d55f859272b0"}, + {file = "websockets-14.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1f874ba705deea77bcf64a9da42c1f5fc2466d8f14daf410bc7d4ceae0a9fcb0"}, + {file = "websockets-14.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9607b9a442392e690a57909c362811184ea429585a71061cd5d3c2b98065c199"}, + {file = "websockets-14.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:bea45f19b7ca000380fbd4e02552be86343080120d074b87f25593ce1700ad58"}, + {file = "websockets-14.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:219c8187b3ceeadbf2afcf0f25a4918d02da7b944d703b97d12fb01510869078"}, + {file = "websockets-14.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:ad2ab2547761d79926effe63de21479dfaf29834c50f98c4bf5b5480b5838434"}, + {file = "websockets-14.1-cp310-cp310-win32.whl", hash = "sha256:1288369a6a84e81b90da5dbed48610cd7e5d60af62df9851ed1d1d23a9069f10"}, + {file = "websockets-14.1-cp310-cp310-win_amd64.whl", hash = "sha256:e0744623852f1497d825a49a99bfbec9bea4f3f946df6eb9d8a2f0c37a2fec2e"}, + {file = "websockets-14.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:449d77d636f8d9c17952628cc7e3b8faf6e92a17ec581ec0c0256300717e1512"}, + {file = "websockets-14.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a35f704be14768cea9790d921c2c1cc4fc52700410b1c10948511039be824aac"}, + {file = "websockets-14.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b1f3628a0510bd58968c0f60447e7a692933589b791a6b572fcef374053ca280"}, + {file = "websockets-14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c3deac3748ec73ef24fc7be0b68220d14d47d6647d2f85b2771cb35ea847aa1"}, + {file = "websockets-14.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7048eb4415d46368ef29d32133134c513f507fff7d953c18c91104738a68c3b3"}, + {file = "websockets-14.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f6cf0ad281c979306a6a34242b371e90e891bce504509fb6bb5246bbbf31e7b6"}, + {file = "websockets-14.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:cc1fc87428c1d18b643479caa7b15db7d544652e5bf610513d4a3478dbe823d0"}, + {file = "websockets-14.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:f95ba34d71e2fa0c5d225bde3b3bdb152e957150100e75c86bc7f3964c450d89"}, + {file = "websockets-14.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9481a6de29105d73cf4515f2bef8eb71e17ac184c19d0b9918a3701c6c9c4f23"}, + {file = "websockets-14.1-cp311-cp311-win32.whl", hash = "sha256:368a05465f49c5949e27afd6fbe0a77ce53082185bbb2ac096a3a8afaf4de52e"}, + {file = "websockets-14.1-cp311-cp311-win_amd64.whl", hash = "sha256:6d24fc337fc055c9e83414c94e1ee0dee902a486d19d2a7f0929e49d7d604b09"}, + {file = "websockets-14.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:ed907449fe5e021933e46a3e65d651f641975a768d0649fee59f10c2985529ed"}, + {file = "websockets-14.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:87e31011b5c14a33b29f17eb48932e63e1dcd3fa31d72209848652310d3d1f0d"}, + {file = "websockets-14.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bc6ccf7d54c02ae47a48ddf9414c54d48af9c01076a2e1023e3b486b6e72c707"}, + {file = "websockets-14.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9777564c0a72a1d457f0848977a1cbe15cfa75fa2f67ce267441e465717dcf1a"}, + {file = "websockets-14.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a655bde548ca98f55b43711b0ceefd2a88a71af6350b0c168aa77562104f3f45"}, + {file = "websockets-14.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a3dfff83ca578cada2d19e665e9c8368e1598d4e787422a460ec70e531dbdd58"}, + {file = "websockets-14.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6a6c9bcf7cdc0fd41cc7b7944447982e8acfd9f0d560ea6d6845428ed0562058"}, + {file = "websockets-14.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:4b6caec8576e760f2c7dd878ba817653144d5f369200b6ddf9771d64385b84d4"}, + {file = "websockets-14.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:eb6d38971c800ff02e4a6afd791bbe3b923a9a57ca9aeab7314c21c84bf9ff05"}, + {file = "websockets-14.1-cp312-cp312-win32.whl", hash = "sha256:1d045cbe1358d76b24d5e20e7b1878efe578d9897a25c24e6006eef788c0fdf0"}, + {file = "websockets-14.1-cp312-cp312-win_amd64.whl", hash = "sha256:90f4c7a069c733d95c308380aae314f2cb45bd8a904fb03eb36d1a4983a4993f"}, + {file = "websockets-14.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:3630b670d5057cd9e08b9c4dab6493670e8e762a24c2c94ef312783870736ab9"}, + {file = "websockets-14.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:36ebd71db3b89e1f7b1a5deaa341a654852c3518ea7a8ddfdf69cc66acc2db1b"}, + {file = "websockets-14.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5b918d288958dc3fa1c5a0b9aa3256cb2b2b84c54407f4813c45d52267600cd3"}, + {file = "websockets-14.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:00fe5da3f037041da1ee0cf8e308374e236883f9842c7c465aa65098b1c9af59"}, + {file = "websockets-14.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8149a0f5a72ca36720981418eeffeb5c2729ea55fa179091c81a0910a114a5d2"}, + {file = "websockets-14.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:77569d19a13015e840b81550922056acabc25e3f52782625bc6843cfa034e1da"}, + {file = "websockets-14.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:cf5201a04550136ef870aa60ad3d29d2a59e452a7f96b94193bee6d73b8ad9a9"}, + {file = "websockets-14.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:88cf9163ef674b5be5736a584c999e98daf3aabac6e536e43286eb74c126b9c7"}, + {file = "websockets-14.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:836bef7ae338a072e9d1863502026f01b14027250a4545672673057997d5c05a"}, + {file = "websockets-14.1-cp313-cp313-win32.whl", hash = "sha256:0d4290d559d68288da9f444089fd82490c8d2744309113fc26e2da6e48b65da6"}, + {file = "websockets-14.1-cp313-cp313-win_amd64.whl", hash = "sha256:8621a07991add373c3c5c2cf89e1d277e49dc82ed72c75e3afc74bd0acc446f0"}, + {file = "websockets-14.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:01bb2d4f0a6d04538d3c5dfd27c0643269656c28045a53439cbf1c004f90897a"}, + {file = "websockets-14.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:414ffe86f4d6f434a8c3b7913655a1a5383b617f9bf38720e7c0799fac3ab1c6"}, + {file = "websockets-14.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8fda642151d5affdee8a430bd85496f2e2517be3a2b9d2484d633d5712b15c56"}, + {file = "websockets-14.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cd7c11968bc3860d5c78577f0dbc535257ccec41750675d58d8dc66aa47fe52c"}, + {file = "websockets-14.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a032855dc7db987dff813583d04f4950d14326665d7e714d584560b140ae6b8b"}, + {file = "websockets-14.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b7e7ea2f782408c32d86b87a0d2c1fd8871b0399dd762364c731d86c86069a78"}, + {file = "websockets-14.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:39450e6215f7d9f6f7bc2a6da21d79374729f5d052333da4d5825af8a97e6735"}, + {file = "websockets-14.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:ceada5be22fa5a5a4cdeec74e761c2ee7db287208f54c718f2df4b7e200b8d4a"}, + {file = "websockets-14.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:3fc753451d471cff90b8f467a1fc0ae64031cf2d81b7b34e1811b7e2691bc4bc"}, + {file = "websockets-14.1-cp39-cp39-win32.whl", hash = "sha256:14839f54786987ccd9d03ed7f334baec0f02272e7ec4f6e9d427ff584aeea8b4"}, + {file = "websockets-14.1-cp39-cp39-win_amd64.whl", hash = "sha256:d9fd19ecc3a4d5ae82ddbfb30962cf6d874ff943e56e0c81f5169be2fda62979"}, + {file = "websockets-14.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:e5dc25a9dbd1a7f61eca4b7cb04e74ae4b963d658f9e4f9aad9cd00b688692c8"}, + {file = "websockets-14.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:04a97aca96ca2acedf0d1f332c861c5a4486fdcba7bcef35873820f940c4231e"}, + {file = "websockets-14.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df174ece723b228d3e8734a6f2a6febbd413ddec39b3dc592f5a4aa0aff28098"}, + {file = "websockets-14.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:034feb9f4286476f273b9a245fb15f02c34d9586a5bc936aff108c3ba1b21beb"}, + {file = "websockets-14.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:660c308dabd2b380807ab64b62985eaccf923a78ebc572bd485375b9ca2b7dc7"}, + {file = "websockets-14.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:5a42d3ecbb2db5080fc578314439b1d79eef71d323dc661aa616fb492436af5d"}, + {file = "websockets-14.1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:ddaa4a390af911da6f680be8be4ff5aaf31c4c834c1a9147bc21cbcbca2d4370"}, + {file = "websockets-14.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:a4c805c6034206143fbabd2d259ec5e757f8b29d0a2f0bf3d2fe5d1f60147a4a"}, + {file = "websockets-14.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:205f672a6c2c671a86d33f6d47c9b35781a998728d2c7c2a3e1cf3333fcb62b7"}, + {file = "websockets-14.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5ef440054124728cc49b01c33469de06755e5a7a4e83ef61934ad95fc327fbb0"}, + {file = "websockets-14.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e7591d6f440af7f73c4bd9404f3772bfee064e639d2b6cc8c94076e71b2471c1"}, + {file = "websockets-14.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:25225cc79cfebc95ba1d24cd3ab86aaa35bcd315d12fa4358939bd55e9bd74a5"}, + {file = "websockets-14.1-py3-none-any.whl", hash = "sha256:4d4fc827a20abe6d544a119896f6b78ee13fe81cbfef416f3f2ddf09a03f0e2e"}, + {file = "websockets-14.1.tar.gz", hash = "sha256:398b10c77d471c0aab20a845e7a60076b6390bfdaac7a6d2edb0d2c59d75e8d8"}, ] [[package]] name = "wheel" -version = "0.44.0" +version = "0.45.0" description = "A built-package format for Python" optional = false python-versions = ">=3.8" files = [ - {file = "wheel-0.44.0-py3-none-any.whl", hash = "sha256:2376a90c98cc337d18623527a97c31797bd02bad0033d41547043a1cbfbe448f"}, - {file = "wheel-0.44.0.tar.gz", hash = "sha256:a29c3f2817e95ab89aa4660681ad547c0e9547f20e75b0562fe7723c9a2a9d49"}, + {file = "wheel-0.45.0-py3-none-any.whl", hash = "sha256:52f0baa5e6522155090a09c6bd95718cc46956d1b51d537ea5454249edb671c7"}, + {file = "wheel-0.45.0.tar.gz", hash = "sha256:a57353941a3183b3d5365346b567a260a0602a0f8a635926a7dede41b94c674a"}, ] [package.extras] @@ -3030,13 +3013,13 @@ h11 = ">=0.9.0,<1" [[package]] name = "zipp" -version = "3.20.2" +version = "3.21.0" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "zipp-3.20.2-py3-none-any.whl", hash = "sha256:a817ac80d6cf4b23bf7f2828b7cabf326f15a001bea8b1f9b49631780ba28350"}, - {file = "zipp-3.20.2.tar.gz", hash = "sha256:bc9eb26f4506fda01b81bcde0ca78103b6e62f991b381fec825435c836edbc29"}, + {file = "zipp-3.21.0-py3-none-any.whl", hash = "sha256:ac1bbe05fd2991f160ebce24ffbac5f6d11d83dc90891255885223d42b3cd931"}, + {file = "zipp-3.21.0.tar.gz", hash = "sha256:2c9958f6430a2040341a52eb608ed6dd93ef4392e02ffe219417c1b28b5dd1f4"}, ] [package.extras] @@ -3050,4 +3033,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "8975c9e30cd8e1d1968f2344218ea4fa0548462edff4bee4046513882b7bad25" +content-hash = "600773827321e7a0fdb2fe7d6af650a039dff759ce6df9c51ca22f0d7df4c290" diff --git a/pyproject.toml b/pyproject.toml index f251b0ba8..b2b7b79d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ wrapt = [ {version = ">=1.11.0,<2.0", python = "<3.11"}, ] packaging = ">=23.1,<25.0" -reflex-hosting-cli = ">=0.1.15,<2.0" +reflex-hosting-cli = ">=0.1.16,<2.0" charset-normalizer = ">=3.3.2,<4.0" wheel = ">=0.42.0,<1.0" build = ">=1.0.3,<2.0" diff --git a/reflex/reflex.py b/reflex/reflex.py index a9a1e5455..3fedc2ef5 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -11,7 +11,7 @@ import typer import typer.core from reflex_cli.deployments import deployments_cli from reflex_cli.utils import dependency -from reflex_cli.v2.deployments import hosting_cli +from reflex_cli.v2.deployments import check_version, hosting_cli from reflex import constants from reflex.config import environment, get_config @@ -390,6 +390,8 @@ def loginv2(loglevel: constants.LogLevel = typer.Option(config.loglevel)): """Authenicate with experimental Reflex hosting service.""" from reflex_cli.v2 import cli as hosting_cli + check_version() + hosting_cli.login() @@ -418,6 +420,8 @@ def logoutv2( """Log out of access to Reflex hosting service.""" from reflex_cli.v2.utils import hosting + check_version() + console.set_log_level(loglevel) hosting.log_out_on_browser() @@ -637,7 +641,7 @@ def deployv2( list(), "-r", "--region", - help="The regions to deploy to. For multiple envs, repeat this option, e.g. --region sjc --region iad", + help="The regions to deploy to. `reflex apps regions` For multiple envs, repeat this option, e.g. --region sjc --region iad", ), envs: List[str] = typer.Option( list(), @@ -647,13 +651,12 @@ def deployv2( vmtype: Optional[str] = typer.Option( None, "--vmtype", - help="Vm type id. Run reflex apps vmtypes list to get options.", + help="Vm type id. Run `reflex apps vmtypes` to get options.", ), hostname: Optional[str] = typer.Option( None, "--hostname", help="The hostname of the frontend.", - hidden=True, ), interactive: bool = typer.Option( True, @@ -663,7 +666,6 @@ def deployv2( None, "--envfile", help="The path to an env file to use. Will override any envs set manually.", - hidden=True, ), loglevel: constants.LogLevel = typer.Option( config.loglevel, help="The log level to use." @@ -678,7 +680,6 @@ def deployv2( None, "--token", help="token to use for auth", - hidden=True, ), ): """Deploy the app to the Reflex hosting service.""" @@ -688,6 +689,8 @@ def deployv2( from reflex.utils import export as export_utils from reflex.utils import prerequisites + check_version() + # Set the log level. console.set_log_level(loglevel) From 22329e592edb48aa514a1081c5c59a4827b3d69d Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 18 Nov 2024 18:21:45 -0800 Subject: [PATCH 03/24] add debug statement to evaluate page (#4396) --- reflex/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/reflex/app.py b/reflex/app.py index a8a6e69c6..26b2cce20 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -854,6 +854,7 @@ class App(MiddlewareMixin, LifespanMixin): self.theme.appearance = None for route in self.unevaluated_pages: + console.debug(f"Evaluating page: {route}") self._compile_page(route) # Add the optional endpoints (_upload) From adaf49e4f9bd6c22b6816ca23938a2611b2c771a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Mon, 18 Nov 2024 18:22:01 -0800 Subject: [PATCH 04/24] make list suggestions work in rx.input (#4391) * make list suggestions work * fix pyi --- reflex/components/el/__init__.pyi | 2 ++ reflex/components/el/elements/__init__.py | 1 + reflex/components/el/elements/__init__.pyi | 3 +++ reflex/components/el/elements/forms.py | 1 + reflex/components/el/elements/forms.pyi | 1 + reflex/components/radix/themes/components/text_field.py | 3 +++ reflex/components/radix/themes/components/text_field.pyi | 4 ++++ 7 files changed, 15 insertions(+) diff --git a/reflex/components/el/__init__.pyi b/reflex/components/el/__init__.pyi index 4815bcd27..cbfb65f58 100644 --- a/reflex/components/el/__init__.pyi +++ b/reflex/components/el/__init__.pyi @@ -5,6 +5,7 @@ from . import elements as elements from .elements.forms import Button as Button +from .elements.forms import Datalist as Datalist from .elements.forms import Fieldset as Fieldset from .elements.forms import Form as Form from .elements.forms import Input as Input @@ -18,6 +19,7 @@ from .elements.forms import Progress as Progress from .elements.forms import Select as Select from .elements.forms import Textarea as Textarea from .elements.forms import button as button +from .elements.forms import datalist as datalist from .elements.forms import fieldset as fieldset from .elements.forms import form as form from .elements.forms import input as input diff --git a/reflex/components/el/elements/__init__.py b/reflex/components/el/elements/__init__.py index 17fdb77ca..45a7e04b8 100644 --- a/reflex/components/el/elements/__init__.py +++ b/reflex/components/el/elements/__init__.py @@ -7,6 +7,7 @@ from reflex.utils import lazy_loader _MAPPING = { "forms": [ "button", + "datalist", "fieldset", "form", "input", diff --git a/reflex/components/el/elements/__init__.pyi b/reflex/components/el/elements/__init__.pyi index b35e70dd2..c96a80987 100644 --- a/reflex/components/el/elements/__init__.pyi +++ b/reflex/components/el/elements/__init__.pyi @@ -4,6 +4,7 @@ # ------------------------------------------------------ from .forms import Button as Button +from .forms import Datalist as Datalist from .forms import Fieldset as Fieldset from .forms import Form as Form from .forms import Input as Input @@ -17,6 +18,7 @@ from .forms import Progress as Progress from .forms import Select as Select from .forms import Textarea as Textarea from .forms import button as button +from .forms import datalist as datalist from .forms import fieldset as fieldset from .forms import form as form from .forms import input as input @@ -226,6 +228,7 @@ from .typography import ul as ul _MAPPING = { "forms": [ "button", + "datalist", "fieldset", "form", "input", diff --git a/reflex/components/el/elements/forms.py b/reflex/components/el/elements/forms.py index a84718de1..7a94a9c2d 100644 --- a/reflex/components/el/elements/forms.py +++ b/reflex/components/el/elements/forms.py @@ -681,6 +681,7 @@ class Textarea(BaseHTML): button = Button.create +datalist = Datalist.create fieldset = Fieldset.create form = Form.create input = Input.create diff --git a/reflex/components/el/elements/forms.pyi b/reflex/components/el/elements/forms.pyi index f494d8076..a32eb8c5d 100644 --- a/reflex/components/el/elements/forms.pyi +++ b/reflex/components/el/elements/forms.pyi @@ -1490,6 +1490,7 @@ class Textarea(BaseHTML): ... button = Button.create +datalist = Datalist.create fieldset = Fieldset.create form = Form.create input = Input.create diff --git a/reflex/components/radix/themes/components/text_field.py b/reflex/components/radix/themes/components/text_field.py index d5d851839..3dabe0936 100644 --- a/reflex/components/radix/themes/components/text_field.py +++ b/reflex/components/radix/themes/components/text_field.py @@ -67,6 +67,9 @@ class TextFieldRoot(elements.Div, RadixThemesComponent): # Value of the input value: Var[Union[str, int, float]] + # References a datalist for suggested options + list: Var[Union[str, int, bool]] + # Fired when the value of the textarea changes. on_change: EventHandler[input_event] diff --git a/reflex/components/radix/themes/components/text_field.pyi b/reflex/components/radix/themes/components/text_field.pyi index 874ac07a0..edce803eb 100644 --- a/reflex/components/radix/themes/components/text_field.pyi +++ b/reflex/components/radix/themes/components/text_field.pyi @@ -119,6 +119,7 @@ class TextFieldRoot(elements.Div, RadixThemesComponent): required: Optional[Union[Var[bool], bool]] = None, type: Optional[Union[Var[str], str]] = None, value: Optional[Union[Var[Union[float, int, str]], float, int, str]] = None, + list: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ Union[Var[Union[bool, int, str]], bool, int, str] @@ -206,6 +207,7 @@ class TextFieldRoot(elements.Div, RadixThemesComponent): required: Indicates that the input is required type: Specifies the type of input value: Value of the input + list: References a datalist for suggested options on_change: Fired when the value of the textarea changes. on_focus: Fired when the textarea is focused. on_blur: Fired when the textarea is blurred. @@ -454,6 +456,7 @@ class TextField(ComponentNamespace): required: Optional[Union[Var[bool], bool]] = None, type: Optional[Union[Var[str], str]] = None, value: Optional[Union[Var[Union[float, int, str]], float, int, str]] = None, + list: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, auto_capitalize: Optional[ Union[Var[Union[bool, int, str]], bool, int, str] @@ -541,6 +544,7 @@ class TextField(ComponentNamespace): required: Indicates that the input is required type: Specifies the type of input value: Value of the input + list: References a datalist for suggested options on_change: Fired when the value of the textarea changes. on_focus: Fired when the textarea is focused. on_blur: Fired when the textarea is blurred. From af4fe4842881e8e596d8a8aec4ca8410622e123a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Mon, 18 Nov 2024 18:56:28 -0800 Subject: [PATCH 05/24] [maintenance] bump some packages versions (#4385) * bump some versions * update ruff to 0.7.4 * bump tailwind version * relock deps --------- Co-authored-by: Masen Furer --- .pre-commit-config.yaml | 2 +- poetry.lock | 44 +++++++++++++++++------------------ pyproject.toml | 2 +- reflex/constants/installer.py | 6 ++--- reflex/constants/style.py | 2 +- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 41372d4e2..4046bad2d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ fail_fast: true repos: - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.7.2 + rev: v0.7.4 hooks: - id: ruff-format args: [reflex, tests] diff --git a/poetry.lock b/poetry.lock index c19780931..8f0b61666 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1350,8 +1350,8 @@ files = [ [package.dependencies] numpy = [ - {version = ">=1.26.0", markers = "python_version >= \"3.12\""}, {version = ">=1.23.2", markers = "python_version == \"3.11\""}, + {version = ">=1.26.0", markers = "python_version >= \"3.12\""}, {version = ">=1.22.4", markers = "python_version < \"3.11\""}, ] python-dateutil = ">=2.8.2" @@ -1669,8 +1669,8 @@ files = [ annotated-types = ">=0.6.0" pydantic-core = "2.23.4" typing-extensions = [ - {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, {version = ">=4.6.1", markers = "python_version < \"3.13\""}, + {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, ] [package.extras] @@ -2289,29 +2289,29 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] [[package]] name = "ruff" -version = "0.7.2" +version = "0.7.4" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.7.2-py3-none-linux_armv6l.whl", hash = "sha256:b73f873b5f52092e63ed540adefc3c36f1f803790ecf2590e1df8bf0a9f72cb8"}, - {file = "ruff-0.7.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:5b813ef26db1015953daf476202585512afd6a6862a02cde63f3bafb53d0b2d4"}, - {file = "ruff-0.7.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:853277dbd9675810c6826dad7a428d52a11760744508340e66bf46f8be9701d9"}, - {file = "ruff-0.7.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:21aae53ab1490a52bf4e3bf520c10ce120987b047c494cacf4edad0ba0888da2"}, - {file = "ruff-0.7.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ccc7e0fc6e0cb3168443eeadb6445285abaae75142ee22b2b72c27d790ab60ba"}, - {file = "ruff-0.7.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fd77877a4e43b3a98e5ef4715ba3862105e299af0c48942cc6d51ba3d97dc859"}, - {file = "ruff-0.7.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:e00163fb897d35523c70d71a46fbaa43bf7bf9af0f4534c53ea5b96b2e03397b"}, - {file = "ruff-0.7.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f3c54b538633482dc342e9b634d91168fe8cc56b30a4b4f99287f4e339103e88"}, - {file = "ruff-0.7.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7b792468e9804a204be221b14257566669d1db5c00d6bb335996e5cd7004ba80"}, - {file = "ruff-0.7.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dba53ed84ac19ae4bfb4ea4bf0172550a2285fa27fbb13e3746f04c80f7fa088"}, - {file = "ruff-0.7.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b19fafe261bf741bca2764c14cbb4ee1819b67adb63ebc2db6401dcd652e3748"}, - {file = "ruff-0.7.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:28bd8220f4d8f79d590db9e2f6a0674f75ddbc3847277dd44ac1f8d30684b828"}, - {file = "ruff-0.7.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:9fd67094e77efbea932e62b5d2483006154794040abb3a5072e659096415ae1e"}, - {file = "ruff-0.7.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:576305393998b7bd6c46018f8104ea3a9cb3fa7908c21d8580e3274a3b04b691"}, - {file = "ruff-0.7.2-py3-none-win32.whl", hash = "sha256:fa993cfc9f0ff11187e82de874dfc3611df80852540331bc85c75809c93253a8"}, - {file = "ruff-0.7.2-py3-none-win_amd64.whl", hash = "sha256:dd8800cbe0254e06b8fec585e97554047fb82c894973f7ff18558eee33d1cb88"}, - {file = "ruff-0.7.2-py3-none-win_arm64.whl", hash = "sha256:bb8368cd45bba3f57bb29cbb8d64b4a33f8415d0149d2655c5c8539452ce7760"}, - {file = "ruff-0.7.2.tar.gz", hash = "sha256:2b14e77293380e475b4e3a7a368e14549288ed2931fce259a6f99978669e844f"}, + {file = "ruff-0.7.4-py3-none-linux_armv6l.whl", hash = "sha256:a4919925e7684a3f18e18243cd6bea7cfb8e968a6eaa8437971f681b7ec51478"}, + {file = "ruff-0.7.4-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:cfb365c135b830778dda8c04fb7d4280ed0b984e1aec27f574445231e20d6c63"}, + {file = "ruff-0.7.4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:63a569b36bc66fbadec5beaa539dd81e0527cb258b94e29e0531ce41bacc1f20"}, + {file = "ruff-0.7.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d06218747d361d06fd2fdac734e7fa92df36df93035db3dc2ad7aa9852cb109"}, + {file = "ruff-0.7.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e0cea28d0944f74ebc33e9f934238f15c758841f9f5edd180b5315c203293452"}, + {file = "ruff-0.7.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:80094ecd4793c68b2571b128f91754d60f692d64bc0d7272ec9197fdd09bf9ea"}, + {file = "ruff-0.7.4-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:997512325c6620d1c4c2b15db49ef59543ef9cd0f4aa8065ec2ae5103cedc7e7"}, + {file = "ruff-0.7.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:00b4cf3a6b5fad6d1a66e7574d78956bbd09abfd6c8a997798f01f5da3d46a05"}, + {file = "ruff-0.7.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7dbdc7d8274e1422722933d1edddfdc65b4336abf0b16dfcb9dedd6e6a517d06"}, + {file = "ruff-0.7.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e92dfb5f00eaedb1501b2f906ccabfd67b2355bdf117fea9719fc99ac2145bc"}, + {file = "ruff-0.7.4-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:3bd726099f277d735dc38900b6a8d6cf070f80828877941983a57bca1cd92172"}, + {file = "ruff-0.7.4-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:2e32829c429dd081ee5ba39aef436603e5b22335c3d3fff013cd585806a6486a"}, + {file = "ruff-0.7.4-py3-none-musllinux_1_2_i686.whl", hash = "sha256:662a63b4971807623f6f90c1fb664613f67cc182dc4d991471c23c541fee62dd"}, + {file = "ruff-0.7.4-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:876f5e09eaae3eb76814c1d3b68879891d6fde4824c015d48e7a7da4cf066a3a"}, + {file = "ruff-0.7.4-py3-none-win32.whl", hash = "sha256:75c53f54904be42dd52a548728a5b572344b50d9b2873d13a3f8c5e3b91f5cac"}, + {file = "ruff-0.7.4-py3-none-win_amd64.whl", hash = "sha256:745775c7b39f914238ed1f1b0bebed0b9155a17cd8bc0b08d3c87e4703b990d6"}, + {file = "ruff-0.7.4-py3-none-win_arm64.whl", hash = "sha256:11bff065102c3ae9d3ea4dc9ecdfe5a5171349cdd0787c1fc64761212fc9cf1f"}, + {file = "ruff-0.7.4.tar.gz", hash = "sha256:cd12e35031f5af6b9b93715d8c4f40360070b2041f81273d0527683d5708fce2"}, ] [[package]] @@ -3033,4 +3033,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "600773827321e7a0fdb2fe7d6af650a039dff759ce6df9c51ca22f0d7df4c290" +content-hash = "a610d4c4bfd852f30e69ad2fbb288c2d9cbdf49e05b9d4936fe5e9b2a7cdefdb" diff --git a/pyproject.toml b/pyproject.toml index b2b7b79d3..2e271d719 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,7 +70,7 @@ dill = ">=0.3.8" toml = ">=0.10.2,<1.0" pytest-asyncio = ">=0.24.0" pytest-cov = ">=4.0.0,<7.0" -ruff = "0.7.2" +ruff = "0.7.4" pandas = ">=2.1.1,<3.0" pillow = ">=10.0.0,<12.0" plotly = ">=5.13.0,<6.0" diff --git a/reflex/constants/installer.py b/reflex/constants/installer.py index 04c563f92..0b45586dd 100644 --- a/reflex/constants/installer.py +++ b/reflex/constants/installer.py @@ -184,15 +184,15 @@ class PackageJson(SimpleNamespace): "json5": "2.2.3", "next": "14.2.16", "next-sitemap": "4.2.3", - "next-themes": "0.3.0", + "next-themes": "0.4.3", "react": "18.3.1", "react-dom": "18.3.1", "react-focus-lock": "2.13.2", "socket.io-client": "4.8.1", - "universal-cookie": "7.2.1", + "universal-cookie": "7.2.2", } DEV_DEPENDENCIES = { "autoprefixer": "10.4.20", - "postcss": "8.4.47", + "postcss": "8.4.49", "postcss-import": "16.1.0", } diff --git a/reflex/constants/style.py b/reflex/constants/style.py index 403acd4ba..a1d30bcca 100644 --- a/reflex/constants/style.py +++ b/reflex/constants/style.py @@ -7,7 +7,7 @@ class Tailwind(SimpleNamespace): """Tailwind constants.""" # The Tailwindcss version - VERSION = "tailwindcss@3.4.14" + VERSION = "tailwindcss@3.4.15" # The Tailwind config. CONFIG = "tailwind.config.js" # Default Tailwind content paths From 1f9a17539cc21e652cac783c9d9a34be320240b4 Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Tue, 19 Nov 2024 04:15:01 +0100 Subject: [PATCH 06/24] fix: do not allow instantiation of State mixins (#4347) * fix: do not allow instantiation of State mixins Closes #4343 * improve error message for ComponentState mixins * fix typo Co-authored-by: Masen Furer --------- Co-authored-by: Masen Furer --- reflex/state.py | 22 +++++++++++++++++++ .../units/components/test_component_state.py | 21 ++++++++++++++++++ tests/units/test_state.py | 18 ++++++++++++++- 3 files changed, 60 insertions(+), 1 deletion(-) diff --git a/reflex/state.py b/reflex/state.py index 719ff43b3..9ff6f0ea8 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -87,6 +87,7 @@ from reflex.utils.exceptions import ( ImmutableStateError, InvalidStateManagerMode, LockExpiredError, + ReflexRuntimeError, SetUndefinedStateVarError, StateSchemaMismatchError, ) @@ -387,6 +388,10 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): "State classes should not be instantiated directly in a Reflex app. " "See https://reflex.dev/docs/state/ for further information." ) + if type(self)._mixin: + raise ReflexRuntimeError( + f"{type(self).__name__} is a state mixin and cannot be instantiated directly." + ) kwargs["parent_state"] = parent_state super().__init__() for name, value in kwargs.items(): @@ -2367,6 +2372,23 @@ class ComponentState(State, mixin=True): # The number of components created from this class. _per_component_state_instance_count: ClassVar[int] = 0 + def __init__(self, *args, **kwargs): + """Do not allow direct initialization of the ComponentState. + + Args: + *args: The args to pass to the State init method. + **kwargs: The kwargs to pass to the State init method. + + Raises: + ReflexRuntimeError: If the ComponentState is initialized directly. + """ + if type(self)._mixin: + raise ReflexRuntimeError( + f"{ComponentState.__name__} {type(self).__name__} is not meant to be initialized directly. " + + "Use the `create` method to create a new instance and access the state via the `State` attribute." + ) + super().__init__(*args, **kwargs) + @classmethod def __init_subclass__(cls, mixin: bool = True, **kwargs): """Overwrite mixin default to True. diff --git a/tests/units/components/test_component_state.py b/tests/units/components/test_component_state.py index 574997ba5..1b62e35c8 100644 --- a/tests/units/components/test_component_state.py +++ b/tests/units/components/test_component_state.py @@ -1,7 +1,10 @@ """Ensure that Components returned by ComponentState.create have independent State classes.""" +import pytest + import reflex as rx from reflex.components.base.bare import Bare +from reflex.utils.exceptions import ReflexRuntimeError def test_component_state(): @@ -40,3 +43,21 @@ def test_component_state(): assert len(cs2.children) == 1 assert cs2.children[0].render() == Bare.create("b").render() assert cs2.id == "b" + + +def test_init_component_state() -> None: + """Ensure that ComponentState subclasses cannot be instantiated directly.""" + + class CS(rx.ComponentState): + @classmethod + def get_component(cls, *children, **props): + return rx.el.div() + + with pytest.raises(ReflexRuntimeError): + CS() + + class SubCS(CS): + pass + + with pytest.raises(ReflexRuntimeError): + SubCS() diff --git a/tests/units/test_state.py b/tests/units/test_state.py index a69b9916a..7cebaff8e 100644 --- a/tests/units/test_state.py +++ b/tests/units/test_state.py @@ -43,7 +43,7 @@ from reflex.state import ( ) from reflex.testing import chdir from reflex.utils import format, prerequisites, types -from reflex.utils.exceptions import SetUndefinedStateVarError +from reflex.utils.exceptions import ReflexRuntimeError, SetUndefinedStateVarError from reflex.utils.format import json_dumps from reflex.vars.base import Var, computed_var from tests.units.states.mutation import MutableSQLAModel, MutableTestState @@ -3441,3 +3441,19 @@ def test_get_value(): "bar": "foo", } } + + +def test_init_mixin() -> None: + """Ensure that State mixins can not be instantiated directly.""" + + class Mixin(BaseState, mixin=True): + pass + + with pytest.raises(ReflexRuntimeError): + Mixin() + + class SubMixin(Mixin, mixin=True): + pass + + with pytest.raises(ReflexRuntimeError): + SubMixin() From bcea79cd45646ed3a589c5d5532e28465953fc41 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 18 Nov 2024 19:28:38 -0800 Subject: [PATCH 07/24] add typed dict type checking (#4340) * add typed dict type checking * technically it has to be a mapping, not specifically a dict --- reflex/components/component.py | 20 ++++++++++++-- reflex/utils/types.py | 49 +++++++++++++++++++++++++++++++++- 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/reflex/components/component.py b/reflex/components/component.py index 4b850ba7d..18dedbf0e 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -186,6 +186,23 @@ ComponentStyle = Dict[ ComponentChild = Union[types.PrimitiveType, Var, BaseComponent] +def satisfies_type_hint(obj: Any, type_hint: Any) -> bool: + """Check if an object satisfies a type hint. + + Args: + obj: The object to check. + type_hint: The type hint to check against. + + Returns: + Whether the object satisfies the type hint. + """ + if isinstance(obj, LiteralVar): + return types._isinstance(obj._var_value, type_hint) + if isinstance(obj, Var): + return types._issubclass(obj._var_type, type_hint) + return types._isinstance(obj, type_hint) + + class Component(BaseComponent, ABC): """A component with style, event trigger and other props.""" @@ -460,8 +477,7 @@ class Component(BaseComponent, ABC): ) ) or ( # Else just check if the passed var type is valid. - not passed_types - and not types._issubclass(passed_type, expected_type, value) + not passed_types and not satisfies_type_hint(value, expected_type) ): value_name = value._js_expr if isinstance(value, Var) else value diff --git a/reflex/utils/types.py b/reflex/utils/types.py index 27b6e7ce7..9361c1ce4 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -14,9 +14,11 @@ from typing import ( Callable, ClassVar, Dict, + FrozenSet, Iterable, List, Literal, + Mapping, Optional, Sequence, Tuple, @@ -29,6 +31,7 @@ from typing import ( from typing import get_origin as get_origin_og import sqlalchemy +from typing_extensions import is_typeddict import reflex from reflex.components.core.breakpoints import Breakpoints @@ -494,6 +497,14 @@ def _issubclass(cls: GenericType, cls_check: GenericType, instance: Any = None) if isinstance(instance, Breakpoints): return _breakpoints_satisfies_typing(cls_check, instance) + if isinstance(cls_check_base, tuple): + cls_check_base = tuple( + cls_check_one if not is_typeddict(cls_check_one) else dict + for cls_check_one in cls_check_base + ) + if is_typeddict(cls_check_base): + cls_check_base = dict + # Check if the types match. try: return cls_check_base == Any or issubclass(cls_base, cls_check_base) @@ -503,6 +514,36 @@ def _issubclass(cls: GenericType, cls_check: GenericType, instance: Any = None) raise TypeError(f"Invalid type for issubclass: {cls_base}") from te +def does_obj_satisfy_typed_dict(obj: Any, cls: GenericType) -> bool: + """Check if an object satisfies a typed dict. + + Args: + obj: The object to check. + cls: The typed dict to check against. + + Returns: + Whether the object satisfies the typed dict. + """ + if not isinstance(obj, Mapping): + return False + + key_names_to_values = get_type_hints(cls) + required_keys: FrozenSet[str] = getattr(cls, "__required_keys__", frozenset()) + + if not all( + isinstance(key, str) + and key in key_names_to_values + and _isinstance(value, key_names_to_values[key]) + for key, value in obj.items() + ): + return False + + # TODO in 3.14: Implement https://peps.python.org/pep-0728/ if it's approved + + # required keys are all present + return required_keys.issubset(required_keys) + + def _isinstance(obj: Any, cls: GenericType, nested: bool = False) -> bool: """Check if an object is an instance of a class. @@ -529,6 +570,12 @@ def _isinstance(obj: Any, cls: GenericType, nested: bool = False) -> bool: origin = get_origin(cls) if origin is None: + # cls is a typed dict + if is_typeddict(cls): + if nested: + return does_obj_satisfy_typed_dict(obj, cls) + return isinstance(obj, dict) + # cls is a simple class return isinstance(obj, cls) @@ -553,7 +600,7 @@ def _isinstance(obj: Any, cls: GenericType, nested: bool = False) -> bool: and len(obj) == len(args) and all(_isinstance(item, arg) for item, arg in zip(obj, args)) ) - if origin is dict: + if origin in (dict, Breakpoints): return isinstance(obj, dict) and all( _isinstance(key, args[0]) and _isinstance(value, args[1]) for key, value in obj.items() From bffff01acbc6e1c747cc561d4490846f6aaf1a79 Mon Sep 17 00:00:00 2001 From: Alek Petuskey Date: Tue, 19 Nov 2024 09:29:11 -0800 Subject: [PATCH 08/24] Add datetime to moment (#4381) * Add datetime to moment * Remove recharts update * Support other formats * simplify * Precommit * PYI * change imports for pyi compat --------- Co-authored-by: Alek Petuskey Co-authored-by: Masen Furer --- reflex/components/moment/moment.py | 7 ++++--- reflex/components/moment/moment.pyi | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/reflex/components/moment/moment.py b/reflex/components/moment/moment.py index d5d6d8f7c..80940d228 100644 --- a/reflex/components/moment/moment.py +++ b/reflex/components/moment/moment.py @@ -1,7 +1,8 @@ """Moment component for humanized date rendering.""" import dataclasses -from typing import List, Optional +from datetime import date, datetime, time, timedelta +from typing import List, Optional, Union from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, passthrough_event_spec @@ -19,7 +20,7 @@ class MomentDelta: weeks: Optional[int] = dataclasses.field(default=None) days: Optional[int] = dataclasses.field(default=None) hours: Optional[int] = dataclasses.field(default=None) - minutess: Optional[int] = dataclasses.field(default=None) + minutes: Optional[int] = dataclasses.field(default=None) seconds: Optional[int] = dataclasses.field(default=None) milliseconds: Optional[int] = dataclasses.field(default=None) @@ -78,7 +79,7 @@ class Moment(NoSSRComponent): duration: Var[str] # The date to display (also work if passed as children). - date: Var[str] + date: Var[Union[str, datetime, date, time, timedelta]] # Shows the duration (elapsed time) between now and the provided datetime. duration_from_now: Var[bool] diff --git a/reflex/components/moment/moment.pyi b/reflex/components/moment/moment.pyi index 57fbb3d0a..83ab670b0 100644 --- a/reflex/components/moment/moment.pyi +++ b/reflex/components/moment/moment.pyi @@ -4,6 +4,7 @@ # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ import dataclasses +from datetime import date, datetime, time, timedelta from typing import Any, Dict, Optional, Union, overload from reflex.components.component import NoSSRComponent @@ -20,7 +21,7 @@ class MomentDelta: weeks: Optional[int] days: Optional[int] hours: Optional[int] - minutess: Optional[int] + minutes: Optional[int] seconds: Optional[int] milliseconds: Optional[int] @@ -46,7 +47,16 @@ class Moment(NoSSRComponent): decimal: Optional[Union[Var[bool], bool]] = None, unit: Optional[Union[Var[str], str]] = None, duration: Optional[Union[Var[str], str]] = None, - date: Optional[Union[Var[str], str]] = None, + date: Optional[ + Union[ + Var[Union[date, datetime, str, time, timedelta]], + date, + datetime, + str, + time, + timedelta, + ] + ] = None, duration_from_now: Optional[Union[Var[bool], bool]] = None, unix: Optional[Union[Var[bool], bool]] = None, local: Optional[Union[Var[bool], bool]] = None, From 67296d43c094a977ac03e6b6436188ac6cca0f7f Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Tue, 19 Nov 2024 16:33:27 -0800 Subject: [PATCH 09/24] Don't skip serialization when Var is callable (#4399) --- reflex/utils/serializers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reflex/utils/serializers.py b/reflex/utils/serializers.py index b87909aec..b0ad935c8 100644 --- a/reflex/utils/serializers.py +++ b/reflex/utils/serializers.py @@ -263,7 +263,11 @@ def serialize_base(value: Base) -> dict: Returns: The serialized Base. """ - return {k: v for k, v in value.dict().items() if not callable(v)} + from reflex.vars.base import Var + + return { + k: v for k, v in value.dict().items() if isinstance(v, Var) or not callable(v) + } @serializer From 229df1ce09e391ac5b0c8c98260e76be2eb3c9e9 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Tue, 19 Nov 2024 16:46:55 -0800 Subject: [PATCH 10/24] ignore rxconfig not in cwd (#4398) * ignore rxconfig not in cwd * no type ignore * resolve paths * Remove rxconfig module from sys.modules cache when reloading * modify sys path * add try except * refactor inner function --------- Co-authored-by: Masen Furer --- reflex/config.py | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/reflex/config.py b/reflex/config.py index 049cc2e83..e86959e57 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -9,6 +9,7 @@ import inspect import os import sys import urllib.parse +from importlib.util import find_spec from pathlib import Path from typing import ( TYPE_CHECKING, @@ -798,6 +799,23 @@ class Config(Base): self._replace_defaults(**kwargs) +def _get_config() -> Config: + """Get the app config. + + Returns: + The app config. + """ + # only import the module if it exists. If a module spec exists then + # the module exists. + spec = find_spec(constants.Config.MODULE) + if not spec: + # we need this condition to ensure that a ModuleNotFound error is not thrown when + # running unit/integration tests or during `reflex init`. + return Config(app_name="") + rxconfig = importlib.import_module(constants.Config.MODULE) + return rxconfig.config + + def get_config(reload: bool = False) -> Config: """Get the app config. @@ -807,15 +825,21 @@ def get_config(reload: bool = False) -> Config: Returns: The app config. """ - sys.path.insert(0, os.getcwd()) - # only import the module if it exists. If a module spec exists then - # the module exists. - spec = importlib.util.find_spec(constants.Config.MODULE) # type: ignore - if not spec: - # we need this condition to ensure that a ModuleNotFound error is not thrown when - # running unit/integration tests. - return Config(app_name="") - rxconfig = importlib.import_module(constants.Config.MODULE) - if reload: - importlib.reload(rxconfig) - return rxconfig.config + # Remove any cached module when `reload` is requested. + if reload and constants.Config.MODULE in sys.modules: + del sys.modules[constants.Config.MODULE] + + sys_path = sys.path.copy() + sys.path.clear() + sys.path.append(os.getcwd()) + try: + # Try to import the module with only the current directory in the path. + return _get_config() + except Exception: + # If the module import fails, try to import with the original sys.path. + sys.path.extend(sys_path) + return _get_config() + finally: + # Restore the original sys.path. + sys.path.clear() + sys.path.extend(sys_path) From 681b61600025c67e1438c2252917ff078ff0db2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Wed, 20 Nov 2024 11:12:52 -0800 Subject: [PATCH 11/24] fix appearance broken by #3812 (#4403) * fix appearance broken by #3812 * fix again to pass tests --- reflex/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reflex/app.py b/reflex/app.py index 26b2cce20..afc40e3b8 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -850,8 +850,6 @@ class App(MiddlewareMixin, LifespanMixin): if self.theme is not None: # If a theme component was provided, wrap the app with it app_wrappers[(20, "Theme")] = self.theme - # Fix #2992 by removing the top-level appearance prop - self.theme.appearance = None for route in self.unevaluated_pages: console.debug(f"Evaluating page: {route}") @@ -1007,6 +1005,9 @@ class App(MiddlewareMixin, LifespanMixin): compile_results.append( compiler.compile_contexts(self.state, self.theme), ) + if self.theme is not None: + # Fix #2992 by removing the top-level appearance prop + self.theme.appearance = None progress.advance(task) # Compile the app root. From 4571524e1c4556c8be8963ddeebae269f817a3d9 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 21 Nov 2024 04:11:34 -0800 Subject: [PATCH 12/24] [ENG-4130] Disable typer/rich integration appropriately (#4412) The `rich` module should be set to `None`, indicating that rich should not be used. Setting it to `False` worked before, but recently added code in typer fails when checking `if rich is not None`. ref: https://github.com/fastapi/typer/pull/847 --- reflex/reflex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/reflex.py b/reflex/reflex.py index 3fedc2ef5..8c26e0470 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -20,7 +20,7 @@ from reflex.state import reset_disk_state_manager from reflex.utils import console, redir, telemetry # Disable typer+rich integration for help panels -typer.core.rich = False # type: ignore +typer.core.rich = None # type: ignore # Create the app. try: From 81583d45cafe80757bcd07be0d26ada6d928009a Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 21 Nov 2024 10:27:44 -0800 Subject: [PATCH 13/24] [HOS-313] state.js: when a routing error occurs, delete it (#4410) In some cases, a routing failure can cause the failure to be cached. When the router has a cached failure, pushing such a route will never call routeChangeComplete, and thus on_load event will never be fired for that route. Purposely clearing the error from the router allows the page to properly load on subsequent attempts without refreshing the app. --- reflex/.templates/web/utils/state.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/reflex/.templates/web/utils/state.js b/reflex/.templates/web/utils/state.js index 3899ddc89..72733777e 100644 --- a/reflex/.templates/web/utils/state.js +++ b/reflex/.templates/web/utils/state.js @@ -762,7 +762,7 @@ export const useEventLoop = ( window.onunhandledrejection = function (event) { addEvents([ Event(`${exception_state_name}.handle_frontend_exception`, { - stack: event.reason.stack, + stack: event.reason?.stack, component_stack: "", }), ]); @@ -837,11 +837,20 @@ export const useEventLoop = ( } }; const change_complete = () => addEvents(onLoadInternalEvent()); + const change_error = () => { + // Remove cached error state from router for this page, otherwise the + // page will never send on_load events again. + if (router.components[router.pathname].error) { + delete router.components[router.pathname].error; + } + } router.events.on("routeChangeStart", change_start); router.events.on("routeChangeComplete", change_complete); + router.events.on("routeChangeError", change_error); return () => { router.events.off("routeChangeStart", change_start); router.events.off("routeChangeComplete", change_complete); + router.events.off("routeChangeError", change_error); }; }, [router]); From 05956c84a7bea98d1d54e4584924cfaf432e9f55 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 21 Nov 2024 10:29:40 -0800 Subject: [PATCH 14/24] protect sys.path manipulation with a mutex (#4408) Compiling pages in separate threads can result in `sys.path` being cleared, which breaks subsequent imports. --- reflex/config.py | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/reflex/config.py b/reflex/config.py index e86959e57..962d6fec9 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -8,6 +8,7 @@ import importlib import inspect import os import sys +import threading import urllib.parse from importlib.util import find_spec from pathlib import Path @@ -816,6 +817,10 @@ def _get_config() -> Config: return rxconfig.config +# Protect sys.path from concurrent modification +_config_lock = threading.RLock() + + def get_config(reload: bool = False) -> Config: """Get the app config. @@ -825,21 +830,26 @@ def get_config(reload: bool = False) -> Config: Returns: The app config. """ - # Remove any cached module when `reload` is requested. - if reload and constants.Config.MODULE in sys.modules: - del sys.modules[constants.Config.MODULE] + cached_rxconfig = sys.modules.get(constants.Config.MODULE, None) + if cached_rxconfig is not None: + if reload: + # Remove any cached module when `reload` is requested. + del sys.modules[constants.Config.MODULE] + else: + return cached_rxconfig.config - sys_path = sys.path.copy() - sys.path.clear() - sys.path.append(os.getcwd()) - try: - # Try to import the module with only the current directory in the path. - return _get_config() - except Exception: - # If the module import fails, try to import with the original sys.path. - sys.path.extend(sys_path) - return _get_config() - finally: - # Restore the original sys.path. + with _config_lock: + sys_path = sys.path.copy() sys.path.clear() - sys.path.extend(sys_path) + sys.path.append(os.getcwd()) + try: + # Try to import the module with only the current directory in the path. + return _get_config() + except Exception: + # If the module import fails, try to import with the original sys.path. + sys.path.extend(sys_path) + return _get_config() + finally: + # Restore the original sys.path. + sys.path.clear() + sys.path.extend(sys_path) From 095c1e5b7f965e44425eccd7772102c0f17e50e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Thu, 21 Nov 2024 11:05:02 -0800 Subject: [PATCH 15/24] remove deprecation for these events (#4415) --- reflex/components/radix/primitives/drawer.py | 28 ++++---------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/reflex/components/radix/primitives/drawer.py b/reflex/components/radix/primitives/drawer.py index f99342a58..ed57dcbd8 100644 --- a/reflex/components/radix/primitives/drawer.py +++ b/reflex/components/radix/primitives/drawer.py @@ -11,7 +11,6 @@ from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import Theme from reflex.components.radix.themes.layout.flex import Flex from reflex.event import EventHandler, no_args_event_spec, passthrough_event_spec -from reflex.utils import console from reflex.vars.base import Var @@ -140,19 +139,19 @@ class DrawerContent(DrawerComponent): base_style.update(style) return {"css": base_style} - # Fired when the drawer content is opened. Deprecated. + # Fired when the drawer content is opened. on_open_auto_focus: EventHandler[no_args_event_spec] - # Fired when the drawer content is closed. Deprecated. + # Fired when the drawer content is closed. on_close_auto_focus: EventHandler[no_args_event_spec] - # Fired when the escape key is pressed. Deprecated. + # Fired when the escape key is pressed. on_escape_key_down: EventHandler[no_args_event_spec] - # Fired when the pointer is down outside the drawer content. Deprecated. + # Fired when the pointer is down outside the drawer content. on_pointer_down_outside: EventHandler[no_args_event_spec] - # Fired when interacting outside the drawer content. Deprecated. + # Fired when interacting outside the drawer content. on_interact_outside: EventHandler[no_args_event_spec] @classmethod @@ -170,23 +169,6 @@ class DrawerContent(DrawerComponent): Returns: The drawer content. """ - deprecated_properties = [ - "on_open_auto_focus", - "on_close_auto_focus", - "on_escape_key_down", - "on_pointer_down_outside", - "on_interact_outside", - ] - - for prop in deprecated_properties: - if prop in props: - console.deprecate( - feature_name="drawer content events", - reason=f"The `{prop}` event is deprecated and will be removed in 0.7.0.", - deprecation_version="0.6.3", - removal_version="0.7.0", - ) - comp = super().create(*children, **props) return Theme.create(comp) From ecb52651c3a134056bac5a59be1078685ec99d7d Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Thu, 21 Nov 2024 20:06:47 +0100 Subject: [PATCH 16/24] allow to disable checking for the latest package version via env (#4407) --- reflex/config.py | 3 +++ reflex/utils/prerequisites.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/reflex/config.py b/reflex/config.py index 962d6fec9..953a92b64 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -547,6 +547,9 @@ class EnvironmentVariables: # Where to save screenshots when tests fail. SCREENSHOT_DIR: EnvVar[Optional[Path]] = env_var(None) + # Whether to check for outdated package versions. + REFLEX_CHECK_LATEST_VERSION: EnvVar[bool] = env_var(True) + environment = EnvironmentVariables() diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index b2b3b7f3b..68d198711 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -93,6 +93,8 @@ def check_latest_package_version(package_name: str): Args: package_name: The name of the package. """ + if environment.REFLEX_CHECK_LATEST_VERSION.get() is False: + return try: # Get the latest version from PyPI current_version = importlib.metadata.version(package_name) From e0984aa83431bc70a31a99f48c98e87470e1be48 Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Thu, 21 Nov 2024 20:53:50 +0100 Subject: [PATCH 17/24] Allow bound method as event handler (#4348) * subtract 1 arg if the method is a bound method * fix it early in user_args * only bound methods pls * add test --- reflex/event.py | 4 ++++ tests/units/test_event.py | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/reflex/event.py b/reflex/event.py index 312c9887f..a9e92b635 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -1346,6 +1346,10 @@ def check_fn_match_arg_spec( EventFnArgMismatch: Raised if the number of mandatory arguments do not match """ user_args = inspect.getfullargspec(user_func).args + # Drop the first argument if it's a bound method + if inspect.ismethod(user_func) and user_func.__self__ is not None: + user_args = user_args[1:] + user_default_args = inspect.getfullargspec(user_func).defaults number_of_user_args = len(user_args) - number_of_bound_args number_of_user_default_args = len(user_default_args) if user_default_args else 0 diff --git a/tests/units/test_event.py b/tests/units/test_event.py index f17b3c4e4..4399ab2a0 100644 --- a/tests/units/test_event.py +++ b/tests/units/test_event.py @@ -2,6 +2,7 @@ from typing import Callable, List import pytest +import reflex as rx from reflex.event import ( Event, EventChain, @@ -439,3 +440,17 @@ def test_event_var_data(): # Ensure chain carries _var_data chain_var = Var.create(EventChain(events=[S.s(S.x)], args_spec=_args_spec)) assert chain_var._get_all_var_data() == S.x._get_all_var_data() + + +def test_event_bound_method() -> None: + class S(BaseState): + @event + def e(self, arg: str): + print(arg) + + class Wrapper: + def get_handler(self, arg: str): + return S.e(arg) + + w = Wrapper() + _ = rx.input(on_change=w.get_handler) From d4b197b517e91aa216a4b35669ee5b4369c27877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Thu, 21 Nov 2024 12:41:48 -0800 Subject: [PATCH 18/24] fix for event handlers in py3.9 (#4416) --- .../radix/themes/components/segmented_control.py | 4 +++- .../radix/themes/components/segmented_control.pyi | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/reflex/components/radix/themes/components/segmented_control.py b/reflex/components/radix/themes/components/segmented_control.py index 22725eaa6..f2dd9dc7c 100644 --- a/reflex/components/radix/themes/components/segmented_control.py +++ b/reflex/components/radix/themes/components/segmented_control.py @@ -12,7 +12,9 @@ from reflex.vars.base import Var from ..base import LiteralAccentColor, RadixThemesComponent -def on_value_change(value: Var[str | List[str]]) -> Tuple[Var[str | List[str]]]: +def on_value_change( + value: Var[Union[str, List[str]]], +) -> Tuple[Var[Union[str, List[str]]]]: """Handle the on_value_change event. Args: diff --git a/reflex/components/radix/themes/components/segmented_control.pyi b/reflex/components/radix/themes/components/segmented_control.pyi index 7ad115800..c7e87ca34 100644 --- a/reflex/components/radix/themes/components/segmented_control.pyi +++ b/reflex/components/radix/themes/components/segmented_control.pyi @@ -13,7 +13,9 @@ from reflex.vars.base import Var from ..base import RadixThemesComponent -def on_value_change(value: Var[str | List[str]]) -> Tuple[Var[str | List[str]]]: ... +def on_value_change( + value: Var[Union[str, List[str]]], +) -> Tuple[Var[Union[str, List[str]]]]: ... class SegmentedControlRoot(RadixThemesComponent): @overload @@ -118,7 +120,10 @@ class SegmentedControlRoot(RadixThemesComponent): custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, on_blur: Optional[EventType[[], BASE_STATE]] = None, on_change: Optional[ - Union[EventType[[], BASE_STATE], EventType[[str | List[str]], BASE_STATE]] + Union[ + EventType[[], BASE_STATE], + EventType[[Union[str, List[str]]], BASE_STATE], + ] ] = None, on_click: Optional[EventType[[], BASE_STATE]] = None, on_context_menu: Optional[EventType[[], BASE_STATE]] = None, From bbfbc82c9d70afcdb8b0e65398b5f7e75e3c8cac Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 21 Nov 2024 16:15:01 -0800 Subject: [PATCH 19/24] Handle Var passed to `rx.toast` (#4405) * Handle Var passed to `rx.toast` If the user provides a `Var` for `message` then apply it as `props["title"]` to avoid a var operations error. * remove unnecessary parentheses * remove weird hacks * get it right pyright --------- Co-authored-by: Khaleel Al-Adhami --- reflex/components/sonner/toast.py | 41 +++++++++++++++++++----------- reflex/components/sonner/toast.pyi | 12 ++++----- reflex/utils/types.py | 4 +++ 3 files changed, 36 insertions(+), 21 deletions(-) diff --git a/reflex/components/sonner/toast.py b/reflex/components/sonner/toast.py index c7db55a40..8f5362dba 100644 --- a/reflex/components/sonner/toast.py +++ b/reflex/components/sonner/toast.py @@ -15,6 +15,8 @@ from reflex.utils.imports import ImportVar from reflex.utils.serializers import serializer from reflex.vars import VarData from reflex.vars.base import LiteralVar, Var +from reflex.vars.function import FunctionVar +from reflex.vars.object import ObjectVar LiteralPosition = Literal[ "top-left", @@ -232,7 +234,9 @@ class Toaster(Component): return [hook] @staticmethod - def send_toast(message: str = "", level: str | None = None, **props) -> EventSpec: + def send_toast( + message: str | Var = "", level: str | None = None, **props + ) -> EventSpec: """Send a toast message. Args: @@ -250,20 +254,27 @@ class Toaster(Component): raise ValueError( "Toaster component must be created before sending a toast. (use `rx.toast.provider()`)" ) - toast_command = f"{toast_ref}.{level}" if level is not None else toast_ref - if message == "" and ("title" not in props or "description" not in props): - raise ValueError("Toast message or title or description must be provided.") - if props: - args = LiteralVar.create(ToastProps(component_name="rx.toast", **props)) # type: ignore - toast = f"{toast_command}(`{message}`, {str(args)})" - else: - toast = f"{toast_command}(`{message}`)" - toast_action = Var(_js_expr=toast) - return run_script(toast_action) + toast_command = ( + ObjectVar.__getattr__(toast_ref.to(dict), level) if level else toast_ref + ).to(FunctionVar) + + if isinstance(message, Var): + props.setdefault("title", message) + message = "" + elif message == "" and "title" not in props and "description" not in props: + raise ValueError("Toast message or title or description must be provided.") + + if props: + args = LiteralVar.create(ToastProps(component_name="rx.toast", **props)) # pyright: ignore [reportCallIssue, reportGeneralTypeIssues] + toast = toast_command.call(message, args) + else: + toast = toast_command.call(message) + + return run_script(toast) @staticmethod - def toast_info(message: str = "", **kwargs): + def toast_info(message: str | Var = "", **kwargs): """Display an info toast message. Args: @@ -276,7 +287,7 @@ class Toaster(Component): return Toaster.send_toast(message, level="info", **kwargs) @staticmethod - def toast_warning(message: str = "", **kwargs): + def toast_warning(message: str | Var = "", **kwargs): """Display a warning toast message. Args: @@ -289,7 +300,7 @@ class Toaster(Component): return Toaster.send_toast(message, level="warning", **kwargs) @staticmethod - def toast_error(message: str = "", **kwargs): + def toast_error(message: str | Var = "", **kwargs): """Display an error toast message. Args: @@ -302,7 +313,7 @@ class Toaster(Component): return Toaster.send_toast(message, level="error", **kwargs) @staticmethod - def toast_success(message: str = "", **kwargs): + def toast_success(message: str | Var = "", **kwargs): """Display a success toast message. Args: diff --git a/reflex/components/sonner/toast.pyi b/reflex/components/sonner/toast.pyi index f4f1028bd..7fd9fdf54 100644 --- a/reflex/components/sonner/toast.pyi +++ b/reflex/components/sonner/toast.pyi @@ -59,16 +59,16 @@ class Toaster(Component): def add_hooks(self) -> list[Var | str]: ... @staticmethod def send_toast( - message: str = "", level: str | None = None, **props + message: str | Var = "", level: str | None = None, **props ) -> EventSpec: ... @staticmethod - def toast_info(message: str = "", **kwargs): ... + def toast_info(message: str | Var = "", **kwargs): ... @staticmethod - def toast_warning(message: str = "", **kwargs): ... + def toast_warning(message: str | Var = "", **kwargs): ... @staticmethod - def toast_error(message: str = "", **kwargs): ... + def toast_error(message: str | Var = "", **kwargs): ... @staticmethod - def toast_success(message: str = "", **kwargs): ... + def toast_success(message: str | Var = "", **kwargs): ... @staticmethod def toast_dismiss(id: Var | str | None = None): ... @overload @@ -176,7 +176,7 @@ class ToastNamespace(ComponentNamespace): @staticmethod def __call__( - message: str = "", level: Optional[str] = None, **props + message: Union[str, Var] = "", level: Optional[str] = None, **props ) -> "Optional[EventSpec]": """Send a toast message. diff --git a/reflex/utils/types.py b/reflex/utils/types.py index 9361c1ce4..0c39eacc4 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -576,6 +576,10 @@ def _isinstance(obj: Any, cls: GenericType, nested: bool = False) -> bool: return does_obj_satisfy_typed_dict(obj, cls) return isinstance(obj, dict) + # cls is a float + if cls is float: + return isinstance(obj, (float, int)) + # cls is a simple class return isinstance(obj, cls) From b5e4b02d9c1be39ccc34fc218adcabfbfa040ab0 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 21 Nov 2024 16:32:38 -0800 Subject: [PATCH 20/24] New Event Action: temporal (#4404) When an event/event spec is marked as "temporal", it will not be queued unless the backend is up. This can be used to prevent periodic events (like from `rx.moment`) from queueing up while the backend is down, and then stampeding when the backend comes up and the queue is drained. It can be used to avoid processing many periodic events at once when the app is only expecting to process such an event every so often. --- reflex/.templates/web/utils/state.js | 5 +++++ reflex/event.py | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/reflex/.templates/web/utils/state.js b/reflex/.templates/web/utils/state.js index 72733777e..e14c669f5 100644 --- a/reflex/.templates/web/utils/state.js +++ b/reflex/.templates/web/utils/state.js @@ -705,6 +705,11 @@ export const useEventLoop = ( _e.stopPropagation(); } const combined_name = events.map((e) => e.name).join("+++"); + if (event_actions?.temporal) { + if (!socket.current || !socket.current.connected) { + return; // don't queue when the backend is not connected + } + } if (event_actions?.throttle) { // If throttle returns false, the events are not added to the queue. if (!throttle(combined_name, event_actions.throttle)) { diff --git a/reflex/event.py b/reflex/event.py index a9e92b635..624bc1728 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -181,6 +181,18 @@ class EventActionsMixin: event_actions={"debounce": delay_ms, **self.event_actions}, ) + @property + def temporal(self): + """Do not queue the event if the backend is down. + + Returns: + New EventHandler-like with temporal set to True. + """ + return dataclasses.replace( + self, + event_actions={"temporal": True, **self.event_actions}, + ) + @dataclasses.dataclass( init=True, From c13cec3d8a40bf900653096dd98398c5d53b36dc Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Fri, 22 Nov 2024 01:33:47 +0100 Subject: [PATCH 21/24] implement performance mode for existing state size check (#4392) --- reflex/config.py | 14 ++++++++++++++ reflex/state.py | 28 +++++++++++++++++++--------- reflex/utils/exceptions.py | 4 ++++ 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/reflex/config.py b/reflex/config.py index 953a92b64..88230cefe 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -454,6 +454,14 @@ class PathExistsFlag: ExistingPath = Annotated[Path, PathExistsFlag] +class PerformanceMode(enum.Enum): + """Performance mode for the app.""" + + WARN = "warn" + RAISE = "raise" + OFF = "off" + + class EnvironmentVariables: """Environment variables class to instantiate environment variables.""" @@ -550,6 +558,12 @@ class EnvironmentVariables: # Whether to check for outdated package versions. REFLEX_CHECK_LATEST_VERSION: EnvVar[bool] = env_var(True) + # In which performance mode to run the app. + REFLEX_PERF_MODE: EnvVar[Optional[PerformanceMode]] = env_var(PerformanceMode.WARN) + + # The maximum size of the reflex state in kilobytes. + REFLEX_STATE_SIZE_LIMIT: EnvVar[int] = env_var(1000) + environment = EnvironmentVariables() diff --git a/reflex/state.py b/reflex/state.py index 9ff6f0ea8..442fa57b2 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -43,7 +43,7 @@ from sqlalchemy.orm import DeclarativeBase from typing_extensions import Self from reflex import event -from reflex.config import get_config +from reflex.config import PerformanceMode, get_config from reflex.istate.data import RouterData from reflex.istate.storage import ClientStorageBase from reflex.model import Model @@ -90,6 +90,7 @@ from reflex.utils.exceptions import ( ReflexRuntimeError, SetUndefinedStateVarError, StateSchemaMismatchError, + StateTooLargeError, ) from reflex.utils.exec import is_testing_env from reflex.utils.serializers import serializer @@ -110,10 +111,11 @@ Delta = Dict[str, Any] var = computed_var -# If the state is this large, it's considered a performance issue. -TOO_LARGE_SERIALIZED_STATE = 100 * 1024 # 100kb -# Only warn about each state class size once. -_WARNED_ABOUT_STATE_SIZE: Set[str] = set() +if environment.REFLEX_PERF_MODE.get() != PerformanceMode.OFF: + # If the state is this large, it's considered a performance issue. + TOO_LARGE_SERIALIZED_STATE = environment.REFLEX_STATE_SIZE_LIMIT.get() * 1024 + # Only warn about each state class size once. + _WARNED_ABOUT_STATE_SIZE: Set[str] = set() # Errors caught during pickling of state HANDLED_PICKLE_ERRORS = ( @@ -2097,7 +2099,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): state["__dict__"].pop(inherited_var_name, None) return state - def _warn_if_too_large( + def _check_state_size( self, pickle_state_size: int, ): @@ -2105,6 +2107,9 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): Args: pickle_state_size: The size of the pickled state. + + Raises: + StateTooLargeError: If the state is too large. """ state_full_name = self.get_full_name() if ( @@ -2112,10 +2117,14 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): and pickle_state_size > TOO_LARGE_SERIALIZED_STATE and self.substates ): - console.warn( + msg = ( f"State {state_full_name} serializes to {pickle_state_size} bytes " - "which may present performance issues. Consider reducing the size of this state." + + "which may present performance issues. Consider reducing the size of this state." ) + if environment.REFLEX_PERF_MODE.get() == PerformanceMode.WARN: + console.warn(msg) + elif environment.REFLEX_PERF_MODE.get() == PerformanceMode.RAISE: + raise StateTooLargeError(msg) _WARNED_ABOUT_STATE_SIZE.add(state_full_name) @classmethod @@ -2157,7 +2166,8 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): """ try: pickle_state = pickle.dumps((self._to_schema(), self)) - self._warn_if_too_large(len(pickle_state)) + if environment.REFLEX_PERF_MODE.get() != PerformanceMode.OFF: + self._check_state_size(len(pickle_state)) return pickle_state except HANDLED_PICKLE_ERRORS as og_pickle_error: error = ( diff --git a/reflex/utils/exceptions.py b/reflex/utils/exceptions.py index 7611e5a4d..714dc912c 100644 --- a/reflex/utils/exceptions.py +++ b/reflex/utils/exceptions.py @@ -151,6 +151,10 @@ class InvalidPropValueError(ReflexError): """Raised when a prop value is invalid.""" +class StateTooLargeError(ReflexError): + """Raised when the state is too large to be serialized.""" + + class SystemPackageMissingError(ReflexError): """Raised when a system package is missing.""" From 9faa5d6fd926f3ec4572f2091d030cf84c7ceec0 Mon Sep 17 00:00:00 2001 From: Elijah Ahianyo Date: Fri, 22 Nov 2024 00:54:15 +0000 Subject: [PATCH 22/24] Downgrade syntax highlighter to fix `wrapLongLines` (#4368) --- reflex/components/datadisplay/code.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/components/datadisplay/code.py b/reflex/components/datadisplay/code.py index 9d5052df1..b514bc888 100644 --- a/reflex/components/datadisplay/code.py +++ b/reflex/components/datadisplay/code.py @@ -382,7 +382,7 @@ for theme_name in dir(Theme): class CodeBlock(Component, MarkdownComponentMap): """A code block.""" - library = "react-syntax-highlighter@15.6.1" + library = "react-syntax-highlighter@15.6.0" tag = "PrismAsyncLight" From 5702a18502ebcbbef1161ef3d999d1b49fc69099 Mon Sep 17 00:00:00 2001 From: Elijah Ahianyo Date: Fri, 22 Nov 2024 00:58:12 +0000 Subject: [PATCH 23/24] [GTM-836]Rework Init workflow (#4377) * Rework Init workflow * minor format * refactor * add comments * fix pyright alongside some improvements * add demolink for blank template * fix darglint * Add more templates and keep template name in kebab case * revert getting other templates since we'll use the submodules approach * remove debug statement * Improvements based on standup comments * Add redirect logic * changes based on new flow --------- Co-authored-by: Masen Furer --- reflex/constants/base.py | 12 ++ reflex/reflex.py | 28 +---- reflex/utils/prerequisites.py | 212 +++++++++++++++++++++++++++------- reflex/utils/redir.py | 17 ++- 4 files changed, 198 insertions(+), 71 deletions(-) diff --git a/reflex/constants/base.py b/reflex/constants/base.py index 798ac7dc6..3266043c5 100644 --- a/reflex/constants/base.py +++ b/reflex/constants/base.py @@ -97,6 +97,18 @@ class Templates(SimpleNamespace): # The default template DEFAULT = "blank" + # The AI template + AI = "ai" + + # The option for the user to choose a remote template. + CHOOSE_TEMPLATES = "choose-templates" + + # The URL to find reflex templates. + REFLEX_TEMPLATES_URL = "https://reflex.dev/templates" + + # Demo url for the default template. + DEFAULT_TEMPLATE_URL = "https://blank-template.reflex.run" + # The reflex.build frontend host REFLEX_BUILD_FRONTEND = "https://flexgen.reflex.run" diff --git a/reflex/reflex.py b/reflex/reflex.py index 8c26e0470..9d8199148 100644 --- a/reflex/reflex.py +++ b/reflex/reflex.py @@ -17,7 +17,7 @@ from reflex import constants from reflex.config import environment, get_config from reflex.custom_components.custom_components import custom_components_cli from reflex.state import reset_disk_state_manager -from reflex.utils import console, redir, telemetry +from reflex.utils import console, telemetry # Disable typer+rich integration for help panels typer.core.rich = None # type: ignore @@ -89,30 +89,8 @@ def _init( # Set up the web project. prerequisites.initialize_frontend_dependencies() - # Integrate with reflex.build. - generation_hash = None - if ai: - if template is None: - # If AI is requested and no template specified, redirect the user to reflex.build. - generation_hash = redir.reflex_build_redirect() - elif prerequisites.is_generation_hash(template): - # Otherwise treat the template as a generation hash. - generation_hash = template - else: - console.error( - "Cannot use `--template` option with `--ai` option. Please remove `--template` option." - ) - raise typer.Exit(2) - template = constants.Templates.DEFAULT - # Initialize the app. - template = prerequisites.initialize_app(app_name, template) - - # If a reflex.build generation hash is available, download the code and apply it to the main module. - if generation_hash: - prerequisites.initialize_main_module_index_from_generation( - app_name, generation_hash=generation_hash - ) + template = prerequisites.initialize_app(app_name, template, ai) # Initialize the .gitignore. prerequisites.initialize_gitignore() @@ -120,7 +98,7 @@ def _init( # Initialize the requirements.txt. prerequisites.initialize_requirements_txt() - template_msg = "" if not template else f" using the {template} template" + template_msg = f" using the {template} template" if template else "" # Finish initializing the app. console.success(f"Initialized {app_name}{template_msg}") diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 68d198711..ec79b3297 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -34,7 +34,7 @@ from redis.asyncio import Redis from reflex import constants, model from reflex.compiler import templates from reflex.config import Config, environment, get_config -from reflex.utils import console, net, path_ops, processes +from reflex.utils import console, net, path_ops, processes, redir from reflex.utils.exceptions import ( GeneratedCodeHasNoFunctionDefs, raise_system_package_missing_error, @@ -1211,7 +1211,7 @@ def check_schema_up_to_date(): ) -def prompt_for_template(templates: list[Template]) -> str: +def prompt_for_template_options(templates: list[Template]) -> str: """Prompt the user to specify a template. Args: @@ -1223,9 +1223,14 @@ def prompt_for_template(templates: list[Template]) -> str: # Show the user the URLs of each template to preview. console.print("\nGet started with a template:") + def format_demo_url_str(url: str) -> str: + return f" ({url})" if url else "" + # Prompt the user to select a template. id_to_name = { - str(idx): f"{template.name} ({template.demo_url}) - {template.description}" + str( + idx + ): f"{template.name.replace('_', ' ').replace('-', ' ')}{format_demo_url_str(template.demo_url)} - {template.description}" for idx, template in enumerate(templates) } for id in range(len(id_to_name)): @@ -1380,15 +1385,119 @@ def create_config_init_app_from_remote_template(app_name: str, template_url: str shutil.rmtree(unzip_dir) -def initialize_app(app_name: str, template: str | None = None) -> str | None: +def initialize_default_app(app_name: str): + """Initialize the default app. + + Args: + app_name: The name of the app. + """ + create_config(app_name) + initialize_app_directory(app_name) + + +def validate_and_create_app_using_remote_template(app_name, template, templates): + """Validate and create an app using a remote template. + + Args: + app_name: The name of the app. + template: The name of the template. + templates: The available templates. + + Raises: + Exit: If the template is not found. + """ + # If user selects a template, it needs to exist. + if template in templates: + template_url = templates[template].code_url + else: + # Check if the template is a github repo. + if template.startswith("https://github.com"): + template_url = f"{template.strip('/').replace('.git', '')}/archive/main.zip" + else: + console.error(f"Template `{template}` not found.") + raise typer.Exit(1) + + if template_url is None: + return + + create_config_init_app_from_remote_template( + app_name=app_name, template_url=template_url + ) + + +def generate_template_using_ai(template: str | None = None) -> str: + """Generate a template using AI(Flexgen). + + Args: + template: The name of the template. + + Returns: + The generation hash. + + Raises: + Exit: If the template and ai flags are used. + """ + if template is None: + # If AI is requested and no template specified, redirect the user to reflex.build. + return redir.reflex_build_redirect() + elif is_generation_hash(template): + # Otherwise treat the template as a generation hash. + return template + else: + console.error( + "Cannot use `--template` option with `--ai` option. Please remove `--template` option." + ) + raise typer.Exit(2) + + +def fetch_remote_templates( + template: Optional[str] = None, +) -> tuple[str, dict[str, Template]]: + """Fetch the available remote templates. + + Args: + template: The name of the template. + + Returns: + The selected template and the available templates. + + Raises: + Exit: If the template is not valid or if the template is not specified. + """ + available_templates = {} + + try: + # Get the available templates + available_templates = fetch_app_templates(constants.Reflex.VERSION) + except Exception as e: + console.warn("Failed to fetch templates. Falling back to default template.") + console.debug(f"Error while fetching templates: {e}") + template = constants.Templates.DEFAULT + + if template == constants.Templates.DEFAULT: + return template, available_templates + + if template in available_templates: + return template, available_templates + + else: + if template is not None: + console.error(f"{template!r} is not a valid template name.") + console.print( + f"Go to the templates page ({constants.Templates.REFLEX_TEMPLATES_URL}) and copy the command to init with a template." + ) + raise typer.Exit(0) + + +def initialize_app( + app_name: str, template: str | None = None, ai: bool = False +) -> str | None: """Initialize the app either from a remote template or a blank app. If the config file exists, it is considered as reinit. Args: app_name: The name of the app. template: The name of the template to use. - - Raises: - Exit: If template is directly provided in the command flag and is invalid. + ai: Whether to use AI to generate the template. Returns: The name of the template. @@ -1401,54 +1510,73 @@ def initialize_app(app_name: str, template: str | None = None) -> str | None: telemetry.send("reinit") return + generation_hash = None + if ai: + generation_hash = generate_template_using_ai(template) + template = constants.Templates.DEFAULT + templates: dict[str, Template] = {} # Don't fetch app templates if the user directly asked for DEFAULT. - if template is None or (template != constants.Templates.DEFAULT): - try: - # Get the available templates - templates = fetch_app_templates(constants.Reflex.VERSION) - if template is None and len(templates) > 0: - template = prompt_for_template(list(templates.values())) - except Exception as e: - console.warn("Failed to fetch templates. Falling back to default template.") - console.debug(f"Error while fetching templates: {e}") - finally: - template = template or constants.Templates.DEFAULT + if template is not None and (template not in (constants.Templates.DEFAULT,)): + template, templates = fetch_remote_templates(template) + + if template is None: + template = prompt_for_template_options(get_init_cli_prompt_options()) + if template == constants.Templates.AI: + generation_hash = generate_template_using_ai() + # change to the default to allow creation of default app + template = constants.Templates.DEFAULT + elif template == constants.Templates.CHOOSE_TEMPLATES: + template, templates = fetch_remote_templates() # If the blank template is selected, create a blank app. - if template == constants.Templates.DEFAULT: + if template in (constants.Templates.DEFAULT,): # Default app creation behavior: a blank app. - create_config(app_name) - initialize_app_directory(app_name) + initialize_default_app(app_name) else: - # Fetch App templates from the backend server. - console.debug(f"Available templates: {templates}") - - # If user selects a template, it needs to exist. - if template in templates: - template_url = templates[template].code_url - else: - # Check if the template is a github repo. - if template.startswith("https://github.com"): - template_url = ( - f"{template.strip('/').replace('.git', '')}/archive/main.zip" - ) - else: - console.error(f"Template `{template}` not found.") - raise typer.Exit(1) - - if template_url is None: - return - - create_config_init_app_from_remote_template( - app_name=app_name, template_url=template_url + validate_and_create_app_using_remote_template( + app_name=app_name, template=template, templates=templates ) + # If a reflex.build generation hash is available, download the code and apply it to the main module. + if generation_hash: + initialize_main_module_index_from_generation( + app_name, generation_hash=generation_hash + ) telemetry.send("init", template=template) + return template +def get_init_cli_prompt_options() -> list[Template]: + """Get the CLI options for initializing a Reflex app. + + Returns: + The CLI options. + """ + return [ + Template( + name=constants.Templates.DEFAULT, + description="A blank Reflex app.", + demo_url=constants.Templates.DEFAULT_TEMPLATE_URL, + code_url="", + ), + Template( + name=constants.Templates.AI, + description="Generate a template using AI [Experimental]", + demo_url="", + code_url="", + ), + Template( + name=constants.Templates.CHOOSE_TEMPLATES, + description="Choose an existing template.", + demo_url="", + code_url="", + ), + ] + + def initialize_main_module_index_from_generation(app_name: str, generation_hash: str): """Overwrite the `index` function in the main module with reflex.build generated code. diff --git a/reflex/utils/redir.py b/reflex/utils/redir.py index 1dbd989e9..b35cbe26e 100644 --- a/reflex/utils/redir.py +++ b/reflex/utils/redir.py @@ -10,6 +10,18 @@ from .. import constants from . import console +def open_browser(target_url: str) -> None: + """Open a browser window to target_url. + + Args: + target_url: The URL to open in the browser. + """ + if not webbrowser.open(target_url): + console.warn( + f"Unable to automatically open the browser. Please navigate to {target_url} in your browser." + ) + + def open_browser_and_wait( target_url: str, poll_url: str, interval: int = 2 ) -> httpx.Response: @@ -23,10 +35,7 @@ def open_browser_and_wait( Returns: The response from the poll_url. """ - if not webbrowser.open(target_url): - console.warn( - f"Unable to automatically open the browser. Please navigate to {target_url} in your browser." - ) + open_browser(target_url) console.info("[b]Complete the workflow in the browser to continue.[/b]") while True: try: From a6b324bd3ec99af827ed15818bd520d4dbcae0a9 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Thu, 21 Nov 2024 17:01:14 -0800 Subject: [PATCH 24/24] [ENG-3953] Support pydantic BaseModel (v1 and v2) as state var (#4338) * [ENG-3953] Support pydantic BaseModel (v1 and v2) as state var Provide serializers and mutable proxy tracking for pydantic models directly. * conditionally define v2 serializer Co-authored-by: Khaleel Al-Adhami * Add `MutableProxy._is_mutable_value` to avoid duplicate logic * Conditionally import BaseModel to handle older pydantic v1 versions * pre-commit fu --------- Co-authored-by: Khaleel Al-Adhami --- reflex/state.py | 38 +++++++++++++++++++++++----- reflex/utils/serializers.py | 47 +++++++++++++++++++++++++++++++++++ tests/units/test_state.py | 49 +++++++++++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+), 6 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index 442fa57b2..349dc59e9 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -62,6 +62,13 @@ try: except ModuleNotFoundError: import pydantic +from pydantic import BaseModel as BaseModelV2 + +try: + from pydantic.v1 import BaseModel as BaseModelV1 +except ModuleNotFoundError: + BaseModelV1 = BaseModelV2 + import wrapt from redis.asyncio import Redis from redis.exceptions import ResponseError @@ -1250,7 +1257,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): if parent_state is not None: return getattr(parent_state, name) - if isinstance(value, MutableProxy.__mutable_types__) and ( + if MutableProxy._is_mutable_type(value) and ( name in super().__getattribute__("base_vars") or name in backend_vars ): # track changes in mutable containers (list, dict, set, etc) @@ -3558,7 +3565,16 @@ class MutableProxy(wrapt.ObjectProxy): pydantic.BaseModel.__dict__ ) - __mutable_types__ = (list, dict, set, Base, DeclarativeBase) + # These types will be wrapped in MutableProxy + __mutable_types__ = ( + list, + dict, + set, + Base, + DeclarativeBase, + BaseModelV2, + BaseModelV1, + ) def __init__(self, wrapped: Any, state: BaseState, field_name: str): """Create a proxy for a mutable object that tracks changes. @@ -3598,6 +3614,18 @@ class MutableProxy(wrapt.ObjectProxy): if wrapped is not None: return wrapped(*args, **(kwargs or {})) + @classmethod + def _is_mutable_type(cls, value: Any) -> bool: + """Check if a value is of a mutable type and should be wrapped. + + Args: + value: The value to check. + + Returns: + Whether the value is of a mutable type. + """ + return isinstance(value, cls.__mutable_types__) + def _wrap_recursive(self, value: Any) -> Any: """Wrap a value recursively if it is mutable. @@ -3608,9 +3636,7 @@ class MutableProxy(wrapt.ObjectProxy): The wrapped value. """ # Recursively wrap mutable types, but do not re-wrap MutableProxy instances. - if isinstance(value, self.__mutable_types__) and not isinstance( - value, MutableProxy - ): + if self._is_mutable_type(value) and not isinstance(value, MutableProxy): return type(self)( wrapped=value, state=self._self_state, @@ -3668,7 +3694,7 @@ class MutableProxy(wrapt.ObjectProxy): self._wrap_recursive_decorator, ) - if isinstance(value, self.__mutable_types__) and __name not in ( + if self._is_mutable_type(value) and __name not in ( "__wrapped__", "_self_state", ): diff --git a/reflex/utils/serializers.py b/reflex/utils/serializers.py index b0ad935c8..4bb8dea92 100644 --- a/reflex/utils/serializers.py +++ b/reflex/utils/serializers.py @@ -270,6 +270,53 @@ def serialize_base(value: Base) -> dict: } +try: + from pydantic.v1 import BaseModel as BaseModelV1 + + @serializer(to=dict) + def serialize_base_model_v1(model: BaseModelV1) -> dict: + """Serialize a pydantic v1 BaseModel instance. + + Args: + model: The BaseModel to serialize. + + Returns: + The serialized BaseModel. + """ + return model.dict() + + from pydantic import BaseModel as BaseModelV2 + + if BaseModelV1 is not BaseModelV2: + + @serializer(to=dict) + def serialize_base_model_v2(model: BaseModelV2) -> dict: + """Serialize a pydantic v2 BaseModel instance. + + Args: + model: The BaseModel to serialize. + + Returns: + The serialized BaseModel. + """ + return model.model_dump() +except ImportError: + # Older pydantic v1 import + from pydantic import BaseModel as BaseModelV1 + + @serializer(to=dict) + def serialize_base_model_v1(model: BaseModelV1) -> dict: + """Serialize a pydantic v1 BaseModel instance. + + Args: + model: The BaseModel to serialize. + + Returns: + The serialized BaseModel. + """ + return model.dict() + + @serializer def serialize_set(value: Set) -> list: """Serialize a set to a JSON serializable list. diff --git a/tests/units/test_state.py b/tests/units/test_state.py index 7cebaff8e..c8a52e6c0 100644 --- a/tests/units/test_state.py +++ b/tests/units/test_state.py @@ -16,6 +16,8 @@ from unittest.mock import AsyncMock, Mock import pytest import pytest_asyncio from plotly.graph_objects import Figure +from pydantic import BaseModel as BaseModelV2 +from pydantic.v1 import BaseModel as BaseModelV1 import reflex as rx import reflex.config @@ -3413,6 +3415,53 @@ def test_typed_state() -> None: _ = TypedState(field="str") +class ModelV1(BaseModelV1): + """A pydantic BaseModel v1.""" + + foo: str = "bar" + + +class ModelV2(BaseModelV2): + """A pydantic BaseModel v2.""" + + foo: str = "bar" + + +@dataclasses.dataclass +class ModelDC: + """A dataclass.""" + + foo: str = "bar" + + +class PydanticState(rx.State): + """A state with pydantic BaseModel vars.""" + + v1: ModelV1 = ModelV1() + v2: ModelV2 = ModelV2() + dc: ModelDC = ModelDC() + + +def test_mutable_models(): + """Test that dataclass and pydantic BaseModel v1 and v2 use dep tracking.""" + state = PydanticState() + assert isinstance(state.v1, MutableProxy) + state.v1.foo = "baz" + assert state.dirty_vars == {"v1"} + state.dirty_vars.clear() + + assert isinstance(state.v2, MutableProxy) + state.v2.foo = "baz" + assert state.dirty_vars == {"v2"} + state.dirty_vars.clear() + + # Not yet supported ENG-4083 + # assert isinstance(state.dc, MutableProxy) + # state.dc.foo = "baz" + # assert state.dirty_vars == {"dc"} + # state.dirty_vars.clear() + + def test_get_value(): class GetValueState(rx.State): foo: str = "FOO"