reflex 0.7.9a1__py3-none-any.whl → 0.7.10a1__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/page.py CHANGED
@@ -8,6 +8,7 @@ from typing import Any
8
8
 
9
9
  from reflex.config import get_config
10
10
  from reflex.event import EventType
11
+ from reflex.utils import console
11
12
 
12
13
  DECORATED_PAGES: dict[str, list] = defaultdict(list)
13
14
 
@@ -76,6 +77,13 @@ def get_decorated_pages(omit_implicit_routes: bool = True) -> list[dict[str, Any
76
77
  Returns:
77
78
  The decorated pages.
78
79
  """
80
+ console.deprecate(
81
+ "get_decorated_pages",
82
+ reason="This function is deprecated and will be removed in a future version.",
83
+ deprecation_version="0.7.9",
84
+ removal_version="0.8.0",
85
+ dedupe=True,
86
+ )
79
87
  return sorted(
80
88
  [
81
89
  page_data
reflex/reflex.py CHANGED
@@ -86,7 +86,7 @@ def _init(
86
86
  prerequisites.initialize_gitignore()
87
87
 
88
88
  # Initialize the requirements.txt.
89
- wrote_to_requirements = prerequisites.initialize_requirements_txt()
89
+ needs_user_manual_update = prerequisites.initialize_requirements_txt()
90
90
 
91
91
  template_msg = f" using the {template} template" if template else ""
92
92
  # Finish initializing the app.
@@ -94,7 +94,7 @@ def _init(
94
94
  f"Initialized {app_name}{template_msg}."
95
95
  + (
96
96
  f" Make sure to add {constants.RequirementsTxt.DEFAULTS_STUB + constants.Reflex.VERSION} to your requirements.txt or pyproject.toml file."
97
- if not wrote_to_requirements
97
+ if needs_user_manual_update
98
98
  else ""
99
99
  )
100
100
  )
@@ -151,8 +151,10 @@ def _run(
151
151
  if not frontend and backend:
152
152
  _skip_compile()
153
153
 
154
+ prerequisites.assert_in_reflex_dir()
155
+
154
156
  # Check that the app is initialized.
155
- if prerequisites.needs_reinit(frontend=frontend):
157
+ if frontend and prerequisites.needs_reinit():
156
158
  _init(name=config.app_name)
157
159
 
158
160
  # Delete the states folder if it exists.
@@ -354,6 +356,7 @@ def run(
354
356
  @click.option(
355
357
  "--zip/--no-zip",
356
358
  default=True,
359
+ is_flag=True,
357
360
  help="Whether to zip the backend and frontend exports.",
358
361
  )
359
362
  @click.option(
@@ -402,19 +405,21 @@ def export(
402
405
 
403
406
  environment.REFLEX_COMPILE_CONTEXT.set(constants.CompileContext.EXPORT)
404
407
 
405
- frontend_only, backend_only = prerequisites.check_running_mode(
408
+ should_frontend_run, should_backend_run = prerequisites.check_running_mode(
406
409
  frontend_only, backend_only
407
410
  )
408
411
 
409
412
  config = get_config()
410
413
 
411
- if prerequisites.needs_reinit(frontend=frontend_only or not backend_only):
414
+ prerequisites.assert_in_reflex_dir()
415
+
416
+ if should_frontend_run and prerequisites.needs_reinit():
412
417
  _init(name=config.app_name)
413
418
 
414
419
  export_utils.export(
415
420
  zipping=zip,
416
- frontend=frontend_only,
417
- backend=backend_only,
421
+ frontend=should_frontend_run,
422
+ backend=should_backend_run,
418
423
  zip_dest_dir=zip_dest_dir,
419
424
  upload_db_file=upload_db_file,
420
425
  env=constants.Env.DEV if env == constants.Env.DEV else constants.Env.PROD,
@@ -569,7 +574,7 @@ def makemigrations(message: str | None):
569
574
  help="The hostname of the frontend.",
570
575
  )
571
576
  @click.option(
572
- "--interactive",
577
+ "--interactive/--no-interactive",
573
578
  is_flag=True,
574
579
  default=True,
575
580
  help="Whether to list configuration options and ask for confirmation.",
@@ -630,8 +635,10 @@ def deploy(
630
635
  if interactive:
631
636
  dependency.check_requirements()
632
637
 
638
+ prerequisites.assert_in_reflex_dir()
639
+
633
640
  # Check if we are set up.
634
- if prerequisites.needs_reinit(frontend=True):
641
+ if prerequisites.needs_reinit():
635
642
  _init(name=config.app_name)
636
643
  prerequisites.check_latest_package_version(constants.ReflexHostingCLI.MODULE_NAME)
637
644
 
@@ -711,7 +718,7 @@ def _convert_reflex_loglevel_to_reflex_cli_loglevel(
711
718
  return HostingLogLevel.INFO
712
719
 
713
720
 
714
- if find_spec("typer"):
721
+ if find_spec("typer") and find_spec("typer.main"):
715
722
  import typer # pyright: ignore[reportMissingImports]
716
723
 
717
724
  if isinstance(hosting_cli, typer.Typer):