reflex 0.7.3a1__py3-none-any.whl → 0.7.4a0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of reflex might be problematic. Click here for more details.
- reflex/.templates/web/utils/state.js +1 -1
- reflex/app.py +1 -1
- reflex/app_mixins/middleware.py +2 -3
- reflex/compiler/compiler.py +61 -4
- reflex/components/core/upload.py +1 -1
- reflex/components/plotly/plotly.py +9 -9
- reflex/components/recharts/recharts.py +2 -2
- reflex/components/sonner/toast.py +1 -1
- reflex/config.py +2 -5
- reflex/constants/__init__.py +1 -2
- reflex/constants/base.py +3 -0
- reflex/constants/installer.py +8 -105
- reflex/state.py +8 -1
- reflex/testing.py +7 -1
- reflex/utils/build.py +3 -4
- reflex/utils/exec.py +10 -11
- reflex/utils/path_ops.py +15 -25
- reflex/utils/prerequisites.py +113 -181
- reflex/utils/processes.py +21 -18
- reflex/utils/registry.py +5 -5
- {reflex-0.7.3a1.dist-info → reflex-0.7.4a0.dist-info}/METADATA +29 -22
- {reflex-0.7.3a1.dist-info → reflex-0.7.4a0.dist-info}/RECORD +49 -58
- {reflex-0.7.3a1.dist-info → reflex-0.7.4a0.dist-info}/WHEEL +1 -1
- {reflex-0.7.3a1.dist-info → reflex-0.7.4a0.dist-info}/entry_points.txt +0 -3
- benchmarks/__init__.py +0 -3
- benchmarks/benchmark_compile_times.py +0 -147
- benchmarks/benchmark_imports.py +0 -128
- benchmarks/benchmark_lighthouse.py +0 -75
- benchmarks/benchmark_package_size.py +0 -135
- benchmarks/benchmark_web_size.py +0 -106
- benchmarks/conftest.py +0 -20
- benchmarks/lighthouse.sh +0 -77
- benchmarks/utils.py +0 -74
- {reflex-0.7.3a1.dist-info → reflex-0.7.4a0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
reflex
|
|
11
|
-
reflex
|
|
12
|
-
reflex
|
|
13
|
-
reflex
|
|
1
|
+
reflex/__init__.py,sha256=64HB9b6MKesl3Yv6aZMsozdMKKpgnxirKk-aeN45UYY,10341
|
|
2
|
+
reflex/__init__.pyi,sha256=j4ZkO-mKKw5dFBhJVbaOg7AlncO-JCckV2cHENPiLG0,11303
|
|
3
|
+
reflex/__main__.py,sha256=6cVrGEyT3j3tEvlEVUatpaYfbB5EF3UVY-6vc_Z7-hw,108
|
|
4
|
+
reflex/admin.py,sha256=wu_vYqB0rU2njYBJSI0XZgVEkAFVZNQNUkUUXrlFbZc,343
|
|
5
|
+
reflex/app.py,sha256=okGLgq549WgvKtjyOg2QwKwp95ORwLKqWyeBDCJSKJ4,68740
|
|
6
|
+
reflex/app_module_for_backend.py,sha256=iuEYcJNRai59vReNUIZgixtYlFHYcYp_LNFB9DPQnKs,1134
|
|
7
|
+
reflex/assets.py,sha256=PLTKAMYPKMZq8eWXKX8uco6NZ9IiPGWal0bOPLUmU7k,3364
|
|
8
|
+
reflex/base.py,sha256=T1sY7SJJOpTsOveEiFxp-K39EoIQtRLgqdFZhsdM0DE,3976
|
|
9
|
+
reflex/config.py,sha256=SQmFoj5DvVrXmWZ2IbXhzQ41MdL2qgmJ2LTKzDPkHjY,34980
|
|
10
|
+
reflex/event.py,sha256=EX-9X-c8gIudZjRDG8qSrVAbegcaGkYXxLLRWg-7IOA,60758
|
|
11
|
+
reflex/model.py,sha256=k6qCweATPW1YRB_qcHwa5X35btJmtIlB4zEQ63FaW3w,17527
|
|
12
|
+
reflex/page.py,sha256=qEt8n5EtawSywCzdsiaNQJWhC8ie-vg8ig0JGuVavPI,2386
|
|
13
|
+
reflex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
reflex/reflex.py,sha256=gmYVXXASlx_4kpyYuqEASS2qNdG2lWbmVpNQ_LYeOJQ,20399
|
|
15
|
+
reflex/route.py,sha256=nn_hJwtQdjiqH_dHXfqMGWKllnyPQZTSR-KWdHDhoOs,4210
|
|
16
|
+
reflex/state.py,sha256=sBMo_mMdzgQRlbD9U5RyqG77m96PYsIjcJcBVuMUMwc,141801
|
|
17
|
+
reflex/style.py,sha256=dilXPn8de80NzsXT53GPJrmjELC5nPYIlCgongyq1zM,13145
|
|
18
|
+
reflex/testing.py,sha256=IpjUHBNOJDAQtu6HnazfWIacEO5cIJvyHlCr6dYpr38,35585
|
|
14
19
|
reflex/.templates/apps/blank/assets/favicon.ico,sha256=baxxgDAQ2V4-G5Q4S2yK5uUJTUGkv-AOWBQ0xd6myUo,4286
|
|
15
20
|
reflex/.templates/apps/blank/code/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
21
|
reflex/.templates/apps/blank/code/blank.py,sha256=oKnsBBZM1-_RFAuwGKgfiCzgsrHlN_m_XP0-Fpnld7k,926
|
|
@@ -21,6 +26,7 @@ reflex/.templates/jinja/custom_components/demo_app.py.jinja2,sha256=ipbKtObNqQLc
|
|
|
21
26
|
reflex/.templates/jinja/custom_components/pyproject.toml.jinja2,sha256=HG-k3pruUlMy7xYz339hgFkNMTLqB-C_FTLKkOgfBPM,630
|
|
22
27
|
reflex/.templates/jinja/custom_components/src.py.jinja2,sha256=e80PwMI6NoeQtGJ0NXWhYrkqUe7jvvJTFuztYQe-R5w,2403
|
|
23
28
|
reflex/.templates/jinja/web/package.json.jinja2,sha256=Dyg7DbKaEgxUoaV_DUsv_bHcT0h1mXKgO4R_pVzlHQw,707
|
|
29
|
+
reflex/.templates/jinja/web/tailwind.config.js.jinja2,sha256=uZMIvtL94OZh6h8zsduv3ox6EXnnYgfVXB_5moOe86E,761
|
|
24
30
|
reflex/.templates/jinja/web/pages/_app.js.jinja2,sha256=s0pSHZAZB9SUI3PabTB8uB4I3kehMc-L2DXBxSW6iQY,1375
|
|
25
31
|
reflex/.templates/jinja/web/pages/_document.js.jinja2,sha256=E2r3MWp-gimAa6DdRs9ErQpPEyjS_yV5fdid_wdOOlA,182
|
|
26
32
|
reflex/.templates/jinja/web/pages/base_page.js.jinja2,sha256=-Jykv29ZqzsQyyRe_iR2gUD5ac-X5RhDrGs0-diOMOA,400
|
|
@@ -32,41 +38,36 @@ reflex/.templates/jinja/web/pages/stateful_component.js.jinja2,sha256=E_CwG5o4pK
|
|
|
32
38
|
reflex/.templates/jinja/web/pages/stateful_components.js.jinja2,sha256=BfHi7ckH9u5xOliKWxjgmnia6AJbNnII97SC-dt_KSU,101
|
|
33
39
|
reflex/.templates/jinja/web/pages/utils.js.jinja2,sha256=RRsAXc5VM5SJ5jgxc0M6XSDxRUGefUdK85TTEEZ1d3I,3653
|
|
34
40
|
reflex/.templates/jinja/web/styles/styles.css.jinja2,sha256=4-CvqGR8-nRzkuCOSp_PdqmhPEmOs_kOhskOlhLMEUg,141
|
|
35
|
-
reflex/.templates/jinja/web/tailwind.config.js.jinja2,sha256=uZMIvtL94OZh6h8zsduv3ox6EXnnYgfVXB_5moOe86E,761
|
|
36
41
|
reflex/.templates/jinja/web/utils/context.js.jinja2,sha256=-fAc0G1h_GJ-geT59KzdtgE1wfpt3ouXBA8ySWjcRIw,3911
|
|
37
42
|
reflex/.templates/jinja/web/utils/theme.js.jinja2,sha256=OSpBMh0Z9tTeqb10js4ZtnE9s1RV4gJfE8629csST8M,26
|
|
38
43
|
reflex/.templates/web/.gitignore,sha256=3tT0CtVkCL09D_Y3Hd4myUgGcBuESeavCa0WHU5ifJ4,417
|
|
39
|
-
reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js,sha256=Xx_SdWsxABz3JzWDKxuOkuq87GEXK7DD5sqahPFbEzw,1621
|
|
40
|
-
reflex/.templates/web/components/shiki/code.js,sha256=UO0hQnm2w1j2VMgj46cnplO6ZLK3p3qhcxp6irjZBxQ,1116
|
|
41
44
|
reflex/.templates/web/jsconfig.json,sha256=rhQZZRBYxBWclFYTeU6UakzbGveM4qyRQZUpEAVhyqY,118
|
|
42
45
|
reflex/.templates/web/next.config.js,sha256=ZpGOqo9wHEbt0S08G70VfUNUjFe79UXo7Cde8X8V10E,118
|
|
43
46
|
reflex/.templates/web/postcss.config.js,sha256=pWczoUW-Y0gYUuHAW4ZK0hQNWTcMC2UGu2i-sQ-YqUs,109
|
|
47
|
+
reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js,sha256=Xx_SdWsxABz3JzWDKxuOkuq87GEXK7DD5sqahPFbEzw,1621
|
|
48
|
+
reflex/.templates/web/components/shiki/code.js,sha256=UO0hQnm2w1j2VMgj46cnplO6ZLK3p3qhcxp6irjZBxQ,1116
|
|
44
49
|
reflex/.templates/web/styles/tailwind.css,sha256=wGOoICTy1G0e5bWZ4LYOVgRa3ZT7M44tC4g6CKh6ZPo,112
|
|
45
50
|
reflex/.templates/web/utils/client_side_routing.js,sha256=cOu4wUHDQtGl1yo5goxljZ94SLZLyr9R3S9Rehcvjio,1475
|
|
51
|
+
reflex/.templates/web/utils/state.js,sha256=s_k36cWTWYI_8_GVa2X6oVigjQ7-3Zo5cf3gbD77iJA,30530
|
|
46
52
|
reflex/.templates/web/utils/helpers/dataeditor.js,sha256=pG6MgsHuStDR7-qPipzfiK32j9bKDBa-4hZ0JSUo4JM,1623
|
|
47
53
|
reflex/.templates/web/utils/helpers/debounce.js,sha256=xGhtTRtS_xIcaeqnYVvYJNseLgQVk-DW-eFiHJYO9As,528
|
|
48
54
|
reflex/.templates/web/utils/helpers/paste.js,sha256=ef30HsR83jRzzvZnl8yV79yqFP8TC_u8SlN99cCS_OM,1799
|
|
49
55
|
reflex/.templates/web/utils/helpers/range.js,sha256=Bjr7Ex1Mghpsopjfrcp__IVFw8F8AsMiP-0nE20ZZwk,1091
|
|
50
56
|
reflex/.templates/web/utils/helpers/throttle.js,sha256=qxeyaEojaTeX36FPGftzVWrzDsRQU4iqg3U9RJz9Vj4,566
|
|
51
|
-
reflex/.templates/web/utils/state.js,sha256=4qK7Xshvif92_LjfiBBCKymPNhfa5O7syFpvZ4oDe1U,30529
|
|
52
|
-
reflex/__init__.py,sha256=64HB9b6MKesl3Yv6aZMsozdMKKpgnxirKk-aeN45UYY,10341
|
|
53
|
-
reflex/__init__.pyi,sha256=j4ZkO-mKKw5dFBhJVbaOg7AlncO-JCckV2cHENPiLG0,11303
|
|
54
|
-
reflex/__main__.py,sha256=6cVrGEyT3j3tEvlEVUatpaYfbB5EF3UVY-6vc_Z7-hw,108
|
|
55
|
-
reflex/admin.py,sha256=wu_vYqB0rU2njYBJSI0XZgVEkAFVZNQNUkUUXrlFbZc,343
|
|
56
|
-
reflex/app.py,sha256=YQBe77CIgT_xTpTM-H3TIbwHUUYlHQ4UGA-K4lnzG5k,68739
|
|
57
57
|
reflex/app_mixins/__init__.py,sha256=Oegz3-gZLP9p2OAN5ALNbsgxuNQfS6lGZgQA8cc-9mQ,137
|
|
58
58
|
reflex/app_mixins/lifespan.py,sha256=fwtaa9NnyENdDa8_RUHUsT8L9qnZKxcpL-mEGLTGldo,3280
|
|
59
|
-
reflex/app_mixins/middleware.py,sha256=
|
|
59
|
+
reflex/app_mixins/middleware.py,sha256=_B33NZdbuI16IUPTENyfCmEfJ6OxFHm6rObl3JdIs-Y,3286
|
|
60
60
|
reflex/app_mixins/mixin.py,sha256=si0Pa0U1EtJc-a6iZntqU9B7_NrPILwrGFxk9mKHBCE,317
|
|
61
|
-
reflex/app_module_for_backend.py,sha256=iuEYcJNRai59vReNUIZgixtYlFHYcYp_LNFB9DPQnKs,1134
|
|
62
|
-
reflex/assets.py,sha256=PLTKAMYPKMZq8eWXKX8uco6NZ9IiPGWal0bOPLUmU7k,3364
|
|
63
|
-
reflex/base.py,sha256=T1sY7SJJOpTsOveEiFxp-K39EoIQtRLgqdFZhsdM0DE,3976
|
|
64
61
|
reflex/compiler/__init__.py,sha256=r8jqmDSFf09iV2lHlNhfc9XrTLjNxfDNwPYlxS4cmHE,27
|
|
65
|
-
reflex/compiler/compiler.py,sha256=
|
|
62
|
+
reflex/compiler/compiler.py,sha256=zuEAhMw-0dXIb54hLhYEWLVkbhvgE2E_zCga3oSPPwI,25948
|
|
66
63
|
reflex/compiler/templates.py,sha256=NX3YUMVGGyDsy2JuDv-AmklMM0pKJHLPsIpdqamgqRQ,5854
|
|
67
64
|
reflex/compiler/utils.py,sha256=w8KcAXneXQxPOSei7BvAfA9MzR4jQWjDlxm8ahN1UM0,16083
|
|
68
65
|
reflex/components/__init__.py,sha256=zbIXThv1WPI0FdIGf9G9RAmGoCRoGy7nHcSZ8K5D5bA,624
|
|
69
66
|
reflex/components/__init__.pyi,sha256=qoj1zIWaitcZOGcJ6k7wuGJk_GAJCE9Xtx8CeRVrvoE,861
|
|
67
|
+
reflex/components/component.py,sha256=ksc0Vc3hgZkTEyDZksarETCrjA-pvDMnd7T11F01ecg,88766
|
|
68
|
+
reflex/components/dynamic.py,sha256=W-jNbNzll1w6YoMcoF-LMjHqP4UtoQHPV-NamXs-eAY,7220
|
|
69
|
+
reflex/components/literals.py,sha256=hogLnwTJxFJODIvqihg-GD9kFZVsEBDoYzaRit56Nuk,501
|
|
70
|
+
reflex/components/props.py,sha256=8F2ZNeF16BDiTh-E4F-U_vks41BMJgmkTM7xbjGvfOA,2593
|
|
70
71
|
reflex/components/base/__init__.py,sha256=QIOxOPT87WrSE4TSHAsZ-358VzvUXAe1w8vWogQ3Uuo,730
|
|
71
72
|
reflex/components/base/__init__.pyi,sha256=c-8lUF9MAgAo9OHMjKIrV2ScM5S0fg8gTXp3iYFwVKU,1055
|
|
72
73
|
reflex/components/base/app_wrap.py,sha256=5K_myvYvHPeAJbm3BdEX17tKvdNEj6SV9RYahbIQBAQ,514
|
|
@@ -90,7 +91,6 @@ reflex/components/base/script.py,sha256=OZ2ZOWiEmzHRC0-OgH4qj_Dv6X-JSsX5OgaqLXld
|
|
|
90
91
|
reflex/components/base/script.pyi,sha256=EvSAPlUHpYYtnSV7YVwaJao9-bhWIs3EpBzDE4T88W8,3505
|
|
91
92
|
reflex/components/base/strict_mode.py,sha256=_Rl2uGzL8gXTANOpoSU7uxsUQRH5JeTk2EIceWJJa5E,251
|
|
92
93
|
reflex/components/base/strict_mode.pyi,sha256=VpwCCPcubG0pdvzPKYLv8rBi730fUsySQfNCGAUuADM,2178
|
|
93
|
-
reflex/components/component.py,sha256=ksc0Vc3hgZkTEyDZksarETCrjA-pvDMnd7T11F01ecg,88766
|
|
94
94
|
reflex/components/core/__init__.py,sha256=1Z5MUA5wRPi4w7TXzRFyCfxbG8lUMqs29buWHIGG-CU,1321
|
|
95
95
|
reflex/components/core/__init__.pyi,sha256=HDZSx-RIBpryukJo8ECdxSnZwpThP0IR2LV66h1XyJ4,2046
|
|
96
96
|
reflex/components/core/auto_scroll.py,sha256=3jtFUqMUM1R_YyxWjbNVLiLktw6HHp50EzIFTkFtgto,3616
|
|
@@ -109,13 +109,13 @@ reflex/components/core/debounce.pyi,sha256=QjyPCR1eVGxTdDFnFPD9Ir9QbJLk-2xU8f-hS
|
|
|
109
109
|
reflex/components/core/foreach.py,sha256=s2wgxcgEBc_8PfTKolDjbRz1pgdKZCdq8tqk87t3QVQ,5827
|
|
110
110
|
reflex/components/core/html.py,sha256=RnFLDLSNqNz3ypSEH5CRV3YcjGzuZ33ok2qSYd9LzQQ,1299
|
|
111
111
|
reflex/components/core/html.pyi,sha256=-v5BiB_x-pqNUF5b-Ewil_UmK0Gz5BgiX1OPYE6o9qE,8742
|
|
112
|
-
reflex/components/core/layout/__init__.py,sha256=znldZaj_NGt8qCZDG70GMwjMTskcvCf_2N_EjCAHwdc,30
|
|
113
112
|
reflex/components/core/match.py,sha256=M39oK1DxnfU1GW07_78mo8vYttR7PP-jH7WZY111iRQ,9112
|
|
114
113
|
reflex/components/core/responsive.py,sha256=ACZdtJ4a4F8B3dm1k8h6J2_UJx0Z5LDB7XHQ2ty4wAc,1911
|
|
115
114
|
reflex/components/core/sticky.py,sha256=2B3TxrwG2Rtp_lv1VkMOIF2bqSiT7qYGbqbiZiMKxKY,3856
|
|
116
115
|
reflex/components/core/sticky.pyi,sha256=fHmH_EwTvrVUHbq-13fT-TK0R_yUMBSc2Hp-1IowpTM,32071
|
|
117
|
-
reflex/components/core/upload.py,sha256=
|
|
116
|
+
reflex/components/core/upload.py,sha256=mBGavdmP1A-xySEsMi6Emi0mffJ1p-BQj7mscLlPBmA,11913
|
|
118
117
|
reflex/components/core/upload.pyi,sha256=ZK22Hnc4eXhOsRbrAbakrzM5oGk05DdRHWurBNI5HRM,14602
|
|
118
|
+
reflex/components/core/layout/__init__.py,sha256=znldZaj_NGt8qCZDG70GMwjMTskcvCf_2N_EjCAHwdc,30
|
|
119
119
|
reflex/components/datadisplay/__init__.py,sha256=L8pWWKNHWdUD2fbZRoEKjd_8c_hpDdGYO463hwkoIi4,438
|
|
120
120
|
reflex/components/datadisplay/__init__.pyi,sha256=rYMwO_X4NvUex6IL2MMTnhdFRp8Lz5zweMwXaW_l7nc,588
|
|
121
121
|
reflex/components/datadisplay/code.py,sha256=5tO--QgPJj3-hBNjQ3SGNgLYpjBwTwtOUnWM5oLU4Kg,14674
|
|
@@ -125,15 +125,14 @@ reflex/components/datadisplay/dataeditor.pyi,sha256=Q85OI-lq1iIbcQv5AEQD2SZc5Qh0
|
|
|
125
125
|
reflex/components/datadisplay/logo.py,sha256=5YeXXIg19jJdY-KMP1_WJNmrh0oVSy4axy8Pbp275es,1981
|
|
126
126
|
reflex/components/datadisplay/shiki_code_block.py,sha256=H1sJ26aqUSO6_RQRo5DeFPGCSaKdN0dgpCFowy3bcUY,23740
|
|
127
127
|
reflex/components/datadisplay/shiki_code_block.pyi,sha256=fW2igOLVSfB4qaaOXQJMo9dyJbH1pfUESd7yBec9Tak,56361
|
|
128
|
-
reflex/components/dynamic.py,sha256=W-jNbNzll1w6YoMcoF-LMjHqP4UtoQHPV-NamXs-eAY,7220
|
|
129
128
|
reflex/components/el/__init__.py,sha256=nfIjf_cyieEmxptKjA6wRjoongswXv4X3n6vDmsdarI,416
|
|
130
129
|
reflex/components/el/__init__.pyi,sha256=hp8dLScFQR0avzEAKrB_GKk8iFty184mLcVij6IQ3Vc,10894
|
|
130
|
+
reflex/components/el/element.py,sha256=CFUa_6Dz4WsIdP11MzqlW9GBDhJcSU6lJSmWA9zap0c,501
|
|
131
|
+
reflex/components/el/element.pyi,sha256=pP5jMTGjYm06d8ZaQGeQazx5PuFLLlBDXcZB7cC7kp8,2166
|
|
131
132
|
reflex/components/el/constants/__init__.py,sha256=9h2hdnOSltQLDEM6w1nGmv1B8Bf0tMquTCi5RhvBT6c,113
|
|
132
133
|
reflex/components/el/constants/html.py,sha256=hIebFwWritMmd3VCMYBNg0k_2UM1QDIhT_Q-EQsCWEA,7175
|
|
133
134
|
reflex/components/el/constants/react.py,sha256=f1-Vo8iWn2jSrR7vy-UwGbGRvw88UUZnbb3Rb56MSS4,15554
|
|
134
135
|
reflex/components/el/constants/reflex.py,sha256=7ChVeOvzjovZLHa-4vjWEGDqHsefV3tNsa8TKHWFaXM,1697
|
|
135
|
-
reflex/components/el/element.py,sha256=CFUa_6Dz4WsIdP11MzqlW9GBDhJcSU6lJSmWA9zap0c,501
|
|
136
|
-
reflex/components/el/element.pyi,sha256=pP5jMTGjYm06d8ZaQGeQazx5PuFLLlBDXcZB7cC7kp8,2166
|
|
137
136
|
reflex/components/el/elements/__init__.py,sha256=tHmTJKW02etckBiNqKwu7y_OwqFFSOscKEtzfhOygCM,2697
|
|
138
137
|
reflex/components/el/elements/__init__.pyi,sha256=1rtYb-IgDJ6sbVuC83V_9gS5d6oSsFmVTerlsPCdfiw,11075
|
|
139
138
|
reflex/components/el/elements/base.py,sha256=4jnwyCQUHvWcIfwiIWVCiIC_jbwZlkAiOgx73t7tdw8,3075
|
|
@@ -159,7 +158,6 @@ reflex/components/el/elements/typography.pyi,sha256=TTXR78HfvJ0sjYYqhny-RqZTe7tV
|
|
|
159
158
|
reflex/components/gridjs/__init__.py,sha256=xJwDm1AZ70L5-t9LLqZwGUtDpijbf1KuMYDT-j8g3pM,88
|
|
160
159
|
reflex/components/gridjs/datatable.py,sha256=Q2P2lFbPEujVa6bfetV0w4Oc81APX9YgVKGnKCvhSxY,4197
|
|
161
160
|
reflex/components/gridjs/datatable.pyi,sha256=zVZTSTTQJY5jjrCTnyah3XM6aySyhq_mbhBWnbFg6Io,4859
|
|
162
|
-
reflex/components/literals.py,sha256=hogLnwTJxFJODIvqihg-GD9kFZVsEBDoYzaRit56Nuk,501
|
|
163
161
|
reflex/components/lucide/__init__.py,sha256=EggTK2MuQKQeOBLKW-mF0VaDK9zdWBImu1HO2dvHZbE,73
|
|
164
162
|
reflex/components/lucide/icon.py,sha256=jwwQGyoUXItWh991O2l4Jh2j9Caocmt5J0KXJwdaZ3o,33849
|
|
165
163
|
reflex/components/lucide/icon.pyi,sha256=DZkrFkUSq-BT23taozAIDfPuHAF3V9AsVYwaEeOCgm0,35884
|
|
@@ -179,9 +177,8 @@ reflex/components/next/link.pyi,sha256=2-IJbrQ132FlLraBxYEXaVtVZ-Mr8fHPY--veOL5A
|
|
|
179
177
|
reflex/components/next/video.py,sha256=GNCIPnT4pPPVp5W5P9CezVPksxCFO-YSlb2TJSJ1sG4,703
|
|
180
178
|
reflex/components/next/video.pyi,sha256=z7nX_P2rSBgFIAMhqOVEbExCJM8srSdEczR2QXcPTrg,2315
|
|
181
179
|
reflex/components/plotly/__init__.py,sha256=6B_woBJhkrVA9O_AbOTbsA_SxWsqjicYHmLA9FLjGfU,650
|
|
182
|
-
reflex/components/plotly/plotly.py,sha256=
|
|
180
|
+
reflex/components/plotly/plotly.py,sha256=N4aTmIfUG7UfCjH2gnSrbOTUSkQqBswbPj0nD9rwB8A,14853
|
|
183
181
|
reflex/components/plotly/plotly.pyi,sha256=Qsxuz3ltLozNpk40e8iY92X8sos4hI7NhXAVqAndzkg,46843
|
|
184
|
-
reflex/components/props.py,sha256=8F2ZNeF16BDiTh-E4F-U_vks41BMJgmkTM7xbjGvfOA,2593
|
|
185
182
|
reflex/components/radix/__init__.py,sha256=fRsLvIO3MrTtPOXtmnxYDB9phvzlcbyB_utgpafYMho,474
|
|
186
183
|
reflex/components/radix/__init__.pyi,sha256=YpWw_k35yv_Yq_0RZNCb52fJZ3dANWAnQllhVoVCWEE,3988
|
|
187
184
|
reflex/components/radix/primitives/__init__.py,sha256=R2sdZJqQCYaLScGkXnXDKAjVgV5MidceemooEUtvBt4,443
|
|
@@ -328,10 +325,10 @@ reflex/components/recharts/general.py,sha256=ff3Y4cXV9H8XruN0eyHUDf11mV3cGXWFaVl
|
|
|
328
325
|
reflex/components/recharts/general.pyi,sha256=sRJUwnNfsQ-ASS5OE4qTknNKq5MgN1u4G3nv7K2xARg,22643
|
|
329
326
|
reflex/components/recharts/polar.py,sha256=82KtPsk0RcW1Ci7B3Uivja8gM7vJ8l_LorVKFNVeLVE,15549
|
|
330
327
|
reflex/components/recharts/polar.pyi,sha256=VkxCu6MyYxn-g-yYdfRy8LofpsmRsxa9M589U8E3Dr4,26369
|
|
331
|
-
reflex/components/recharts/recharts.py,sha256=
|
|
328
|
+
reflex/components/recharts/recharts.py,sha256=is9FG2MJ6aYsZLDe1uW4zWNRs7LNJFKVbAndYC77jqA,3176
|
|
332
329
|
reflex/components/recharts/recharts.pyi,sha256=Vr-YW67RKqg-Tzp2YBvkRS-sQc-9jA8wZr1P-Vxm7qg,6711
|
|
333
330
|
reflex/components/sonner/__init__.py,sha256=L_mdRIy7-ccRGSz5VK6J8O-c-e-D1p9xWw29_ErrvGg,68
|
|
334
|
-
reflex/components/sonner/toast.py,sha256
|
|
331
|
+
reflex/components/sonner/toast.py,sha256=hvjzVN3eclix7PJpDTVkFSD_Re8X0lCPjHh5EfRjDro,12440
|
|
335
332
|
reflex/components/sonner/toast.pyi,sha256=MDb952Jblm4HQOIEtZOCEL2UPYHAuY0xwqFBnZL2n38,7461
|
|
336
333
|
reflex/components/suneditor/__init__.py,sha256=htkPzy0O_1ro1nw8w8gFPjYhg5xywMpsUfc4Dl3OHuw,109
|
|
337
334
|
reflex/components/suneditor/editor.py,sha256=8Unbp3mv7Fxjvsxy-uvTBf6hYaCnkwkK6-exPF5ymRU,8017
|
|
@@ -342,22 +339,20 @@ reflex/components/tags/iter_tag.py,sha256=AgKtcRvuxUe8QJPU8iQp6HvOQwdENjlYFO8dYs
|
|
|
342
339
|
reflex/components/tags/match_tag.py,sha256=3lba1H5pCcKkqxEHzM6DZb5s9s0yJLN4Se3vdhzar24,580
|
|
343
340
|
reflex/components/tags/tag.py,sha256=1fopahujLVjH871UOdmau_n1kEddbQotN5MpKW_s8PU,3644
|
|
344
341
|
reflex/components/tags/tagless.py,sha256=qO7Gm4V0ITDyymHkyltfz53155ZBt-W_WIPDYy93ca0,587
|
|
345
|
-
reflex/
|
|
346
|
-
reflex/constants/
|
|
347
|
-
reflex/constants/base.py,sha256=RfzOQdfJcQhVoIQRBNRAcIMyhllIHFd2hRZ37P1N28E,7837
|
|
342
|
+
reflex/constants/__init__.py,sha256=c5k9wh50zB_zDXkublXepPZsfAmnYx7ZeNSufIX5qKM,2180
|
|
343
|
+
reflex/constants/base.py,sha256=dB-gHb19wYdT_oQHxg0rxFIqM7ljtcr2BCOZDgHEawg,7937
|
|
348
344
|
reflex/constants/colors.py,sha256=cgLn8iEWtlpjQgbhhlCOGjbhfOULKnzqqzPph63SJoI,1613
|
|
349
345
|
reflex/constants/compiler.py,sha256=7EdvrKNyr-C7e2T6Xmvd5gpTo5rh4SAHZpmQFV1rrM4,5676
|
|
350
346
|
reflex/constants/config.py,sha256=4EljK_fD1Nf4-OfJ9HLYeHSW5xTfNPN6AGjzJ5ARZSY,1579
|
|
351
347
|
reflex/constants/custom_components.py,sha256=joJt4CEt1yKy7wsBH6vYo7_QRW0O_fWXrrTf0VY2q14,1317
|
|
352
348
|
reflex/constants/event.py,sha256=8PWobGXnUIbkRS73dRiroj5BJw4C3sbo5AHAhJTZFyM,2849
|
|
353
|
-
reflex/constants/installer.py,sha256=
|
|
349
|
+
reflex/constants/installer.py,sha256=Ia117STVw-ySvOK0hRFlwsI1yJ8ucWiPCh5JWuFQjXs,2518
|
|
354
350
|
reflex/constants/route.py,sha256=J4QVdeeYz9wX0lYT1sgx0m3kLSArDHzmGCDZ2sqy854,2139
|
|
355
351
|
reflex/constants/state.py,sha256=6Mfr7xVcAZOj5aSy7kp0W6r8oTs7K30URgGDAAFLfPQ,294
|
|
356
352
|
reflex/constants/style.py,sha256=EPgRYHhAlcrPUBc2HkDTdTj-Q0uDAXHlq8Sp6D35Zf4,475
|
|
357
353
|
reflex/constants/utils.py,sha256=GJhFj1uba54CDPEm70tWs8B5iS2siHgeNi--oGCjeRc,759
|
|
358
354
|
reflex/custom_components/__init__.py,sha256=R4zsvOi4dfPmHc18KEphohXnQFBPnUCb50cMR5hSLDE,36
|
|
359
355
|
reflex/custom_components/custom_components.py,sha256=62mG6tCj6nt6t_UYFu8Vcjsv7PiqABiJRQ-xsYGYsX0,33376
|
|
360
|
-
reflex/event.py,sha256=EX-9X-c8gIudZjRDG8qSrVAbegcaGkYXxLLRWg-7IOA,60758
|
|
361
356
|
reflex/experimental/__init__.py,sha256=bvJ6qFeO3xT3L-8IBtk4ecoi5rda3EDvblgNP60yhEo,2206
|
|
362
357
|
reflex/experimental/client_state.py,sha256=p_Toz94fNQGMbHY1WlwfQ-i_M01f1ExA9t1iokSvdLc,9880
|
|
363
358
|
reflex/experimental/hooks.py,sha256=CHYGrAE5t8riltrJmDFgJ4D2Vhmhw-y3B3MSGNlOQow,2366
|
|
@@ -373,33 +368,25 @@ reflex/istate/wrappers.py,sha256=p8uuioXRbR5hperwbOJHUcWdu7hukLikQdoR7qrnKsI,909
|
|
|
373
368
|
reflex/middleware/__init__.py,sha256=x7xTeDuc73Hjj43k1J63naC9x8vzFxl4sq7cCFBX7sk,111
|
|
374
369
|
reflex/middleware/hydrate_middleware.py,sha256=1ch7bx2ZhojOR15b-LHD2JztrWCnpPJjTe8MWHJe-5Y,1510
|
|
375
370
|
reflex/middleware/middleware.py,sha256=p5VVoIgQ_NwOg_GOY6g0S4fmrV76_VE1zt-HiwbMw-s,1158
|
|
376
|
-
reflex/model.py,sha256=k6qCweATPW1YRB_qcHwa5X35btJmtIlB4zEQ63FaW3w,17527
|
|
377
|
-
reflex/page.py,sha256=qEt8n5EtawSywCzdsiaNQJWhC8ie-vg8ig0JGuVavPI,2386
|
|
378
|
-
reflex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
379
|
-
reflex/reflex.py,sha256=gmYVXXASlx_4kpyYuqEASS2qNdG2lWbmVpNQ_LYeOJQ,20399
|
|
380
|
-
reflex/route.py,sha256=nn_hJwtQdjiqH_dHXfqMGWKllnyPQZTSR-KWdHDhoOs,4210
|
|
381
|
-
reflex/state.py,sha256=VmXm7SNuecE2y3sZo4yu-JW7frlb3Wi6V2o4A3it4eQ,141566
|
|
382
|
-
reflex/style.py,sha256=dilXPn8de80NzsXT53GPJrmjELC5nPYIlCgongyq1zM,13145
|
|
383
|
-
reflex/testing.py,sha256=c3boyBotUiDImK1lsO-Odeb4tgqRAvRdaT1lZ9QzPHg,35458
|
|
384
371
|
reflex/utils/__init__.py,sha256=y-AHKiRQAhk2oAkvn7W8cRVTZVK625ff8tTwvZtO7S4,24
|
|
385
|
-
reflex/utils/build.py,sha256=
|
|
372
|
+
reflex/utils/build.py,sha256=yt6obelsj1MUhTVHoaxdOH--gYtIEpekYjTN97iFrNg,9118
|
|
386
373
|
reflex/utils/codespaces.py,sha256=TzDK--pHwP4r8Nzl0iB_8r-cOFmmL6nHfZ9xRQHA-KY,2754
|
|
387
374
|
reflex/utils/compat.py,sha256=aSJH_M6iomgHPQ4onQ153xh1MWqPi3HSYDzE68N6gZM,2635
|
|
388
375
|
reflex/utils/console.py,sha256=slDTb_5QXfSvdflFiwJauc874R2zqo8BOSh37JUhYLY,9469
|
|
389
376
|
reflex/utils/decorator.py,sha256=EYdAjPdfgFjqjYSmLlc9qzOYnoihzavG5T4tgVgzsw4,1171
|
|
390
377
|
reflex/utils/exceptions.py,sha256=Wwu7Ji2xgq521bJKtU2NgjwhmFfnG8erirEVN2h8S-g,8884
|
|
391
|
-
reflex/utils/exec.py,sha256
|
|
378
|
+
reflex/utils/exec.py,sha256=-Y60GJ5R2UzJDS-r5qq3FMszqWf1Zu25jSnmyEc7No4,17155
|
|
392
379
|
reflex/utils/export.py,sha256=bcJA0L8lBbjij-5PU93ka2c1d_yJqrIurp5u4mN5f68,2537
|
|
393
380
|
reflex/utils/format.py,sha256=a8em_yzqp9pLTrPXRsdzFWSO1qL2x25BpJXOf9DV1t8,20638
|
|
394
381
|
reflex/utils/imports.py,sha256=-EkUt9y5U3qmImjfpsXwYh7JI9qJHd_L6X9y12EPJew,3921
|
|
395
382
|
reflex/utils/lazy_loader.py,sha256=-3DcwIqHNft2fb1ikgDYAMiEwNfbiWfrTBAf1gEVX2o,1367
|
|
396
383
|
reflex/utils/net.py,sha256=0Yd9OLK8R_px2sqnqrDkTky6hYHtG2pEDvvilOjDfjc,1219
|
|
397
|
-
reflex/utils/path_ops.py,sha256=
|
|
398
|
-
reflex/utils/prerequisites.py,sha256=
|
|
399
|
-
reflex/utils/processes.py,sha256=
|
|
384
|
+
reflex/utils/path_ops.py,sha256=idGxUSJRKwYLLi7ppXkq3eV6rvAytJoO-n-FuLkwl3o,7604
|
|
385
|
+
reflex/utils/prerequisites.py,sha256=GqpzAu-RAtInXzsGPBIoOYfiJwa-Oi4STUMbt0A_J-Y,61006
|
|
386
|
+
reflex/utils/processes.py,sha256=aLdE5YzMYRuAhuSsoRWVT7yMlQczReNvNx-ItLKTnSY,13575
|
|
400
387
|
reflex/utils/pyi_generator.py,sha256=cKdssbtAtGj2deOSDos9OF96w10qte8JM-TlfbzSdtw,41602
|
|
401
388
|
reflex/utils/redir.py,sha256=kTqY2WSouF5_ftOe5bnvPEyU3SLpg3pcysTcxFH1UxI,1505
|
|
402
|
-
reflex/utils/registry.py,sha256=
|
|
389
|
+
reflex/utils/registry.py,sha256=6DPfYc64GodbhwdAZ113_zBsvMNdbFTIJ94qDH1N6wc,1410
|
|
403
390
|
reflex/utils/serializers.py,sha256=K8-erpNIjJNIKif0cDFExa9f5DEVuQUq0j5v5VH6aBI,13408
|
|
404
391
|
reflex/utils/telemetry.py,sha256=qwJBwjdtAV-OGKgO4h-NWhgTvfC3gbduBdn1UB8Ikes,5608
|
|
405
392
|
reflex/utils/types.py,sha256=nGX44Q_Jp33wIaxf2vxANwBWe1743V2B8RRS8H9yV4c,33449
|
|
@@ -411,4 +398,8 @@ reflex/vars/function.py,sha256=2sVnhgetPSwtor8VFtAiYJdzZ9IRNzAKdsUJG6dXQcE,14461
|
|
|
411
398
|
reflex/vars/number.py,sha256=hacFEtv-63tMQN-oeVDWkrLFQL4utYG-b3ahYTb8b4M,29573
|
|
412
399
|
reflex/vars/object.py,sha256=-fGqHThozjxAAuQL-wTwEItPiFI-ps53P2bKoSlW_As,17081
|
|
413
400
|
reflex/vars/sequence.py,sha256=wxyiTV-_-N6FJNufIatubsnhEpXHFShcw3GEEEpYy3M,55893
|
|
414
|
-
reflex-0.7.
|
|
401
|
+
reflex-0.7.4a0.dist-info/METADATA,sha256=HUqbkhffmwIj_1bWqiE0sPZMbIFHRtLOFTjV7-JOT5Y,12090
|
|
402
|
+
reflex-0.7.4a0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
403
|
+
reflex-0.7.4a0.dist-info/entry_points.txt,sha256=Rxt4dXc7MLBNt5CSHTehVPuSe9Xqow4HLX55nD9tQQ0,45
|
|
404
|
+
reflex-0.7.4a0.dist-info/licenses/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
|
|
405
|
+
reflex-0.7.4a0.dist-info/RECORD,,
|
benchmarks/__init__.py
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
"""Extracts the compile times from the JSON files in the specified directory and inserts them into the database."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import argparse
|
|
6
|
-
import json
|
|
7
|
-
import os
|
|
8
|
-
from pathlib import Path
|
|
9
|
-
|
|
10
|
-
from utils import send_data_to_posthog
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def extract_stats_from_json(json_file: str) -> list[dict]:
|
|
14
|
-
"""Extracts the stats from the JSON data and returns them as a list of dictionaries.
|
|
15
|
-
|
|
16
|
-
Args:
|
|
17
|
-
json_file: The JSON file to extract the stats data from.
|
|
18
|
-
|
|
19
|
-
Returns:
|
|
20
|
-
list[dict]: The stats for each test.
|
|
21
|
-
"""
|
|
22
|
-
with Path(json_file).open() as file:
|
|
23
|
-
json_data = json.load(file)
|
|
24
|
-
|
|
25
|
-
# Load the JSON data if it is a string, otherwise assume it's already a dictionary
|
|
26
|
-
data = json.loads(json_data) if isinstance(json_data, str) else json_data
|
|
27
|
-
|
|
28
|
-
# Initialize an empty list to store the stats for each test
|
|
29
|
-
test_stats = []
|
|
30
|
-
|
|
31
|
-
# Iterate over each test in the 'benchmarks' list
|
|
32
|
-
for test in data.get("benchmarks", []):
|
|
33
|
-
group = test.get("group", None)
|
|
34
|
-
stats = test.get("stats", {})
|
|
35
|
-
full_name = test.get("fullname")
|
|
36
|
-
file_name = (
|
|
37
|
-
full_name.split("/")[-1].split("::")[0].strip(".py") if full_name else None
|
|
38
|
-
)
|
|
39
|
-
test_name = test.get("name", "Unknown Test")
|
|
40
|
-
|
|
41
|
-
test_stats.append(
|
|
42
|
-
{
|
|
43
|
-
"test_name": test_name,
|
|
44
|
-
"group": group,
|
|
45
|
-
"stats": stats,
|
|
46
|
-
"full_name": full_name,
|
|
47
|
-
"file_name": file_name,
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
return test_stats
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
def insert_benchmarking_data(
|
|
54
|
-
os_type_version: str,
|
|
55
|
-
python_version: str,
|
|
56
|
-
performance_data: list[dict],
|
|
57
|
-
commit_sha: str,
|
|
58
|
-
pr_title: str,
|
|
59
|
-
branch_name: str,
|
|
60
|
-
event_type: str,
|
|
61
|
-
pr_id: str,
|
|
62
|
-
):
|
|
63
|
-
"""Insert the benchmarking data into the database.
|
|
64
|
-
|
|
65
|
-
Args:
|
|
66
|
-
os_type_version: The OS type and version to insert.
|
|
67
|
-
python_version: The Python version to insert.
|
|
68
|
-
performance_data: The performance data of reflex web to insert.
|
|
69
|
-
commit_sha: The commit SHA to insert.
|
|
70
|
-
pr_title: The PR title to insert.
|
|
71
|
-
branch_name: The name of the branch.
|
|
72
|
-
event_type: Type of github event(push, pull request, etc).
|
|
73
|
-
pr_id: Id of the PR.
|
|
74
|
-
"""
|
|
75
|
-
# Prepare the event data
|
|
76
|
-
properties = {
|
|
77
|
-
"os": os_type_version,
|
|
78
|
-
"python_version": python_version,
|
|
79
|
-
"distinct_id": commit_sha,
|
|
80
|
-
"pr_title": pr_title,
|
|
81
|
-
"branch_name": branch_name,
|
|
82
|
-
"event_type": event_type,
|
|
83
|
-
"performance": performance_data,
|
|
84
|
-
"pr_id": pr_id,
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
send_data_to_posthog("simple_app_benchmark", properties)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
def main():
|
|
91
|
-
"""Runs the benchmarks and inserts the results."""
|
|
92
|
-
# Get the commit SHA and JSON directory from the command line arguments
|
|
93
|
-
parser = argparse.ArgumentParser(description="Run benchmarks and process results.")
|
|
94
|
-
parser.add_argument(
|
|
95
|
-
"--os", help="The OS type and version to insert into the database."
|
|
96
|
-
)
|
|
97
|
-
parser.add_argument(
|
|
98
|
-
"--python-version", help="The Python version to insert into the database."
|
|
99
|
-
)
|
|
100
|
-
parser.add_argument(
|
|
101
|
-
"--commit-sha", help="The commit SHA to insert into the database."
|
|
102
|
-
)
|
|
103
|
-
parser.add_argument(
|
|
104
|
-
"--benchmark-json",
|
|
105
|
-
help="The JSON file containing the benchmark results.",
|
|
106
|
-
)
|
|
107
|
-
parser.add_argument(
|
|
108
|
-
"--pr-title",
|
|
109
|
-
help="The PR title to insert into the database.",
|
|
110
|
-
)
|
|
111
|
-
parser.add_argument(
|
|
112
|
-
"--branch-name",
|
|
113
|
-
help="The current branch",
|
|
114
|
-
required=True,
|
|
115
|
-
)
|
|
116
|
-
parser.add_argument(
|
|
117
|
-
"--event-type",
|
|
118
|
-
help="The github event type",
|
|
119
|
-
required=True,
|
|
120
|
-
)
|
|
121
|
-
parser.add_argument(
|
|
122
|
-
"--pr-id",
|
|
123
|
-
help="ID of the PR.",
|
|
124
|
-
required=True,
|
|
125
|
-
)
|
|
126
|
-
args = parser.parse_args()
|
|
127
|
-
|
|
128
|
-
# Get the PR title from env or the args. For the PR merge or push event, there is no PR title, leaving it empty.
|
|
129
|
-
pr_title = args.pr_title or os.getenv("PR_TITLE", "")
|
|
130
|
-
|
|
131
|
-
# Get the results of pytest benchmarks
|
|
132
|
-
cleaned_benchmark_results = extract_stats_from_json(args.benchmark_json)
|
|
133
|
-
# Insert the data into the database
|
|
134
|
-
insert_benchmarking_data(
|
|
135
|
-
os_type_version=args.os,
|
|
136
|
-
python_version=args.python_version,
|
|
137
|
-
performance_data=cleaned_benchmark_results,
|
|
138
|
-
commit_sha=args.commit_sha,
|
|
139
|
-
pr_title=pr_title,
|
|
140
|
-
branch_name=args.branch_name,
|
|
141
|
-
event_type=args.event_type,
|
|
142
|
-
pr_id=args.pr_id,
|
|
143
|
-
)
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
if __name__ == "__main__":
|
|
147
|
-
main()
|
benchmarks/benchmark_imports.py
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"""Extract and upload benchmarking data to PostHog."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import argparse
|
|
6
|
-
import json
|
|
7
|
-
import os
|
|
8
|
-
from pathlib import Path
|
|
9
|
-
|
|
10
|
-
from utils import send_data_to_posthog
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def extract_stats_from_json(json_file: str) -> dict:
|
|
14
|
-
"""Extracts the stats from the JSON data and returns them as dictionaries.
|
|
15
|
-
|
|
16
|
-
Args:
|
|
17
|
-
json_file: The JSON file to extract the stats data from.
|
|
18
|
-
|
|
19
|
-
Returns:
|
|
20
|
-
dict: The stats for each test.
|
|
21
|
-
"""
|
|
22
|
-
with Path(json_file).open() as file:
|
|
23
|
-
json_data = json.load(file)
|
|
24
|
-
|
|
25
|
-
# Load the JSON data if it is a string, otherwise assume it's already a dictionary
|
|
26
|
-
data = json.loads(json_data) if isinstance(json_data, str) else json_data
|
|
27
|
-
|
|
28
|
-
result = data.get("results", [{}])[0]
|
|
29
|
-
return {
|
|
30
|
-
k: v
|
|
31
|
-
for k, v in result.items()
|
|
32
|
-
if k in ("mean", "stddev", "median", "min", "max")
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def insert_benchmarking_data(
|
|
37
|
-
os_type_version: str,
|
|
38
|
-
python_version: str,
|
|
39
|
-
performance_data: dict,
|
|
40
|
-
commit_sha: str,
|
|
41
|
-
pr_title: str,
|
|
42
|
-
branch_name: str,
|
|
43
|
-
pr_id: str,
|
|
44
|
-
app_name: str,
|
|
45
|
-
):
|
|
46
|
-
"""Insert the benchmarking data into the database.
|
|
47
|
-
|
|
48
|
-
Args:
|
|
49
|
-
os_type_version: The OS type and version to insert.
|
|
50
|
-
python_version: The Python version to insert.
|
|
51
|
-
performance_data: The imports performance data to insert.
|
|
52
|
-
commit_sha: The commit SHA to insert.
|
|
53
|
-
pr_title: The PR title to insert.
|
|
54
|
-
branch_name: The name of the branch.
|
|
55
|
-
pr_id: Id of the PR.
|
|
56
|
-
app_name: The name of the app being measured.
|
|
57
|
-
"""
|
|
58
|
-
properties = {
|
|
59
|
-
"os": os_type_version,
|
|
60
|
-
"python_version": python_version,
|
|
61
|
-
"distinct_id": commit_sha,
|
|
62
|
-
"pr_title": pr_title,
|
|
63
|
-
"branch_name": branch_name,
|
|
64
|
-
"pr_id": pr_id,
|
|
65
|
-
"performance": performance_data,
|
|
66
|
-
"app_name": app_name,
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
send_data_to_posthog("import_benchmark", properties)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
def main():
|
|
73
|
-
"""Runs the benchmarks and inserts the results."""
|
|
74
|
-
# Get the commit SHA and JSON directory from the command line arguments
|
|
75
|
-
parser = argparse.ArgumentParser(description="Run benchmarks and process results.")
|
|
76
|
-
parser.add_argument(
|
|
77
|
-
"--os", help="The OS type and version to insert into the database."
|
|
78
|
-
)
|
|
79
|
-
parser.add_argument(
|
|
80
|
-
"--python-version", help="The Python version to insert into the database."
|
|
81
|
-
)
|
|
82
|
-
parser.add_argument(
|
|
83
|
-
"--commit-sha", help="The commit SHA to insert into the database."
|
|
84
|
-
)
|
|
85
|
-
parser.add_argument(
|
|
86
|
-
"--benchmark-json",
|
|
87
|
-
help="The JSON file containing the benchmark results.",
|
|
88
|
-
)
|
|
89
|
-
parser.add_argument(
|
|
90
|
-
"--pr-title",
|
|
91
|
-
help="The PR title to insert into the database.",
|
|
92
|
-
)
|
|
93
|
-
parser.add_argument(
|
|
94
|
-
"--branch-name",
|
|
95
|
-
help="The current branch",
|
|
96
|
-
required=True,
|
|
97
|
-
)
|
|
98
|
-
parser.add_argument(
|
|
99
|
-
"--app-name",
|
|
100
|
-
help="The name of the app measured.",
|
|
101
|
-
required=True,
|
|
102
|
-
)
|
|
103
|
-
parser.add_argument(
|
|
104
|
-
"--pr-id",
|
|
105
|
-
help="ID of the PR.",
|
|
106
|
-
required=True,
|
|
107
|
-
)
|
|
108
|
-
args = parser.parse_args()
|
|
109
|
-
|
|
110
|
-
# Get the PR title from env or the args. For the PR merge or push event, there is no PR title, leaving it empty.
|
|
111
|
-
pr_title = args.pr_title or os.getenv("PR_TITLE", "")
|
|
112
|
-
|
|
113
|
-
cleaned_benchmark_results = extract_stats_from_json(args.benchmark_json)
|
|
114
|
-
# Insert the data into the database
|
|
115
|
-
insert_benchmarking_data(
|
|
116
|
-
os_type_version=args.os,
|
|
117
|
-
python_version=args.python_version,
|
|
118
|
-
performance_data=cleaned_benchmark_results,
|
|
119
|
-
commit_sha=args.commit_sha,
|
|
120
|
-
pr_title=pr_title,
|
|
121
|
-
branch_name=args.branch_name,
|
|
122
|
-
app_name=args.app_name,
|
|
123
|
-
pr_id=args.pr_id,
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if __name__ == "__main__":
|
|
128
|
-
main()
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"""Extracts the Lighthouse scores from the JSON files in the specified directory and inserts them into the database."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import json
|
|
6
|
-
import sys
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
|
|
9
|
-
from utils import send_data_to_posthog
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def insert_benchmarking_data(
|
|
13
|
-
lighthouse_data: dict,
|
|
14
|
-
commit_sha: str,
|
|
15
|
-
):
|
|
16
|
-
"""Insert the benchmarking data into the database.
|
|
17
|
-
|
|
18
|
-
Args:
|
|
19
|
-
lighthouse_data: The Lighthouse data to insert.
|
|
20
|
-
commit_sha: The commit SHA to insert.
|
|
21
|
-
"""
|
|
22
|
-
properties = {
|
|
23
|
-
"distinct_id": commit_sha,
|
|
24
|
-
"lighthouse_data": lighthouse_data,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
# Send the data to PostHog
|
|
28
|
-
send_data_to_posthog("lighthouse_benchmark", properties)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def get_lighthouse_scores(directory_path: str | Path) -> dict:
|
|
32
|
-
"""Extracts the Lighthouse scores from the JSON files in the specified directory.
|
|
33
|
-
|
|
34
|
-
Args:
|
|
35
|
-
directory_path (str): The path to the directory containing the JSON files.
|
|
36
|
-
|
|
37
|
-
Returns:
|
|
38
|
-
dict: The Lighthouse scores.
|
|
39
|
-
"""
|
|
40
|
-
scores = {}
|
|
41
|
-
directory_path = Path(directory_path)
|
|
42
|
-
try:
|
|
43
|
-
for filename in directory_path.iterdir():
|
|
44
|
-
if filename.suffix == ".json" and filename.stem != "manifest":
|
|
45
|
-
data = json.loads(filename.read_text())
|
|
46
|
-
# Extract scores and add them to the dictionary with the filename as key
|
|
47
|
-
scores[data["finalUrl"].replace("http://localhost:3000/", "/")] = {
|
|
48
|
-
"performance_score": data["categories"]["performance"]["score"],
|
|
49
|
-
"accessibility_score": data["categories"]["accessibility"]["score"],
|
|
50
|
-
"best_practices_score": data["categories"]["best-practices"][
|
|
51
|
-
"score"
|
|
52
|
-
],
|
|
53
|
-
"seo_score": data["categories"]["seo"]["score"],
|
|
54
|
-
}
|
|
55
|
-
except Exception as e:
|
|
56
|
-
return {"error": e}
|
|
57
|
-
|
|
58
|
-
return scores
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
def main():
|
|
62
|
-
"""Runs the benchmarks and inserts the results into the database."""
|
|
63
|
-
# Get the commit SHA and JSON directory from the command line arguments
|
|
64
|
-
commit_sha = sys.argv[1]
|
|
65
|
-
json_dir = sys.argv[2]
|
|
66
|
-
|
|
67
|
-
# Get the Lighthouse scores
|
|
68
|
-
lighthouse_scores = get_lighthouse_scores(json_dir)
|
|
69
|
-
|
|
70
|
-
# Insert the data into the database
|
|
71
|
-
insert_benchmarking_data(lighthouse_scores, commit_sha)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if __name__ == "__main__":
|
|
75
|
-
main()
|