reflex 0.6.4__py3-none-any.whl → 0.6.4a2__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/config.py +6 -54
- {reflex-0.6.4.dist-info → reflex-0.6.4a2.dist-info}/METADATA +1 -1
- {reflex-0.6.4.dist-info → reflex-0.6.4a2.dist-info}/RECORD +6 -6
- {reflex-0.6.4.dist-info → reflex-0.6.4a2.dist-info}/LICENSE +0 -0
- {reflex-0.6.4.dist-info → reflex-0.6.4a2.dist-info}/WHEEL +0 -0
- {reflex-0.6.4.dist-info → reflex-0.6.4a2.dist-info}/entry_points.txt +0 -0
reflex/config.py
CHANGED
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import dataclasses
|
|
6
|
-
import enum
|
|
7
6
|
import importlib
|
|
8
|
-
import inspect
|
|
9
7
|
import os
|
|
10
8
|
import sys
|
|
11
9
|
import urllib.parse
|
|
12
10
|
from pathlib import Path
|
|
13
11
|
from typing import Any, Dict, List, Optional, Set
|
|
14
12
|
|
|
15
|
-
from typing_extensions import
|
|
13
|
+
from typing_extensions import get_type_hints
|
|
16
14
|
|
|
17
15
|
from reflex.utils.exceptions import ConfigError, EnvironmentVarValueError
|
|
18
16
|
from reflex.utils.types import GenericType, is_union, value_inside_optional
|
|
@@ -204,8 +202,8 @@ def interpret_int_env(value: str, field_name: str) -> int:
|
|
|
204
202
|
) from ve
|
|
205
203
|
|
|
206
204
|
|
|
207
|
-
def
|
|
208
|
-
"""Interpret a path environment variable value
|
|
205
|
+
def interpret_path_env(value: str, field_name: str) -> Path:
|
|
206
|
+
"""Interpret a path environment variable value.
|
|
209
207
|
|
|
210
208
|
Args:
|
|
211
209
|
value: The environment variable value.
|
|
@@ -223,41 +221,6 @@ def interpret_existing_path_env(value: str, field_name: str) -> ExistingPath:
|
|
|
223
221
|
return path
|
|
224
222
|
|
|
225
223
|
|
|
226
|
-
def interpret_path_env(value: str, field_name: str) -> Path:
|
|
227
|
-
"""Interpret a path environment variable value.
|
|
228
|
-
|
|
229
|
-
Args:
|
|
230
|
-
value: The environment variable value.
|
|
231
|
-
field_name: The field name.
|
|
232
|
-
|
|
233
|
-
Returns:
|
|
234
|
-
The interpreted value.
|
|
235
|
-
"""
|
|
236
|
-
return Path(value)
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
def interpret_enum_env(value: str, field_type: GenericType, field_name: str) -> Any:
|
|
240
|
-
"""Interpret an enum environment variable value.
|
|
241
|
-
|
|
242
|
-
Args:
|
|
243
|
-
value: The environment variable value.
|
|
244
|
-
field_type: The field type.
|
|
245
|
-
field_name: The field name.
|
|
246
|
-
|
|
247
|
-
Returns:
|
|
248
|
-
The interpreted value.
|
|
249
|
-
|
|
250
|
-
Raises:
|
|
251
|
-
EnvironmentVarValueError: If the value is invalid.
|
|
252
|
-
"""
|
|
253
|
-
try:
|
|
254
|
-
return field_type(value)
|
|
255
|
-
except ValueError as ve:
|
|
256
|
-
raise EnvironmentVarValueError(
|
|
257
|
-
f"Invalid enum value: {value} for {field_name}"
|
|
258
|
-
) from ve
|
|
259
|
-
|
|
260
|
-
|
|
261
224
|
def interpret_env_var_value(
|
|
262
225
|
value: str, field_type: GenericType, field_name: str
|
|
263
226
|
) -> Any:
|
|
@@ -289,10 +252,6 @@ def interpret_env_var_value(
|
|
|
289
252
|
return interpret_int_env(value, field_name)
|
|
290
253
|
elif field_type is Path:
|
|
291
254
|
return interpret_path_env(value, field_name)
|
|
292
|
-
elif field_type is ExistingPath:
|
|
293
|
-
return interpret_existing_path_env(value, field_name)
|
|
294
|
-
elif inspect.isclass(field_type) and issubclass(field_type, enum.Enum):
|
|
295
|
-
return interpret_enum_env(value, field_type, field_name)
|
|
296
255
|
|
|
297
256
|
else:
|
|
298
257
|
raise ValueError(
|
|
@@ -300,13 +259,6 @@ def interpret_env_var_value(
|
|
|
300
259
|
)
|
|
301
260
|
|
|
302
261
|
|
|
303
|
-
class PathExistsFlag:
|
|
304
|
-
"""Flag to indicate that a path must exist."""
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
ExistingPath = Annotated[Path, PathExistsFlag]
|
|
308
|
-
|
|
309
|
-
|
|
310
262
|
@dataclasses.dataclass(init=False)
|
|
311
263
|
class EnvironmentVariables:
|
|
312
264
|
"""Environment variables class to instantiate environment variables."""
|
|
@@ -336,7 +288,7 @@ class EnvironmentVariables:
|
|
|
336
288
|
REFLEX_WEB_WORKDIR: Path = Path(constants.Dirs.WEB)
|
|
337
289
|
|
|
338
290
|
# Path to the alembic config file
|
|
339
|
-
ALEMBIC_CONFIG:
|
|
291
|
+
ALEMBIC_CONFIG: Path = Path(constants.ALEMBIC_CONFIG)
|
|
340
292
|
|
|
341
293
|
# Disable SSL verification for HTTPX requests.
|
|
342
294
|
SSL_NO_VERIFY: bool = False
|
|
@@ -449,7 +401,7 @@ class Config(Base):
|
|
|
449
401
|
telemetry_enabled: bool = True
|
|
450
402
|
|
|
451
403
|
# The bun path
|
|
452
|
-
bun_path:
|
|
404
|
+
bun_path: Path = constants.Bun.DEFAULT_PATH
|
|
453
405
|
|
|
454
406
|
# List of origins that are allowed to connect to the backend API.
|
|
455
407
|
cors_allowed_origins: List[str] = ["*"]
|
|
@@ -573,7 +525,7 @@ class Config(Base):
|
|
|
573
525
|
)
|
|
574
526
|
|
|
575
527
|
# Interpret the value.
|
|
576
|
-
value = interpret_env_var_value(env_var, field.
|
|
528
|
+
value = interpret_env_var_value(env_var, field.type_, field.name)
|
|
577
529
|
|
|
578
530
|
# Set the value.
|
|
579
531
|
updated_values[key] = value
|
|
@@ -321,7 +321,7 @@ reflex/components/tags/iter_tag.py,sha256=jS-Y08cmzzb8v3cp52q5PaVmwirpg4n3Br9JWA
|
|
|
321
321
|
reflex/components/tags/match_tag.py,sha256=mqQF6fHhOSGSMdiaJ7YlwXSMhRtDmmIBu1Gw-VQQ324,586
|
|
322
322
|
reflex/components/tags/tag.py,sha256=_4uQZ8ACy-SSaT27F60G8MffZZ8hNpVOkPy1RnVjlFY,3166
|
|
323
323
|
reflex/components/tags/tagless.py,sha256=qO7Gm4V0ITDyymHkyltfz53155ZBt-W_WIPDYy93ca0,587
|
|
324
|
-
reflex/config.py,sha256=
|
|
324
|
+
reflex/config.py,sha256=rMwg44am7-xwZh0F4R3upO4Mxefq2PPju7AWMwatTGI,19386
|
|
325
325
|
reflex/constants/__init__.py,sha256=EhuyigQOXLv1VEKktcEvBHna8XBmLYqR-4NwGhR7yno,2149
|
|
326
326
|
reflex/constants/base.py,sha256=VjYwT1-BufAgRA5FahHww1CSE3Qe3fPGYsc1big3taE,7334
|
|
327
327
|
reflex/constants/colors.py,sha256=gab_GwjKcbpRJGS2zX0gkmc_yFT1nmQbFDHqx0mXKB0,1625
|
|
@@ -384,8 +384,8 @@ reflex/vars/function.py,sha256=z21_USAycM-FtDRTCAw9i0is6es4EEr1Z1OK-vu9ke8,5254
|
|
|
384
384
|
reflex/vars/number.py,sha256=jZO2Ol3VPKo1eM0eeHqGbDFZYdM0Oza_e_etnYKsM-Q,27452
|
|
385
385
|
reflex/vars/object.py,sha256=hiEwf9CAE1EhCoQpuRYvGtG15ZxerALDSeIwte4YEVA,14339
|
|
386
386
|
reflex/vars/sequence.py,sha256=9aCxJkPnf0qkaoj1cycKkzUsFv6kb-KKRYJe7L7gPc4,49972
|
|
387
|
-
reflex-0.6.
|
|
388
|
-
reflex-0.6.
|
|
389
|
-
reflex-0.6.
|
|
390
|
-
reflex-0.6.
|
|
391
|
-
reflex-0.6.
|
|
387
|
+
reflex-0.6.4a2.dist-info/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
|
|
388
|
+
reflex-0.6.4a2.dist-info/METADATA,sha256=uAu0PifoNTRjtYzLA6rqL49LHY5OD7sp_UM35cRgvtM,12057
|
|
389
|
+
reflex-0.6.4a2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
390
|
+
reflex-0.6.4a2.dist-info/entry_points.txt,sha256=H1Z5Yat_xJfy0dRT1Frk2PkO_p41Xy7fCKlj4FcdL9o,44
|
|
391
|
+
reflex-0.6.4a2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|