FastPluggy 0.4.73__tar.gz → 0.4.96__tar.gz
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.
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/PKG-INFO +1 -1
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/pyproject.toml +2 -2
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/FastPluggy.egg-info/PKG-INFO +1 -1
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/FastPluggy.egg-info/SOURCES.txt +14 -0
- fastpluggy-0.4.96/src/fastpluggy/core/auth/middleware.py +47 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/base_module_manager.py +3 -2
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/config.py +6 -13
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/core_metrics.py +7 -3
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/database.py +2 -2
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/error/degraded_mode_middleware.py +5 -0
- fastpluggy-0.4.96/src/fastpluggy/core/logging_setup.py +46 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/menu/menu_manager.py +3 -1
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/plugin/dependency_resolver.py +79 -39
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/plugin_state.py +3 -1
- fastpluggy-0.4.96/src/fastpluggy/core/repository/app_settings.py +186 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/routers/admin.py +5 -5
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/routers/admin_menu.py +3 -2
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/routers/app_static.py +1 -1
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/routers/base_module.py +8 -15
- fastpluggy-0.4.96/src/fastpluggy/core/routers/settings.py +52 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/tools/__init__.py +39 -0
- fastpluggy-0.4.96/src/fastpluggy/core/tools/datetime_tools.py +62 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/tools/fastapi.py +48 -3
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/tools/jinja_tools.py +6 -6
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/render_field_tools.py +28 -3
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/fastpluggy.py +112 -22
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/css/01-tokens.css +2 -2
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/css/fastpluggy.css +2 -2
- fastpluggy-0.4.96/src/fastpluggy/static/vendor/highlightjs-11.7.0/LICENSE +29 -0
- fastpluggy-0.4.96/src/fastpluggy/static/vendor/highlightjs-11.7.0/README.md +16 -0
- fastpluggy-0.4.96/src/fastpluggy/static/vendor/highlightjs-11.7.0/highlight.min.js +1202 -0
- fastpluggy-0.4.96/src/fastpluggy/static/vendor/highlightjs-11.7.0/styles/default.min.css +9 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/base.html.j2 +0 -3
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/degraded_mode.html.j2 +5 -7
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/error.html.j2 +1 -1
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/error_base.html.j2 +4 -6
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/display/code.html.j2 +2 -2
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/input/button.html.j2 +4 -1
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_auth.py +2 -152
- fastpluggy-0.4.96/tests/test_authenticate_once.py +218 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_database_driver.py +7 -7
- fastpluggy-0.4.96/tests/test_db_settings_round_trip.py +189 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_degraded_mode.py +65 -8
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_ensure_index.py +1 -1
- fastpluggy-0.4.96/tests/test_env_only_settings.py +81 -0
- fastpluggy-0.4.96/tests/test_error_pages_local_assets.py +30 -0
- fastpluggy-0.4.96/tests/test_load_app_concurrency.py +250 -0
- fastpluggy-0.4.96/tests/test_logging_setup.py +66 -0
- fastpluggy-0.4.96/tests/test_session_env_any_case.py +123 -0
- fastpluggy-0.4.96/tests/test_system_fonts.py +49 -0
- fastpluggy-0.4.73/src/fastpluggy/core/auth/middleware.py +0 -40
- fastpluggy-0.4.73/src/fastpluggy/core/repository/app_settings.py +0 -97
- fastpluggy-0.4.73/src/fastpluggy/core/routers/settings.py +0 -47
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/README.md +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/setup.cfg +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/FastPluggy.egg-info/dependency_links.txt +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/FastPluggy.egg-info/requires.txt +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/FastPluggy.egg-info/top_level.txt +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/cli_utils.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/auth/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/auth/anonymous.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/auth/auth_interface.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/auth/delegating_backend.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/dependency.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/error/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/error/degraded_mode_handler.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/error/exception.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/events/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/events/bus.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/events/event.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/events/spec.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/flash.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/global_registry.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/menu/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/menu/decorator.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/menu/override_service.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/menu/schema.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/metrics.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/models.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/models_tools/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/models_tools/base.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/models_tools/callable.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/models_tools/pydantic.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/models_tools/shared.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/models_tools/sqlalchemy.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/module_base.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/plugin/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/plugin/repository.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/plugin/service.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/plugin/validator.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/repository/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/routers/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/routers/actions/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/routers/actions/modules.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/routers/home.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/routers/ready.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/routers/service_worker.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/static.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/tools/fs_tools.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/tools/inspect_tools.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/tools/install.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/tools/lock.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/tools/serialize_tools.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/tools/system.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/tools/threads_tools.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/topbar.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/view_builder/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/view_builder/builder.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/view_builder/form_builder.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/view_builder/pagination.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/base.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/custom.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/data/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/data/debug.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/data/model.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/data/raw.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/data/table.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/data/table_model.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/data/traceback.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/display/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/display/alert.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/display/card.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/display/code.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/display/custom.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/display/progress.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/display/stats.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/input/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/input/button.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/input/button_list.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/input/form.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/layout/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/layout/grid.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/categories/layout/tabbed.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/fastpluggy_integration.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/widgets/mixins.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/css/02-tabler-bridge.css +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/css/03-layout.css +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/css/04-components.css +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/css/05-admin.css +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/css/06-widgets.css +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/css/07-responsive.css +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/css/08-json-modal.css +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/css/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/css/styles.css +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/favicon.svg +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/js/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/js/scripts.js +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/js/sw-register.js +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/service-worker-base.js +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/fontawesome-6.0.0/all.min.css +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/fontawesome-6.0.0/webfonts/fa-brands-400.ttf +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/fontawesome-6.0.0/webfonts/fa-brands-400.woff2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/fontawesome-6.0.0/webfonts/fa-regular-400.ttf +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/fontawesome-6.0.0/webfonts/fa-regular-400.woff2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/fontawesome-6.0.0/webfonts/fa-solid-900.ttf +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/fontawesome-6.0.0/webfonts/fa-solid-900.woff2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/fontawesome-6.0.0/webfonts/fa-v4compatibility.ttf +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/fontawesome-6.0.0/webfonts/fa-v4compatibility.woff2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/tabler-1.4.0/css/tabler-themes.min.css +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/tabler-1.4.0/css/tabler-themes.min.css.map +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/tabler-1.4.0/css/tabler.min.css +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/tabler-1.4.0/css/tabler.min.css.map +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/tabler-1.4.0/js/tabler.min.js +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/tabler-1.4.0/js/tabler.min.js.map +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/tabler-icons/fonts/tabler-icons.eot +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/tabler-icons/fonts/tabler-icons.ttf +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/tabler-icons/fonts/tabler-icons.woff +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/tabler-icons/fonts/tabler-icons.woff2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/static/vendor/tabler-icons/tabler-icons.min.css +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/403.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/404.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/admin/admin_menu.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/admin/capabilities.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/admin/events.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/admin/module_overview.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/auth/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/components/__init__.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/components/table_filter_component.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/flash_messages.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/generic_page.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/index.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/menu.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/plugin_load_error.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/data/debug.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/data/table.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/data/traceback.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/data/view_model.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/display/alert.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/display/card.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/display/progress.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/display/stats.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/display/status.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/input/button_list.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/input/form.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/layout/grid.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/layout/tabbed.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/partials/card_header.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/partials/pagination_macros.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/templates/widgets/widget_renderer.html.j2 +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_app.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_app_static.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_core_metrics.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_database_pool.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_domain_module_manager.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_dynamic_settings.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_event_bus.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_event_bus_ownership.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_execute_removed.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_fast_pluggy_init.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_flash.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_metrics.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_module_base_router_guard.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_simple_example.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_sys_path_reload.py +0 -0
- {fastpluggy-0.4.73 → fastpluggy-0.4.96}/tests/test_topbar.py +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
[build-system]
|
|
2
2
|
requires = [
|
|
3
|
-
"setuptools>=
|
|
3
|
+
"setuptools>=82",
|
|
4
4
|
]
|
|
5
5
|
build-backend = "setuptools.build_meta"
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "FastPluggy"
|
|
9
|
-
version = "0.4.
|
|
9
|
+
version = "0.4.96"
|
|
10
10
|
description = "A FastAPI-based framework with plugin management."
|
|
11
11
|
readme = "README.md"
|
|
12
12
|
requires-python = ">=3.11"
|
|
@@ -16,6 +16,7 @@ src/fastpluggy/core/database.py
|
|
|
16
16
|
src/fastpluggy/core/dependency.py
|
|
17
17
|
src/fastpluggy/core/flash.py
|
|
18
18
|
src/fastpluggy/core/global_registry.py
|
|
19
|
+
src/fastpluggy/core/logging_setup.py
|
|
19
20
|
src/fastpluggy/core/metrics.py
|
|
20
21
|
src/fastpluggy/core/models.py
|
|
21
22
|
src/fastpluggy/core/module_base.py
|
|
@@ -65,6 +66,7 @@ src/fastpluggy/core/routers/settings.py
|
|
|
65
66
|
src/fastpluggy/core/routers/actions/__init__.py
|
|
66
67
|
src/fastpluggy/core/routers/actions/modules.py
|
|
67
68
|
src/fastpluggy/core/tools/__init__.py
|
|
69
|
+
src/fastpluggy/core/tools/datetime_tools.py
|
|
68
70
|
src/fastpluggy/core/tools/fastapi.py
|
|
69
71
|
src/fastpluggy/core/tools/fs_tools.py
|
|
70
72
|
src/fastpluggy/core/tools/inspect_tools.py
|
|
@@ -131,6 +133,10 @@ src/fastpluggy/static/vendor/fontawesome-6.0.0/webfonts/fa-solid-900.ttf
|
|
|
131
133
|
src/fastpluggy/static/vendor/fontawesome-6.0.0/webfonts/fa-solid-900.woff2
|
|
132
134
|
src/fastpluggy/static/vendor/fontawesome-6.0.0/webfonts/fa-v4compatibility.ttf
|
|
133
135
|
src/fastpluggy/static/vendor/fontawesome-6.0.0/webfonts/fa-v4compatibility.woff2
|
|
136
|
+
src/fastpluggy/static/vendor/highlightjs-11.7.0/LICENSE
|
|
137
|
+
src/fastpluggy/static/vendor/highlightjs-11.7.0/README.md
|
|
138
|
+
src/fastpluggy/static/vendor/highlightjs-11.7.0/highlight.min.js
|
|
139
|
+
src/fastpluggy/static/vendor/highlightjs-11.7.0/styles/default.min.css
|
|
134
140
|
src/fastpluggy/static/vendor/tabler-1.4.0/css/tabler-themes.min.css
|
|
135
141
|
src/fastpluggy/static/vendor/tabler-1.4.0/css/tabler-themes.min.css.map
|
|
136
142
|
src/fastpluggy/static/vendor/tabler-1.4.0/css/tabler.min.css
|
|
@@ -182,20 +188,28 @@ src/fastpluggy/templates/widgets/partials/pagination_macros.html.j2
|
|
|
182
188
|
tests/test_app.py
|
|
183
189
|
tests/test_app_static.py
|
|
184
190
|
tests/test_auth.py
|
|
191
|
+
tests/test_authenticate_once.py
|
|
185
192
|
tests/test_core_metrics.py
|
|
186
193
|
tests/test_database_driver.py
|
|
187
194
|
tests/test_database_pool.py
|
|
195
|
+
tests/test_db_settings_round_trip.py
|
|
188
196
|
tests/test_degraded_mode.py
|
|
189
197
|
tests/test_domain_module_manager.py
|
|
190
198
|
tests/test_dynamic_settings.py
|
|
191
199
|
tests/test_ensure_index.py
|
|
200
|
+
tests/test_env_only_settings.py
|
|
201
|
+
tests/test_error_pages_local_assets.py
|
|
192
202
|
tests/test_event_bus.py
|
|
193
203
|
tests/test_event_bus_ownership.py
|
|
194
204
|
tests/test_execute_removed.py
|
|
195
205
|
tests/test_fast_pluggy_init.py
|
|
196
206
|
tests/test_flash.py
|
|
207
|
+
tests/test_load_app_concurrency.py
|
|
208
|
+
tests/test_logging_setup.py
|
|
197
209
|
tests/test_metrics.py
|
|
198
210
|
tests/test_module_base_router_guard.py
|
|
211
|
+
tests/test_session_env_any_case.py
|
|
199
212
|
tests/test_simple_example.py
|
|
200
213
|
tests/test_sys_path_reload.py
|
|
214
|
+
tests/test_system_fonts.py
|
|
201
215
|
tests/test_topbar.py
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from fastapi import Request
|
|
2
|
+
from starlette.authentication import UnauthenticatedUser
|
|
3
|
+
from starlette.types import ASGIApp, Receive, Scope, Send
|
|
4
|
+
|
|
5
|
+
from fastpluggy.core.auth.anonymous import FPAnonymousUser
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class CurrentUserMiddleware:
|
|
9
|
+
"""Copies the identity of the request onto ``request.state``, for the templates
|
|
10
|
+
and ``get_current_user``.
|
|
11
|
+
|
|
12
|
+
It does not authenticate. The auth backend runs once per request, in Starlette's
|
|
13
|
+
``AuthenticationMiddleware``, which wraps this middleware and is what
|
|
14
|
+
``require_authentication`` and ``require_role`` read (``request.user``,
|
|
15
|
+
``request.auth``). Reading the same result here keeps one identity per request:
|
|
16
|
+
a second call to the backend could answer differently from the first.
|
|
17
|
+
|
|
18
|
+
Pure ASGI middleware — avoids the extra asyncio.Task that BaseHTTPMiddleware creates.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def __init__(self, app: ASGIApp):
|
|
22
|
+
self.app = app
|
|
23
|
+
|
|
24
|
+
async def __call__(self, scope: Scope, receive: Receive, send: Send):
|
|
25
|
+
if scope["type"] != "http":
|
|
26
|
+
await self.app(scope, receive, send)
|
|
27
|
+
return
|
|
28
|
+
|
|
29
|
+
request = Request(scope)
|
|
30
|
+
user = scope.get("user")
|
|
31
|
+
# Nobody is authenticated when the backend recognised no one (Starlette then
|
|
32
|
+
# puts its own UnauthenticatedUser there), when there is no backend, or when
|
|
33
|
+
# AuthenticationMiddleware did not run at all (no "user" in the scope).
|
|
34
|
+
if user is None or type(user) is UnauthenticatedUser:
|
|
35
|
+
request.state.current_user = FPAnonymousUser()
|
|
36
|
+
request.state.roles = None
|
|
37
|
+
else:
|
|
38
|
+
request.state.current_user = user
|
|
39
|
+
request.state.roles = scope["auth"]
|
|
40
|
+
|
|
41
|
+
auth_manager = request.app.state.fastpluggy.auth_manager
|
|
42
|
+
if hasattr(auth_manager, 'get_user_menu_entries'):
|
|
43
|
+
request.state.user_menu = auth_manager.get_user_menu_entries(request)
|
|
44
|
+
else:
|
|
45
|
+
request.state.user_menu = []
|
|
46
|
+
|
|
47
|
+
await self.app(scope, receive, send)
|
|
@@ -435,8 +435,9 @@ class BaseModuleManager(ABC):
|
|
|
435
435
|
PluginDependencyResolver.update_plugin_states_from_result(result, self.modules)
|
|
436
436
|
|
|
437
437
|
if not result["success"]:
|
|
438
|
-
|
|
439
|
-
|
|
438
|
+
# The modules named here carry a dependency issue and are left out
|
|
439
|
+
# of sorted_modules; every other module still loads.
|
|
440
|
+
logger.error(f"❌ Dependency resolution failed for {result['unresolved']}: {result['error']}")
|
|
440
441
|
|
|
441
442
|
for name in result["sorted_modules"]:
|
|
442
443
|
plugin_state = self.modules.get(name)
|
|
@@ -108,20 +108,13 @@ class FastPluggyConfig(BaseDatabaseSettings):
|
|
|
108
108
|
# LAN — so the banner does not nag on every page.
|
|
109
109
|
show_no_auth_warning: bool = True
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
#
|
|
114
|
-
#
|
|
115
|
-
#
|
|
116
|
-
#
|
|
117
|
-
# attach a non-Secure cookie on that hop — so the `state`/`nonce` authlib
|
|
118
|
-
# stashed in the session is gone at the callback and the login dies with
|
|
119
|
-
# `MismatchingStateError`. SameSite stays `lax` (it IS sent on a top-level
|
|
120
|
-
# GET, and it still blocks cross-site POST).
|
|
121
|
-
session_https_only: bool = False
|
|
111
|
+
# The session and gzip options are not fields: their middleware is installed
|
|
112
|
+
# before the database is reachable, so core reads SESSION_SECRET_KEY,
|
|
113
|
+
# SESSION_HTTPS_ONLY, FASTPLUGGY_GZIP_ENABLED and FASTPLUGGY_GZIP_MINIMUM_SIZE
|
|
114
|
+
# from the environment (FastPluggy._install_core_middleware). A field here
|
|
115
|
+
# would put them on /admin/settings, the session key in clear, with a saved
|
|
116
|
+
# value that is never read.
|
|
122
117
|
|
|
123
118
|
# Performance
|
|
124
|
-
gzip_enabled: Optional[bool] = True
|
|
125
|
-
gzip_minimum_size: int = 500
|
|
126
119
|
static_cache_max_age: int = 86400
|
|
127
120
|
|
|
@@ -10,21 +10,21 @@ exposed as ``fp_core_build_info`` — NOT ``fastpluggy_build_info``, which is th
|
|
|
10
10
|
name fast_pluggy#29 proposed before this prefixing convention was checked.
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
|
-
from __future__ import annotations
|
|
14
|
-
|
|
15
13
|
from typing import TYPE_CHECKING
|
|
16
14
|
|
|
17
15
|
from .metrics import MetricEntry, MetricsResult
|
|
18
16
|
from .routers.ready import build_identifier
|
|
19
17
|
|
|
20
18
|
if TYPE_CHECKING:
|
|
19
|
+
# Type-only: fastpluggy.fastpluggy imports this module, so the annotation
|
|
20
|
+
# below is a string.
|
|
21
21
|
from fastpluggy.fastpluggy import FastPluggy
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
class CoreMetricsProvider:
|
|
25
25
|
"""Implements MetricsProvider protocol for FastPluggy core."""
|
|
26
26
|
|
|
27
|
-
def __init__(self, fast_pluggy: FastPluggy) -> None:
|
|
27
|
+
def __init__(self, fast_pluggy: "FastPluggy") -> None:
|
|
28
28
|
self._fp = fast_pluggy
|
|
29
29
|
|
|
30
30
|
def get_metrics(self) -> MetricsResult:
|
|
@@ -47,6 +47,10 @@ class CoreMetricsProvider:
|
|
|
47
47
|
type="gauge", help="Total load_app() duration in ms"),
|
|
48
48
|
MetricEntry(name="event_listeners_count", value=events.listener_count(),
|
|
49
49
|
type="gauge", help="Current event listener count"),
|
|
50
|
+
MetricEntry(name="session_key_default",
|
|
51
|
+
value=1 if getattr(self._fp, "session_key_is_default", False) else 0,
|
|
52
|
+
type="gauge",
|
|
53
|
+
help="1 when sessions are signed with the public built-in default key"),
|
|
50
54
|
]
|
|
51
55
|
|
|
52
56
|
# Per-plugin load times
|
|
@@ -179,7 +179,7 @@ def wait_for_database(
|
|
|
179
179
|
``start_workers_if_available()``, which is invoked from ``__main__`` before
|
|
180
180
|
``uvicorn.run()`` and therefore before ``setup_database`` has ever run. Such
|
|
181
181
|
a caller got an unretried, cold database and died permanently (fast_pluggy#22
|
|
182
|
-
one layer up;
|
|
182
|
+
one layer up; a plugin #73 is the observed instance — a worker+beat that never
|
|
183
183
|
started, leaving every scheduled task silently unfired for 7.5 days).
|
|
184
184
|
|
|
185
185
|
Tunable via env (read directly — ``FastPluggyConfig`` needs the DB and is not
|
|
@@ -324,7 +324,7 @@ def ensure_index(name: str, table: str, definition: str, *, unique: bool = False
|
|
|
324
324
|
A plain ``CREATE INDEX IF NOT EXISTS`` looks free when the index is already
|
|
325
325
|
there, but it is not: it still takes a ``ShareLock`` on the table, and
|
|
326
326
|
anything holding a conflicting lock — an autovacuum, most commonly — blocks
|
|
327
|
-
it *indefinitely*. A real outage (
|
|
327
|
+
it *indefinitely*. A real outage (an application, 2026-07-29): a no-op
|
|
328
328
|
``CREATE INDEX IF NOT EXISTS`` at startup queued behind a 9-hour pgvector
|
|
329
329
|
autovacuum, the app never finished booting, 31 backends stacked up, and the
|
|
330
330
|
autovacuum ignored both ``pg_cancel_backend`` and ``pg_terminate_backend`` —
|
{fastpluggy-0.4.73 → fastpluggy-0.4.96}/src/fastpluggy/core/error/degraded_mode_middleware.py
RENAMED
|
@@ -36,6 +36,10 @@ class DegradedModeMiddleware:
|
|
|
36
36
|
#: anything that reads state belongs behind the gate.
|
|
37
37
|
LIVENESS_PATHS = frozenset({"/health"})
|
|
38
38
|
|
|
39
|
+
#: The core's own static files (Tabler, icons, CSS): the degraded-mode page
|
|
40
|
+
#: itself loads them. They hold no state and are served anonymously anyway.
|
|
41
|
+
STATIC_PREFIX = "/static/"
|
|
42
|
+
|
|
39
43
|
def __init__(self, app: ASGIApp, fastpluggy: "FastPluggy"):
|
|
40
44
|
self.app = app
|
|
41
45
|
self._fastpluggy = fastpluggy
|
|
@@ -45,6 +49,7 @@ class DegradedModeMiddleware:
|
|
|
45
49
|
scope["type"] != "http"
|
|
46
50
|
or self._fastpluggy.is_ready
|
|
47
51
|
or scope.get("path") in self.LIVENESS_PATHS
|
|
52
|
+
or scope.get("path", "").startswith(self.STATIC_PREFIX)
|
|
48
53
|
):
|
|
49
54
|
await self.app(scope, receive, send)
|
|
50
55
|
return
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Default log level for FastPluggy apps.
|
|
2
|
+
|
|
3
|
+
loguru installs its default stderr handler at import time with level DEBUG
|
|
4
|
+
unless the ``LOGURU_LEVEL`` environment variable says otherwise, and nothing
|
|
5
|
+
in FastPluggy configured it. So every ``logger.debug()`` in core and in every
|
|
6
|
+
plugin went to ``docker logs`` and, from there, to Loki. Some of those lines
|
|
7
|
+
carried plugin settings, admin password included, at every start.
|
|
8
|
+
|
|
9
|
+
``apply_default_log_level()`` lowers that import-time default to INFO. It
|
|
10
|
+
leaves alone:
|
|
11
|
+
|
|
12
|
+
* an explicit ``LOGURU_LEVEL`` (set ``LOGURU_LEVEL=DEBUG`` to get the debug
|
|
13
|
+
output back, e.g. on a dev machine);
|
|
14
|
+
* an app that already reconfigured loguru (removed the default handler):
|
|
15
|
+
its sinks are its own choice.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
import os
|
|
19
|
+
import sys
|
|
20
|
+
|
|
21
|
+
from loguru import logger
|
|
22
|
+
|
|
23
|
+
DEFAULT_LOG_LEVEL = "INFO"
|
|
24
|
+
|
|
25
|
+
# loguru gives its import-time stderr handler the id 0.
|
|
26
|
+
_LOGURU_DEFAULT_HANDLER_ID = 0
|
|
27
|
+
|
|
28
|
+
_applied = False
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def apply_default_log_level() -> bool:
|
|
32
|
+
"""Replace loguru's DEBUG default handler with an INFO one, once.
|
|
33
|
+
|
|
34
|
+
Returns True when the handler was replaced, False when nothing changed
|
|
35
|
+
(already applied, ``LOGURU_LEVEL`` set, or the default handler is gone).
|
|
36
|
+
"""
|
|
37
|
+
global _applied
|
|
38
|
+
if _applied or os.getenv("LOGURU_LEVEL"):
|
|
39
|
+
return False
|
|
40
|
+
_applied = True
|
|
41
|
+
try:
|
|
42
|
+
logger.remove(_LOGURU_DEFAULT_HANDLER_ID)
|
|
43
|
+
except ValueError:
|
|
44
|
+
return False
|
|
45
|
+
logger.add(sys.stderr, level=DEFAULT_LOG_LEVEL)
|
|
46
|
+
return True
|
|
@@ -306,8 +306,10 @@ class MenuManager:
|
|
|
306
306
|
parent = entry.get("parent")
|
|
307
307
|
if parent is None:
|
|
308
308
|
parent_module = get_plugin_state_for_route(route, module_manager.modules.values())
|
|
309
|
-
logger.debug(f"Inferred parent module for route '{route.path}': {parent_module}")
|
|
310
309
|
parent = parent_module.plugin.module_name if parent_module else None
|
|
310
|
+
# Log the name, never the PluginState: its repr used to carry the
|
|
311
|
+
# plugin's settings, secrets included.
|
|
312
|
+
logger.debug(f"Inferred parent module for route '{route.path}': {parent}")
|
|
311
313
|
|
|
312
314
|
# Build a menu-friendly URL using FastAPI's url_for/url_path_for, informed by _extract_route_metadata.
|
|
313
315
|
# If the route ends with an optional trailing path parameter (e.g. '/browse/{virtual_path:path}' with default),
|
|
@@ -24,7 +24,6 @@ class PluginDependencyResolver:
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
graph = defaultdict(set) # dependency -> set of dependents
|
|
27
|
-
in_degree = defaultdict(int) # dependent -> count of unresolved deps
|
|
28
27
|
module_versions = {}
|
|
29
28
|
module_deps = {}
|
|
30
29
|
module_optional_deps = {}
|
|
@@ -41,7 +40,6 @@ class PluginDependencyResolver:
|
|
|
41
40
|
module_versions[name] = version
|
|
42
41
|
module_deps[name] = deps
|
|
43
42
|
module_optional_deps[name] = optional_deps
|
|
44
|
-
in_degree[name] = 0
|
|
45
43
|
|
|
46
44
|
output["modules"][name] = {
|
|
47
45
|
"version": str(version),
|
|
@@ -69,7 +67,17 @@ class PluginDependencyResolver:
|
|
|
69
67
|
logger.warning(f"❌ {issue} for module '{name}'")
|
|
70
68
|
continue
|
|
71
69
|
|
|
72
|
-
|
|
70
|
+
if dep_name not in module_versions:
|
|
71
|
+
# Installed but disabled: it takes no part in the sort, so an
|
|
72
|
+
# edge from it would never be released.
|
|
73
|
+
issue = f"Dependency '{dep_name}' is disabled"
|
|
74
|
+
module_output["dependency_issues"].append(issue)
|
|
75
|
+
module_output["status"] = "error"
|
|
76
|
+
module_output["loadable"] = False
|
|
77
|
+
logger.warning(f"❌ {issue} (in module '{name}')")
|
|
78
|
+
continue
|
|
79
|
+
|
|
80
|
+
actual_version = module_versions[dep_name]
|
|
73
81
|
spec = SpecifierSet(version_constraint)
|
|
74
82
|
|
|
75
83
|
if actual_version not in spec:
|
|
@@ -81,7 +89,6 @@ class PluginDependencyResolver:
|
|
|
81
89
|
continue
|
|
82
90
|
|
|
83
91
|
graph[dep_name].add(name)
|
|
84
|
-
in_degree[name] += 1
|
|
85
92
|
logger.debug(f"✅ '{name}' depends on '{dep_name}' {version_constraint} (actual: {actual_version})")
|
|
86
93
|
|
|
87
94
|
# Process optional dependencies — these influence load order but never block loading
|
|
@@ -114,7 +121,6 @@ class PluginDependencyResolver:
|
|
|
114
121
|
opt_dep_info["status"] = "available"
|
|
115
122
|
opt_dep_info["actual_version"] = str(actual_version)
|
|
116
123
|
graph[dep_name].add(name)
|
|
117
|
-
in_degree[name] += 1
|
|
118
124
|
optional_edges.append((dep_name, name))
|
|
119
125
|
logger.debug(f"✅ '{name}' optionally depends on '{dep_name}' {version_constraint} (actual: {actual_version})")
|
|
120
126
|
|
|
@@ -124,43 +130,14 @@ class PluginDependencyResolver:
|
|
|
124
130
|
info["status"] = "ok"
|
|
125
131
|
|
|
126
132
|
logger.info("📐 Performing topological sort...")
|
|
127
|
-
|
|
128
|
-
full_order = []
|
|
129
|
-
|
|
130
|
-
while queue:
|
|
131
|
-
current = queue.popleft()
|
|
132
|
-
full_order.append(current)
|
|
133
|
-
for dependent in graph[current]:
|
|
134
|
-
in_degree[dependent] -= 1
|
|
135
|
-
if in_degree[dependent] == 0:
|
|
136
|
-
queue.append(dependent)
|
|
133
|
+
full_order = PluginDependencyResolver._topological_order(module_deps, graph)
|
|
137
134
|
|
|
138
135
|
# If optional edges caused a cycle, drop them and retry
|
|
139
136
|
if len(full_order) != len(module_deps) and optional_edges:
|
|
140
137
|
logger.warning("⚠️ Optional dependency edges caused a cycle — dropping optional edges and retrying")
|
|
141
|
-
# Remove all optional edges
|
|
142
138
|
for dep_name, name in optional_edges:
|
|
143
139
|
graph[dep_name].discard(name)
|
|
144
|
-
|
|
145
|
-
# Rebuild in_degree from scratch
|
|
146
|
-
in_degree.clear()
|
|
147
|
-
for name in module_deps:
|
|
148
|
-
in_degree[name] = 0
|
|
149
|
-
for dep_name, dependents in graph.items():
|
|
150
|
-
for dependent in dependents:
|
|
151
|
-
if dependent in in_degree:
|
|
152
|
-
in_degree[dependent] += 1
|
|
153
|
-
|
|
154
|
-
# Re-run topo sort
|
|
155
|
-
queue = deque([name for name in module_deps if in_degree[name] == 0])
|
|
156
|
-
full_order = []
|
|
157
|
-
while queue:
|
|
158
|
-
current = queue.popleft()
|
|
159
|
-
full_order.append(current)
|
|
160
|
-
for dependent in graph[current]:
|
|
161
|
-
in_degree[dependent] -= 1
|
|
162
|
-
if in_degree[dependent] == 0:
|
|
163
|
-
queue.append(dependent)
|
|
140
|
+
full_order = PluginDependencyResolver._topological_order(module_deps, graph)
|
|
164
141
|
|
|
165
142
|
output["computed_order"] = full_order
|
|
166
143
|
|
|
@@ -170,10 +147,26 @@ class PluginDependencyResolver:
|
|
|
170
147
|
unresolved = [name for name in module_deps if name not in full_order]
|
|
171
148
|
output["unresolved"] = unresolved
|
|
172
149
|
|
|
150
|
+
# What each unresolved module waits for: the members of a cycle wait
|
|
151
|
+
# for each other, the rest wait for a member of a cycle.
|
|
152
|
+
blocked_by = {
|
|
153
|
+
name: sorted(dep for dep in unresolved if name in graph.get(dep, ()))
|
|
154
|
+
for name in unresolved
|
|
155
|
+
}
|
|
173
156
|
for name in unresolved:
|
|
174
|
-
output["modules"][name]
|
|
175
|
-
|
|
176
|
-
|
|
157
|
+
module_output = output["modules"][name]
|
|
158
|
+
module_output["status"] = "unresolved"
|
|
159
|
+
module_output["loadable"] = False
|
|
160
|
+
|
|
161
|
+
cycle = PluginDependencyResolver._dependency_cycle(name, blocked_by)
|
|
162
|
+
if cycle:
|
|
163
|
+
module_output["dependency_issues"].append(f"Dependency cycle: {' → '.join(cycle)}")
|
|
164
|
+
else:
|
|
165
|
+
for dep_name in blocked_by[name]:
|
|
166
|
+
module_output["dependency_issues"].append(
|
|
167
|
+
f"Depends on '{dep_name}', which cannot be loaded (dependency cycle)"
|
|
168
|
+
)
|
|
169
|
+
logger.error(f"🔗 Module '{name}' cannot be loaded: {' / '.join(module_output['dependency_issues'])}")
|
|
177
170
|
else:
|
|
178
171
|
logger.info(f"✅ Modules sorted in dependency order: {full_order}")
|
|
179
172
|
|
|
@@ -188,6 +181,53 @@ class PluginDependencyResolver:
|
|
|
188
181
|
modules.update(reordered)
|
|
189
182
|
return output
|
|
190
183
|
|
|
184
|
+
@staticmethod
|
|
185
|
+
def _topological_order(names, graph) -> list:
|
|
186
|
+
"""
|
|
187
|
+
Kahn's algorithm over `graph` (dependency -> its dependents), for `names`.
|
|
188
|
+
|
|
189
|
+
Returns the names in an order where each one comes after its dependencies.
|
|
190
|
+
A name on a dependency cycle, or behind one, is left out.
|
|
191
|
+
"""
|
|
192
|
+
in_degree = {name: 0 for name in names}
|
|
193
|
+
for dep_name, dependents in graph.items():
|
|
194
|
+
if dep_name not in in_degree:
|
|
195
|
+
continue
|
|
196
|
+
for dependent in dependents:
|
|
197
|
+
if dependent in in_degree:
|
|
198
|
+
in_degree[dependent] += 1
|
|
199
|
+
|
|
200
|
+
queue = deque(name for name in names if in_degree[name] == 0)
|
|
201
|
+
order = []
|
|
202
|
+
while queue:
|
|
203
|
+
current = queue.popleft()
|
|
204
|
+
order.append(current)
|
|
205
|
+
for dependent in graph.get(current, ()):
|
|
206
|
+
if dependent not in in_degree:
|
|
207
|
+
continue
|
|
208
|
+
in_degree[dependent] -= 1
|
|
209
|
+
if in_degree[dependent] == 0:
|
|
210
|
+
queue.append(dependent)
|
|
211
|
+
return order
|
|
212
|
+
|
|
213
|
+
@staticmethod
|
|
214
|
+
def _dependency_cycle(start: str, depends_on: Dict[str, list]) -> list:
|
|
215
|
+
"""
|
|
216
|
+
The shortest chain `start → dependency → ... → start`, or an empty
|
|
217
|
+
list when `start` is not on a cycle.
|
|
218
|
+
"""
|
|
219
|
+
queue = deque([[start]])
|
|
220
|
+
seen = set()
|
|
221
|
+
while queue:
|
|
222
|
+
path = queue.popleft()
|
|
223
|
+
for dep_name in depends_on.get(path[-1], ()):
|
|
224
|
+
if dep_name == start:
|
|
225
|
+
return path + [start]
|
|
226
|
+
if dep_name not in seen:
|
|
227
|
+
seen.add(dep_name)
|
|
228
|
+
queue.append(path + [dep_name])
|
|
229
|
+
return []
|
|
230
|
+
|
|
191
231
|
@staticmethod
|
|
192
232
|
def reorder_modules(modules: dict, sorted_modules: list) -> dict:
|
|
193
233
|
"""
|
|
@@ -29,7 +29,9 @@ class PluginState(BaseModel):
|
|
|
29
29
|
module_type: Optional[str] = None
|
|
30
30
|
package_name: Optional[str] = None
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
# repr=False: this is a live settings instance (secrets included). Any f-string or
|
|
33
|
+
# log line that prints a PluginState would otherwise write every value in clear.
|
|
34
|
+
settings: Optional[Any] = Field(default=None, repr=False)
|
|
33
35
|
|
|
34
36
|
@computed_field
|
|
35
37
|
@property
|