reflex 0.7.9a2__py3-none-any.whl → 0.7.10__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/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.
@@ -403,19 +405,21 @@ def export(
403
405
 
404
406
  environment.REFLEX_COMPILE_CONTEXT.set(constants.CompileContext.EXPORT)
405
407
 
406
- frontend_only, backend_only = prerequisites.check_running_mode(
408
+ should_frontend_run, should_backend_run = prerequisites.check_running_mode(
407
409
  frontend_only, backend_only
408
410
  )
409
411
 
410
412
  config = get_config()
411
413
 
412
- 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():
413
417
  _init(name=config.app_name)
414
418
 
415
419
  export_utils.export(
416
420
  zipping=zip,
417
- frontend=frontend_only,
418
- backend=backend_only,
421
+ frontend=should_frontend_run,
422
+ backend=should_backend_run,
419
423
  zip_dest_dir=zip_dest_dir,
420
424
  upload_db_file=upload_db_file,
421
425
  env=constants.Env.DEV if env == constants.Env.DEV else constants.Env.PROD,
@@ -631,8 +635,10 @@ def deploy(
631
635
  if interactive:
632
636
  dependency.check_requirements()
633
637
 
638
+ prerequisites.assert_in_reflex_dir()
639
+
634
640
  # Check if we are set up.
635
- if prerequisites.needs_reinit(frontend=True):
641
+ if prerequisites.needs_reinit():
636
642
  _init(name=config.app_name)
637
643
  prerequisites.check_latest_package_version(constants.ReflexHostingCLI.MODULE_NAME)
638
644
 
@@ -712,7 +718,7 @@ def _convert_reflex_loglevel_to_reflex_cli_loglevel(
712
718
  return HostingLogLevel.INFO
713
719
 
714
720
 
715
- if find_spec("typer"):
721
+ if find_spec("typer") and find_spec("typer.main"):
716
722
  import typer # pyright: ignore[reportMissingImports]
717
723
 
718
724
  if isinstance(hosting_cli, typer.Typer):