splent-framework 1.30.2__tar.gz → 1.31.0__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.
- {splent_framework-1.30.2/src/splent_framework.egg-info → splent_framework-1.31.0}/PKG-INFO +1 -1
- {splent_framework-1.30.2 → splent_framework-1.31.0}/pyproject.toml +1 -1
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/feature_loader.py +12 -4
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/feature_order.py +75 -38
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/migration_manager.py +27 -25
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/namespace_manager.py +3 -0
- splent_framework-1.31.0/src/splent_framework/utils/listed_once.py +75 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0/src/splent_framework.egg-info}/PKG-INFO +1 -1
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework.egg-info/SOURCES.txt +3 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_feature_order.py +44 -0
- splent_framework-1.31.0/tests/test_listed_once.py +83 -0
- splent_framework-1.31.0/tests/test_migration_tracking_table.py +71 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/COPYING +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/COPYING.LESSER +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/README.md +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/setup.cfg +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/admin/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/admin/registry.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/api/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/app_factory.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/assets/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/assets/asset_registry.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/assets/feature_assets.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/audit/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/blueprints/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/blueprints/base_blueprint.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/bootstraps/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/bootstraps/locustfile_bootstrap.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/cache/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/configuration/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/configuration/configuration.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/configuration/default_config.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/configuration/layers.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/content/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/context/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/context/context_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/dates/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/db.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/decorators/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/decorators/decorators.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/empty/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/environment/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/environment/host.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/fetch/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/fixtures/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/fixtures/fixtures.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/guard/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/health/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/helpers/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/helpers/test_helpers_auth.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/hooks/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/hooks/template_hooks.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/i18n/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/i18n/text.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/icons/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/keys/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/layout/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/layout/shells.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/locust/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/locust/common.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/config_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/cookie_security_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/csp.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/csrf_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/db_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/error_handler_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/feature_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/health_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/jinja_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/locale_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/logging_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/mapper_guard.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/proxy_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/security_headers_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/session_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/static_cache_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/task_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/markdown/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/markdown/render.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/migrations/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/migrations/feature_env.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/namespaces/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/nav/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/nav/menu_registry.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/nav/nav_registry.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/observability/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/optional.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/pages/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/params/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/params/runtime.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/params/schema.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/ratelimit/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/refinement/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/refinement/conflicts.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/refinement/facts.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/refinement/model_extender.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/refinement/parser.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/refinement/registry.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/refinement/templates.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/refinement/validator.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/repositories/BaseRepository.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/repositories/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/rich_text/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/rich_text/sanitize.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/roles/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/search/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/search/schema.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/search/search_registry.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/security/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/seeders/BaseSeeder.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/seeders/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/selenium/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/selenium/common.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/services/BaseService.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/services/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/services/file_access.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/services/service_locator.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/settings/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/settings/settings_schema.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/signals/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/signals/registry.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/signals/signal_utils.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/site/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/sitemap/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/sizes/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/storage/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/tasks/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/tasks/backends.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/tasks/dispatch.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/tasks/isolated.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/tasks/registry.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/tasks/runs.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/tasks/worker.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/translations/es/LC_MESSAGES/messages.mo +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/translations/es/LC_MESSAGES/messages.po +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/translations/messages.pot +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/ui/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/ui/static/splent-ui.js +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/urls/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/utils/__init__.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/utils/app_loader.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/utils/feature_utils.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/utils/form_helpers.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/utils/path_utils.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/utils/pyproject_reader.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/utils/text.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/utils/uvl_resolver.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework.egg-info/dependency_links.txt +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework.egg-info/requires.txt +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework.egg-info/top_level.txt +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_api.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_app_version.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_audit.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_base_blueprint_security.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_base_repository.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_cache.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_config_layers.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_config_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_config_manager_return.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_config_trace.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_content.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_context_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_cookie_samesite.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_csp_compose.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_csp_nonce.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_csrf.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_dates.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_default_config.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_empty.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_error_handler_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_feature_assets.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_feature_loader_imports.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_feature_manager_parse.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_feature_utils.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_fetch.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_fixtures_reset_db.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_guard.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_has_role.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_health.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_health_listeners.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_helpers_host.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_helpers_locust.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_helpers_selenium.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_i18n_text.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_icons.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_isolated.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_keys.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_lazy_package_init.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_locale_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_locustfile_bootstrap.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_mapper_guard.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_markdown.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_migration_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_namespace_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_observability_report.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_optional.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_pages.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_params_boot.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_params_schema.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_path_utils_env_file.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_prod_cookies.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_prod_db_engine_options.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_prod_factory_integration.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_prod_max_content_length.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_prod_operator_settings.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_prod_security_headers.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_prod_static_cache.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_protected_uploads_dir.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_proxy_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_pyproject_reader.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_pyproject_reader_env.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_ratelimit.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_refinement.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_refinement_boot.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_refinement_conflicts.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_refinement_hooks.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_refinement_load_order.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_refinement_models.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_refinement_routes.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_refinement_services.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_refinement_templates.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_search_registry.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_search_schema.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_security.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_settings_schema.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_site.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_sitemap.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_sizes.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_storage.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_tasks.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_tasks_rq.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_test_store.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_text.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u1_app_factory.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u1_config_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u1_csrf.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u1_error_handlers.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u1_error_page_fails.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u1_forbidden_page.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u1_logging_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u2_app_loader.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u2_path_utils.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u2_session_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u3_feature_integrator.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u3_feature_link_resolver.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u3_feature_loader.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u3_feature_sources_override.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u3_refiner_extensions.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u4_contracts_snapshot.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u4_feature_lists.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u4_feature_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u5_asset_registry.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u5_asset_shells.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u5_base_blueprint.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u5_namespace_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u6_admin_registry.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u6_jinja_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u6_markdown.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u6_menu_registry.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u6_nav_registry.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u6_rich_text.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u6_shells.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u6_template_hooks.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u7_i18n_text.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u7_locale_manager.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u7_settings_schema.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u8_feature_env.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u8_file_access.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u8_migration_logging.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u8_model_extender.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u8_service_refinement.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u8_signals.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u9_base_repository.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u9_base_seeder.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u9_file_access.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_u9_form_helpers.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_ui.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_urls.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_urls_helpers.py +0 -0
- {splent_framework-1.30.2 → splent_framework-1.31.0}/tests/test_uvl_resolver.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "splent_framework"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.31.0"
|
|
8
8
|
description = "SPLENT-FRAMEWORK is a set of libraries for agile product development within SPLENT."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.13"
|
{splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/feature_loader.py
RENAMED
|
@@ -258,8 +258,16 @@ class FeatureStructureValidator:
|
|
|
258
258
|
class FeatureImporter:
|
|
259
259
|
"""Handle all importlib operations for a feature package."""
|
|
260
260
|
|
|
261
|
-
def add_to_syspath(self, src_root: str) -> None:
|
|
262
|
-
"""Insert src_root into sys.path so 'import org_safe.feature_name' works.
|
|
261
|
+
def add_to_syspath(self, src_root: str, org_dir: str | None = None) -> None:
|
|
262
|
+
"""Insert src_root into sys.path so 'import org_safe.feature_name' works.
|
|
263
|
+
|
|
264
|
+
It and its org folder ORG_DIR are listed once (utils.listed_once).
|
|
265
|
+
"""
|
|
266
|
+
from splent_framework.utils.listed_once import list_once
|
|
267
|
+
|
|
268
|
+
list_once(src_root)
|
|
269
|
+
if org_dir:
|
|
270
|
+
list_once(org_dir)
|
|
263
271
|
if src_root not in sys.path:
|
|
264
272
|
sys.path.insert(0, src_root)
|
|
265
273
|
logger.debug("Source path added: %s", src_root)
|
|
@@ -876,8 +884,8 @@ class FeatureLoader:
|
|
|
876
884
|
local_error = None
|
|
877
885
|
try:
|
|
878
886
|
feature_dir = self._resolver.resolve(self._features_dir, ref)
|
|
879
|
-
src_root,
|
|
880
|
-
self._importer.add_to_syspath(src_root)
|
|
887
|
+
src_root, org_dir, _ = self._validator.validate(feature_dir, ref)
|
|
888
|
+
self._importer.add_to_syspath(src_root, org_dir)
|
|
881
889
|
except FeatureError as e:
|
|
882
890
|
# No usable local directory: the feature must be pip-installed.
|
|
883
891
|
# In a built image every link dangles, so this stays quiet; the
|
{splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/managers/feature_order.py
RENAMED
|
@@ -167,6 +167,74 @@ class FeatureLoadOrderResolver:
|
|
|
167
167
|
pairs.append((m.group(1), m.group(2)))
|
|
168
168
|
return pairs
|
|
169
169
|
|
|
170
|
+
def dependencies(
|
|
171
|
+
self,
|
|
172
|
+
features_raw: list[str],
|
|
173
|
+
uvl_path: str | None,
|
|
174
|
+
*,
|
|
175
|
+
refines: Mapping[str, str] | None = None,
|
|
176
|
+
) -> dict[str, list[str]]:
|
|
177
|
+
"""The entries each entry of *features_raw* must come after.
|
|
178
|
+
|
|
179
|
+
The same edges :meth:`resolve` orders by (UVL ``A => B`` and
|
|
180
|
+
refinements), keyed by raw entry and limited to the active features.
|
|
181
|
+
Two entries with no path between them can start at the same time.
|
|
182
|
+
"""
|
|
183
|
+
package_map: dict[str, str] = {}
|
|
184
|
+
constraints: list[tuple[str, str]] = []
|
|
185
|
+
if uvl_path and os.path.isfile(uvl_path):
|
|
186
|
+
uvl_text = Path(uvl_path).read_text(encoding="utf-8", errors="replace")
|
|
187
|
+
package_map = self._parse_package_map(uvl_text)
|
|
188
|
+
constraints = self._parse_constraints(uvl_text)
|
|
189
|
+
entry_of = {self._parser.parse(e).name: e for e in features_raw}
|
|
190
|
+
pkg_to_index = {pkg: i for i, pkg in enumerate(entry_of)}
|
|
191
|
+
graph, _ = self._edges(pkg_to_index, package_map, constraints, refines)
|
|
192
|
+
result: dict[str, list[str]] = {e: [] for e in features_raw}
|
|
193
|
+
for required, dependents in graph.items():
|
|
194
|
+
for dependent in dependents:
|
|
195
|
+
result[entry_of[dependent]].append(entry_of[required])
|
|
196
|
+
return result
|
|
197
|
+
|
|
198
|
+
@staticmethod
|
|
199
|
+
def _edges(
|
|
200
|
+
pkg_to_index: Mapping[str, int],
|
|
201
|
+
package_map: Mapping[str, str],
|
|
202
|
+
constraints: list[tuple[str, str]],
|
|
203
|
+
refines: Mapping[str, str] | None,
|
|
204
|
+
) -> tuple[dict[str, list[str]], list[tuple[str, str]]]:
|
|
205
|
+
"""``graph[B] = [A, ...]``: A loads after B. Also the refinement pairs.
|
|
206
|
+
|
|
207
|
+
Only edges whose two ends are active count.
|
|
208
|
+
"""
|
|
209
|
+
graph: dict[str, list[str]] = {pkg: [] for pkg in pkg_to_index}
|
|
210
|
+
for requirer_short, required_short in constraints:
|
|
211
|
+
requirer_pkg = package_map.get(requirer_short)
|
|
212
|
+
required_pkg = package_map.get(required_short)
|
|
213
|
+
if requirer_pkg not in pkg_to_index or required_pkg not in pkg_to_index:
|
|
214
|
+
continue
|
|
215
|
+
graph[required_pkg].append(requirer_pkg)
|
|
216
|
+
logger.debug(
|
|
217
|
+
"Ordering constraint: %s must load before %s",
|
|
218
|
+
required_pkg,
|
|
219
|
+
requirer_pkg,
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
# A refiner loads after the feature it refines.
|
|
223
|
+
refinement_edges: list[tuple[str, str]] = []
|
|
224
|
+
for refiner_pkg, base_pkg in (refines or {}).items():
|
|
225
|
+
if refiner_pkg not in pkg_to_index or base_pkg not in pkg_to_index:
|
|
226
|
+
continue
|
|
227
|
+
if refiner_pkg == base_pkg:
|
|
228
|
+
continue
|
|
229
|
+
graph[base_pkg].append(refiner_pkg)
|
|
230
|
+
refinement_edges.append((refiner_pkg, base_pkg))
|
|
231
|
+
logger.debug(
|
|
232
|
+
"%s must load before %s, which refines it",
|
|
233
|
+
base_pkg,
|
|
234
|
+
refiner_pkg,
|
|
235
|
+
)
|
|
236
|
+
return graph, refinement_edges
|
|
237
|
+
|
|
170
238
|
# ------------------------------------------------------------------
|
|
171
239
|
# Topological sort — Kahn's algorithm (stable)
|
|
172
240
|
# ------------------------------------------------------------------
|
|
@@ -212,45 +280,14 @@ class FeatureLoadOrderResolver:
|
|
|
212
280
|
# Build reverse lookup: package_name → UVL short name (for error messages)
|
|
213
281
|
pkg_to_short: dict[str, str] = {v: k for k, v in package_map.items()}
|
|
214
282
|
|
|
215
|
-
|
|
283
|
+
graph, refinement_edges = self._edges(
|
|
284
|
+
pkg_to_index, package_map, constraints, refines
|
|
285
|
+
)
|
|
216
286
|
in_degree: dict[str, int] = {pkg: 0 for pkg in pkg_to_index}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
active_constraints =
|
|
221
|
-
for requirer_short, required_short in constraints:
|
|
222
|
-
requirer_pkg = package_map.get(requirer_short)
|
|
223
|
-
required_pkg = package_map.get(required_short)
|
|
224
|
-
|
|
225
|
-
# Skip constraints that reference features not in the active set.
|
|
226
|
-
if requirer_pkg not in pkg_to_index or required_pkg not in pkg_to_index:
|
|
227
|
-
continue
|
|
228
|
-
|
|
229
|
-
graph[required_pkg].append(requirer_pkg)
|
|
230
|
-
in_degree[requirer_pkg] += 1
|
|
231
|
-
active_constraints += 1
|
|
232
|
-
logger.debug(
|
|
233
|
-
"Ordering constraint: %s must load before %s",
|
|
234
|
-
required_pkg,
|
|
235
|
-
requirer_pkg,
|
|
236
|
-
)
|
|
237
|
-
|
|
238
|
-
# A refiner loads after the feature it refines.
|
|
239
|
-
refinement_edges: list[tuple[str, str]] = []
|
|
240
|
-
for refiner_pkg, base_pkg in (refines or {}).items():
|
|
241
|
-
if refiner_pkg not in pkg_to_index or base_pkg not in pkg_to_index:
|
|
242
|
-
continue
|
|
243
|
-
if refiner_pkg == base_pkg:
|
|
244
|
-
continue
|
|
245
|
-
graph[base_pkg].append(refiner_pkg)
|
|
246
|
-
in_degree[refiner_pkg] += 1
|
|
247
|
-
active_constraints += 1
|
|
248
|
-
refinement_edges.append((refiner_pkg, base_pkg))
|
|
249
|
-
logger.debug(
|
|
250
|
-
"%s must load before %s, which refines it",
|
|
251
|
-
base_pkg,
|
|
252
|
-
refiner_pkg,
|
|
253
|
-
)
|
|
287
|
+
for dependents in graph.values():
|
|
288
|
+
for dependent in dependents:
|
|
289
|
+
in_degree[dependent] += 1
|
|
290
|
+
active_constraints = sum(len(d) for d in graph.values())
|
|
254
291
|
|
|
255
292
|
if active_constraints == 0:
|
|
256
293
|
return features_raw # No applicable constraints — keep original order.
|
|
@@ -41,11 +41,31 @@ def alembic_version_table(feature_name: str) -> str:
|
|
|
41
41
|
return f"alembic_{feature_name}"
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
_TRACKING_TABLE = text(
|
|
45
|
+
f"""
|
|
46
|
+
CREATE TABLE IF NOT EXISTS `{SPLENT_MIGRATIONS_TABLE}` (
|
|
47
|
+
`feature` VARCHAR(255) NOT NULL,
|
|
48
|
+
`last_migration` VARCHAR(255) DEFAULT NULL,
|
|
49
|
+
PRIMARY KEY (`feature`)
|
|
50
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
|
|
51
|
+
"""
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def ensure_tracking_table(conn) -> None:
|
|
56
|
+
"""Create splent_migrations through CONN if it does not exist yet.
|
|
57
|
+
|
|
58
|
+
Whatever reads or writes the table calls this first, so building the app
|
|
59
|
+
does not need the database: a command that never touches it runs while
|
|
60
|
+
the database is down, and one that does creates the table on first use.
|
|
45
61
|
"""
|
|
46
|
-
|
|
62
|
+
conn.execute(_TRACKING_TABLE)
|
|
63
|
+
|
|
47
64
|
|
|
48
|
-
|
|
65
|
+
class MigrationManager:
|
|
66
|
+
"""
|
|
67
|
+
Initialises Flask-Migrate for the app. The splent_migrations tracking
|
|
68
|
+
table is created by the first read or write of it.
|
|
49
69
|
|
|
50
70
|
from splent_framework.managers.migration_manager import MigrationManager
|
|
51
71
|
MigrationManager(app)
|
|
@@ -55,7 +75,6 @@ class MigrationManager:
|
|
|
55
75
|
self.app = app
|
|
56
76
|
self.migrate = None
|
|
57
77
|
self._init_flask_migrate()
|
|
58
|
-
self._ensure_splent_migrations_table()
|
|
59
78
|
|
|
60
79
|
# ──────────────────────────── initialisation ───────────────────────────
|
|
61
80
|
|
|
@@ -66,26 +85,6 @@ class MigrationManager:
|
|
|
66
85
|
db.init_app(self.app)
|
|
67
86
|
self.migrate.init_app(self.app, db)
|
|
68
87
|
|
|
69
|
-
def _ensure_splent_migrations_table(self) -> None:
|
|
70
|
-
"""Create splent_migrations if it does not yet exist."""
|
|
71
|
-
with self.app.app_context():
|
|
72
|
-
try:
|
|
73
|
-
with db.engine.begin() as conn:
|
|
74
|
-
conn.execute(
|
|
75
|
-
text(
|
|
76
|
-
f"""
|
|
77
|
-
CREATE TABLE IF NOT EXISTS `{SPLENT_MIGRATIONS_TABLE}` (
|
|
78
|
-
`feature` VARCHAR(255) NOT NULL,
|
|
79
|
-
`last_migration` VARCHAR(255) DEFAULT NULL,
|
|
80
|
-
PRIMARY KEY (`feature`)
|
|
81
|
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
|
|
82
|
-
"""
|
|
83
|
-
)
|
|
84
|
-
)
|
|
85
|
-
except sa_exc.SQLAlchemyError:
|
|
86
|
-
# DB not available (e.g. container not running) — not fatal
|
|
87
|
-
pass
|
|
88
|
-
|
|
89
88
|
# ──────────────────────────── static helpers ───────────────────────────
|
|
90
89
|
|
|
91
90
|
@staticmethod
|
|
@@ -237,6 +236,7 @@ class MigrationManager:
|
|
|
237
236
|
"""Upsert ``(feature_name, revision)`` in splent_migrations."""
|
|
238
237
|
with app.app_context():
|
|
239
238
|
with db.engine.begin() as conn:
|
|
239
|
+
ensure_tracking_table(conn)
|
|
240
240
|
conn.execute(
|
|
241
241
|
text(
|
|
242
242
|
f"""
|
|
@@ -253,6 +253,7 @@ class MigrationManager:
|
|
|
253
253
|
"""Remove the row for *feature_name* from splent_migrations."""
|
|
254
254
|
with app.app_context():
|
|
255
255
|
with db.engine.begin() as conn:
|
|
256
|
+
ensure_tracking_table(conn)
|
|
256
257
|
conn.execute(
|
|
257
258
|
text(
|
|
258
259
|
f"DELETE FROM `{SPLENT_MIGRATIONS_TABLE}` WHERE feature = :feature"
|
|
@@ -264,7 +265,8 @@ class MigrationManager:
|
|
|
264
265
|
def get_all_status(app) -> list[tuple[str, str | None]]:
|
|
265
266
|
"""Return ``[(feature, last_migration), ...]`` from splent_migrations."""
|
|
266
267
|
with app.app_context():
|
|
267
|
-
with db.engine.
|
|
268
|
+
with db.engine.begin() as conn:
|
|
269
|
+
ensure_tracking_table(conn)
|
|
268
270
|
rows = conn.execute(
|
|
269
271
|
text(
|
|
270
272
|
f"SELECT feature, last_migration "
|
|
@@ -12,6 +12,7 @@ from splent_framework.managers.feature_loader import (
|
|
|
12
12
|
FeatureRef,
|
|
13
13
|
FeatureStructureValidator,
|
|
14
14
|
)
|
|
15
|
+
from splent_framework.utils.listed_once import list_once
|
|
15
16
|
from splent_framework.utils.path_utils import PathUtils
|
|
16
17
|
from splent_framework.utils.pyproject_reader import PyprojectReader
|
|
17
18
|
|
|
@@ -109,6 +110,8 @@ class NamespaceManager:
|
|
|
109
110
|
except FeatureError:
|
|
110
111
|
# Pip-installed, as in a production image.
|
|
111
112
|
continue
|
|
113
|
+
list_once(src_root)
|
|
114
|
+
list_once(os.path.join(src_root, ref.org_safe))
|
|
112
115
|
if src_root not in sys.path:
|
|
113
116
|
sys.path.insert(0, src_root)
|
|
114
117
|
logger.debug("Declared feature src added: %s", src_root)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"""Directories on the import path whose contents are read once.
|
|
2
|
+
|
|
3
|
+
A product in development puts the src/ of every feature it declares on
|
|
4
|
+
sys.path ahead of site-packages, so each import of a library looked in each
|
|
5
|
+
of them first. Python's finder checks the directory's modification time on
|
|
6
|
+
every lookup, one stat per directory and import, and on a bind mount from
|
|
7
|
+
the host that took most of a second of every app build with fifty features.
|
|
8
|
+
|
|
9
|
+
A feature's src/ holds its org's namespace folder and nothing else, and that
|
|
10
|
+
folder holds the feature's package, so what they hold is read once here, and
|
|
11
|
+
a name they did not hold then is not looked for in them again. Names they do
|
|
12
|
+
hold are found by Python's own finder, as before. Like any new module, one
|
|
13
|
+
added to such a directory while the process runs is found after
|
|
14
|
+
``importlib.invalidate_caches()``.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
import os
|
|
20
|
+
import pkgutil
|
|
21
|
+
import sys
|
|
22
|
+
|
|
23
|
+
_LISTED: set[str] = set()
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class _ListedOnce:
|
|
27
|
+
"""The path entry finder of a listed directory: Python's own, asked
|
|
28
|
+
only for the names the directory held."""
|
|
29
|
+
|
|
30
|
+
def __init__(self, path: str, inner):
|
|
31
|
+
self.path = path
|
|
32
|
+
self._inner = inner
|
|
33
|
+
self._names = self._list()
|
|
34
|
+
|
|
35
|
+
def _list(self) -> set[str]:
|
|
36
|
+
try:
|
|
37
|
+
return {entry.partition(".")[0] for entry in os.listdir(self.path)}
|
|
38
|
+
except OSError:
|
|
39
|
+
return set()
|
|
40
|
+
|
|
41
|
+
def find_spec(self, fullname, target=None):
|
|
42
|
+
if fullname.rpartition(".")[2] not in self._names:
|
|
43
|
+
return None
|
|
44
|
+
return self._inner.find_spec(fullname, target)
|
|
45
|
+
|
|
46
|
+
def invalidate_caches(self) -> None:
|
|
47
|
+
self._names = self._list()
|
|
48
|
+
self._inner.invalidate_caches()
|
|
49
|
+
|
|
50
|
+
def iter_modules(self, prefix: str = ""):
|
|
51
|
+
return pkgutil.iter_importer_modules(self._inner, prefix)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _hook(path: str):
|
|
55
|
+
if path not in _LISTED:
|
|
56
|
+
raise ImportError(path)
|
|
57
|
+
for hook in sys.path_hooks:
|
|
58
|
+
if hook is _hook:
|
|
59
|
+
continue
|
|
60
|
+
try:
|
|
61
|
+
inner = hook(path)
|
|
62
|
+
except ImportError:
|
|
63
|
+
continue
|
|
64
|
+
return _ListedOnce(path, inner)
|
|
65
|
+
raise ImportError(path)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def list_once(path: str) -> None:
|
|
69
|
+
"""Read what the directory PATH holds once, when the import system first
|
|
70
|
+
looks in it, and not again for each import."""
|
|
71
|
+
if _hook not in sys.path_hooks:
|
|
72
|
+
sys.path_hooks.insert(0, _hook)
|
|
73
|
+
if path not in _LISTED:
|
|
74
|
+
_LISTED.add(path)
|
|
75
|
+
sys.path_importer_cache.pop(path, None)
|
{splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework.egg-info/SOURCES.txt
RENAMED
|
@@ -140,6 +140,7 @@ src/splent_framework/utils/__init__.py
|
|
|
140
140
|
src/splent_framework/utils/app_loader.py
|
|
141
141
|
src/splent_framework/utils/feature_utils.py
|
|
142
142
|
src/splent_framework/utils/form_helpers.py
|
|
143
|
+
src/splent_framework/utils/listed_once.py
|
|
143
144
|
src/splent_framework/utils/path_utils.py
|
|
144
145
|
src/splent_framework/utils/pyproject_reader.py
|
|
145
146
|
src/splent_framework/utils/text.py
|
|
@@ -183,11 +184,13 @@ tests/test_icons.py
|
|
|
183
184
|
tests/test_isolated.py
|
|
184
185
|
tests/test_keys.py
|
|
185
186
|
tests/test_lazy_package_init.py
|
|
187
|
+
tests/test_listed_once.py
|
|
186
188
|
tests/test_locale_manager.py
|
|
187
189
|
tests/test_locustfile_bootstrap.py
|
|
188
190
|
tests/test_mapper_guard.py
|
|
189
191
|
tests/test_markdown.py
|
|
190
192
|
tests/test_migration_manager.py
|
|
193
|
+
tests/test_migration_tracking_table.py
|
|
191
194
|
tests/test_namespace_manager.py
|
|
192
195
|
tests/test_observability_report.py
|
|
193
196
|
tests/test_optional.py
|
|
@@ -277,3 +277,47 @@ class TestStableOrdering:
|
|
|
277
277
|
assert result.index(pkg("mail")) < result.index(pkg("reset"))
|
|
278
278
|
# public and auth keep their relative order (public before auth in input)
|
|
279
279
|
assert result.index(pkg("public")) < result.index(pkg("auth"))
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
# ---------------------------------------------------------------------------
|
|
283
|
+
# dependencies(): the edges, for callers that start independent features at once
|
|
284
|
+
# ---------------------------------------------------------------------------
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
class TestDependencies:
|
|
288
|
+
def test_each_entry_lists_what_it_must_come_after(self, tmp_path):
|
|
289
|
+
uvl = write_uvl(tmp_path, SAMPLE_UVL)
|
|
290
|
+
entries = [
|
|
291
|
+
"splent-io/splent_feature_profile@v1.0.0",
|
|
292
|
+
"splent-io/splent_feature_auth@v1.0.0",
|
|
293
|
+
"splent-io/splent_feature_mail",
|
|
294
|
+
"splent-io/splent_feature_reset",
|
|
295
|
+
"splent-io/splent_feature_public",
|
|
296
|
+
]
|
|
297
|
+
deps = RESOLVER.dependencies(entries, uvl)
|
|
298
|
+
assert deps == {
|
|
299
|
+
"splent-io/splent_feature_profile@v1.0.0": [
|
|
300
|
+
"splent-io/splent_feature_auth@v1.0.0"
|
|
301
|
+
],
|
|
302
|
+
"splent-io/splent_feature_auth@v1.0.0": [],
|
|
303
|
+
"splent-io/splent_feature_mail": [],
|
|
304
|
+
"splent-io/splent_feature_reset": ["splent-io/splent_feature_mail"],
|
|
305
|
+
"splent-io/splent_feature_public": [],
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
def test_refinements_are_edges_too(self):
|
|
309
|
+
entries = ["splent_feature_notes_tags", "splent_feature_notes"]
|
|
310
|
+
deps = RESOLVER.dependencies(
|
|
311
|
+
entries,
|
|
312
|
+
None,
|
|
313
|
+
refines={"splent_feature_notes_tags": "splent_feature_notes"},
|
|
314
|
+
)
|
|
315
|
+
assert deps["splent_feature_notes_tags"] == ["splent_feature_notes"]
|
|
316
|
+
assert deps["splent_feature_notes"] == []
|
|
317
|
+
|
|
318
|
+
def test_without_a_uvl_nothing_depends_on_anything(self, tmp_path):
|
|
319
|
+
entries = ["splent_feature_auth", "splent_feature_profile"]
|
|
320
|
+
assert RESOLVER.dependencies(entries, str(tmp_path / "missing.uvl")) == {
|
|
321
|
+
"splent_feature_auth": [],
|
|
322
|
+
"splent_feature_profile": [],
|
|
323
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"""A feature's src/ is read once by the import system, not on every import."""
|
|
2
|
+
|
|
3
|
+
import importlib
|
|
4
|
+
import os
|
|
5
|
+
import pkgutil
|
|
6
|
+
import sys
|
|
7
|
+
|
|
8
|
+
import pytest
|
|
9
|
+
|
|
10
|
+
from splent_framework.managers.feature_loader import FeatureEntryParser
|
|
11
|
+
from splent_framework.managers.namespace_manager import NamespaceManager
|
|
12
|
+
from splent_framework.utils import listed_once
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@pytest.fixture(autouse=True)
|
|
16
|
+
def import_state(monkeypatch):
|
|
17
|
+
monkeypatch.setattr(listed_once, "_LISTED", set())
|
|
18
|
+
monkeypatch.setattr(sys, "path", list(sys.path))
|
|
19
|
+
monkeypatch.setattr(sys, "path_hooks", list(sys.path_hooks))
|
|
20
|
+
monkeypatch.setattr(sys, "path_importer_cache", dict(sys.path_importer_cache))
|
|
21
|
+
before = set(sys.modules)
|
|
22
|
+
yield
|
|
23
|
+
for name in set(sys.modules) - before:
|
|
24
|
+
del sys.modules[name]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _module(folder, name):
|
|
28
|
+
folder.mkdir(parents=True, exist_ok=True)
|
|
29
|
+
(folder / f"{name}.py").write_text(f"NAME = {name!r}\n")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def test_a_listed_directory_finds_what_it_holds(tmp_path):
|
|
33
|
+
_module(tmp_path, "listed_a")
|
|
34
|
+
listed_once.list_once(str(tmp_path))
|
|
35
|
+
sys.path.insert(0, str(tmp_path))
|
|
36
|
+
assert importlib.import_module("listed_a").NAME == "listed_a"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def test_a_name_it_did_not_hold_is_not_looked_for_until_caches_are_invalidated(
|
|
40
|
+
tmp_path,
|
|
41
|
+
):
|
|
42
|
+
_module(tmp_path, "listed_a")
|
|
43
|
+
listed_once.list_once(str(tmp_path))
|
|
44
|
+
sys.path.insert(0, str(tmp_path))
|
|
45
|
+
importlib.import_module("listed_a")
|
|
46
|
+
|
|
47
|
+
_module(tmp_path, "listed_b")
|
|
48
|
+
assert sys.path_importer_cache[str(tmp_path)].find_spec("listed_b") is None
|
|
49
|
+
|
|
50
|
+
importlib.invalidate_caches()
|
|
51
|
+
assert importlib.import_module("listed_b").NAME == "listed_b"
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def test_a_directory_not_listed_keeps_pythons_finder(tmp_path):
|
|
55
|
+
_module(tmp_path, "plain_a")
|
|
56
|
+
listed_once.list_once(str(tmp_path / "elsewhere"))
|
|
57
|
+
sys.path.insert(0, str(tmp_path))
|
|
58
|
+
importlib.import_module("plain_a")
|
|
59
|
+
assert type(sys.path_importer_cache[str(tmp_path)]).__name__ == "FileFinder"
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def test_its_modules_are_still_listed(tmp_path):
|
|
63
|
+
_module(tmp_path, "listed_a")
|
|
64
|
+
listed_once.list_once(str(tmp_path))
|
|
65
|
+
assert [m.name for m in pkgutil.iter_modules([str(tmp_path)])] == ["listed_a"]
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def test_a_declared_feature_and_its_org_folder_are_listed(tmp_path):
|
|
69
|
+
src = tmp_path / "features" / "org_l" / "feat_l" / "src"
|
|
70
|
+
package = src / "org_l" / "feat_l"
|
|
71
|
+
package.mkdir(parents=True)
|
|
72
|
+
(package / "__init__.py").write_text("NAME = 'feat_l'\n")
|
|
73
|
+
ref = FeatureEntryParser().parse("org-l/feat_l")
|
|
74
|
+
|
|
75
|
+
NamespaceManager._add_declared_features(str(tmp_path / "features"), [ref])
|
|
76
|
+
|
|
77
|
+
assert importlib.import_module("org_l.feat_l").NAME == "feat_l"
|
|
78
|
+
for folder in (src, src / "org_l"):
|
|
79
|
+
finder = sys.path_importer_cache[str(folder)]
|
|
80
|
+
assert isinstance(finder, listed_once._ListedOnce)
|
|
81
|
+
assert os.path.realpath(sys.modules["org_l.feat_l"].__file__) == os.path.realpath(
|
|
82
|
+
package / "__init__.py"
|
|
83
|
+
)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""splent_migrations is created by whatever reads or writes it, not by
|
|
2
|
+
building the app, so an app builds while its database is down."""
|
|
3
|
+
|
|
4
|
+
import contextlib
|
|
5
|
+
|
|
6
|
+
import pytest
|
|
7
|
+
from flask import Flask
|
|
8
|
+
from sqlalchemy.engine import Engine
|
|
9
|
+
|
|
10
|
+
import splent_framework.managers.migration_manager as mm
|
|
11
|
+
from splent_framework.utils.path_utils import PathUtils
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def test_building_the_app_does_not_reach_the_database(tmp_path, monkeypatch):
|
|
15
|
+
def reached(*args, **kwargs):
|
|
16
|
+
raise AssertionError("the database was reached")
|
|
17
|
+
|
|
18
|
+
monkeypatch.setattr(Engine, "connect", reached)
|
|
19
|
+
monkeypatch.setattr(Engine, "begin", reached)
|
|
20
|
+
monkeypatch.setattr(PathUtils, "get_migrations_dir", lambda: str(tmp_path))
|
|
21
|
+
app = Flask(__name__)
|
|
22
|
+
app.config["SQLALCHEMY_DATABASE_URI"] = "mysql+pymysql://u:p@db.invalid/x"
|
|
23
|
+
|
|
24
|
+
manager = mm.MigrationManager(app)
|
|
25
|
+
|
|
26
|
+
assert manager.migrate is not None
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class _Connection:
|
|
30
|
+
def __init__(self, log):
|
|
31
|
+
self.log = log
|
|
32
|
+
|
|
33
|
+
def execute(self, statement, params=None):
|
|
34
|
+
self.log.append(str(statement).split()[0].upper())
|
|
35
|
+
|
|
36
|
+
class Rows:
|
|
37
|
+
def fetchall(self):
|
|
38
|
+
return []
|
|
39
|
+
|
|
40
|
+
return Rows()
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@pytest.fixture
|
|
44
|
+
def statements(monkeypatch):
|
|
45
|
+
log = []
|
|
46
|
+
|
|
47
|
+
class Engine_:
|
|
48
|
+
@contextlib.contextmanager
|
|
49
|
+
def begin(self):
|
|
50
|
+
yield _Connection(log)
|
|
51
|
+
|
|
52
|
+
class Db:
|
|
53
|
+
engine = Engine_()
|
|
54
|
+
|
|
55
|
+
monkeypatch.setattr(mm, "db", Db())
|
|
56
|
+
return log
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@pytest.mark.parametrize(
|
|
60
|
+
"use",
|
|
61
|
+
[
|
|
62
|
+
lambda app: mm.MigrationManager.get_all_status(app),
|
|
63
|
+
lambda app: mm.MigrationManager.update_feature_status(app, "f", "r1"),
|
|
64
|
+
lambda app: mm.MigrationManager.delete_feature_status(app, "f"),
|
|
65
|
+
],
|
|
66
|
+
ids=["read", "write", "delete"],
|
|
67
|
+
)
|
|
68
|
+
def test_each_use_creates_the_table_first(statements, use):
|
|
69
|
+
use(Flask(__name__))
|
|
70
|
+
assert statements[0] == "CREATE"
|
|
71
|
+
assert len(statements) == 2
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/assets/asset_registry.py
RENAMED
|
File without changes
|
{splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/assets/feature_assets.py
RENAMED
|
File without changes
|
|
File without changes
|
{splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/blueprints/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/bootstraps/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/configuration/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/configuration/layers.py
RENAMED
|
File without changes
|
{splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/content/__init__.py
RENAMED
|
File without changes
|
{splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/context/__init__.py
RENAMED
|
File without changes
|
{splent_framework-1.30.2 → splent_framework-1.31.0}/src/splent_framework/context/context_manager.py
RENAMED
|
File without changes
|