orionis 0.252.0__py3-none-any.whl → 0.265.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- orionis/application.py +6 -0
- orionis/framework.py +1 -1
- orionis/luminate/{application.py → _application.py} +21 -19
- orionis/luminate/{container → _container}/container.py +4 -4
- orionis/luminate/{container → _container}/container_integrity.py +2 -2
- orionis/luminate/{container → _container}/resolve.py +2 -2
- orionis/luminate/{contracts → _contracts}/application.py +2 -2
- orionis/luminate/{contracts → _contracts}/console/task_manager.py +1 -1
- orionis/luminate/{contracts → _contracts}/facades/commands/scheduler_facade.py +1 -1
- orionis/luminate/{contracts → _contracts}/facades/facade.py +4 -3
- orionis/luminate/{contracts → _contracts}/foundation/providers/service_providers_bootstrapper.py +2 -2
- orionis/luminate/{contracts → _contracts}/providers/service_provider.py +1 -1
- orionis/luminate/{facades → _facades}/app_facade.py +2 -2
- orionis/luminate/{facades → _facades}/commands/commands_facade.py +3 -3
- orionis/luminate/{facades → _facades}/commands/scheduler_facade.py +3 -3
- orionis/luminate/{facades → _facades}/config/config_facade.py +3 -3
- orionis/luminate/{facades → _facades}/environment/environment_facade.py +3 -3
- orionis/luminate/{facades → _facades}/files/path_facade.py +4 -4
- orionis/luminate/{facades → _facades}/log/log_facade.py +2 -2
- orionis/luminate/{foundation → _foundation}/console/command_bootstrapper.py +2 -2
- orionis/luminate/{foundation → _foundation}/environment/environment_bootstrapper.py +3 -3
- orionis/luminate/{foundation → _foundation/foundation}/config/config_bootstrapper.py +3 -3
- orionis/luminate/{foundation → _foundation}/providers/service_providers_bootstrapper.py +4 -4
- orionis/luminate/{providers → _providers}/commands/reactor_commands_service_provider.py +7 -7
- orionis/luminate/{providers → _providers}/commands/scheduler_provider.py +3 -3
- orionis/luminate/{providers → _providers}/config/config_service_provider.py +3 -3
- orionis/luminate/{providers → _providers}/environment/environment__service_provider.py +4 -4
- orionis/luminate/_providers/files/paths_provider.py +21 -0
- orionis/luminate/{providers → _providers}/log/log_service_provider.py +5 -5
- orionis/luminate/{providers → _providers}/service_provider.py +2 -2
- orionis/luminate/{services_ → _services}/commands/reactor_commands_service.py +3 -3
- orionis/luminate/{services_ → _services}/commands/scheduler_service.py +1 -1
- orionis/luminate/{services_ → _services}/config/config_service.py +1 -1
- orionis/luminate/{services_ → _services}/log/log_service.py +1 -1
- orionis/luminate/app.py +19 -0
- orionis/luminate/console/base/command.py +1 -1
- orionis/luminate/console/command_filter.py +1 -1
- orionis/luminate/console/commands/help.py +1 -1
- orionis/luminate/console/commands/schedule_work.py +2 -2
- orionis/luminate/console/dumper/dump_die.py +1 -1
- orionis/luminate/console/kernel.py +1 -1
- orionis/luminate/console/output/console.py +3 -3
- orionis/luminate/console/output/executor.py +1 -1
- orionis/luminate/console/output/progress_bar.py +1 -1
- orionis/luminate/console/parser.py +1 -1
- orionis/luminate/{config → foundation/config}/app/entities/app.py +44 -43
- orionis/luminate/{config → foundation/config}/auth/entities/auth.py +9 -1
- orionis/luminate/foundation/config/cache/entities/cache.py +74 -0
- orionis/luminate/foundation/config/cache/entities/file.py +46 -0
- orionis/luminate/foundation/config/cache/entities/stores.py +46 -0
- orionis/luminate/{contracts/config → foundation/config/contracts}/config.py +8 -12
- orionis/luminate/foundation/config/cors/entities/cors.py +129 -0
- orionis/luminate/foundation/config/database/entities/connections.py +89 -0
- orionis/luminate/foundation/config/database/entities/database.py +62 -0
- orionis/luminate/foundation/config/database/entities/mysql.py +270 -0
- orionis/luminate/foundation/config/database/entities/oracle.py +227 -0
- orionis/luminate/foundation/config/database/entities/pgsql.py +189 -0
- orionis/luminate/foundation/config/database/entities/sqlite.py +178 -0
- orionis/luminate/foundation/config/database/enums/mysql_charsets.py +92 -0
- orionis/luminate/foundation/config/database/enums/mysql_collations.py +53 -0
- orionis/luminate/foundation/config/database/enums/mysql_engine.py +18 -0
- orionis/luminate/foundation/config/database/enums/oracle_encoding.py +44 -0
- orionis/luminate/foundation/config/database/enums/oracle_nencoding.py +31 -0
- orionis/luminate/foundation/config/database/enums/pgsql_charsets.py +90 -0
- orionis/luminate/foundation/config/database/enums/pgsql_collations.py +26 -0
- orionis/luminate/foundation/config/database/enums/pgsql_mode.py +24 -0
- orionis/luminate/foundation/config/database/enums/sqlite_foreign_key.py +12 -0
- orionis/luminate/foundation/config/database/enums/sqlite_journal.py +22 -0
- orionis/luminate/foundation/config/database/enums/sqlite_synchronous.py +16 -0
- orionis/luminate/foundation/config/filesystems/entitites/aws.py +134 -0
- orionis/luminate/foundation/config/filesystems/entitites/disks.py +68 -0
- orionis/luminate/foundation/config/filesystems/entitites/filesystems.py +53 -0
- orionis/luminate/foundation/config/filesystems/entitites/local.py +39 -0
- orionis/luminate/foundation/config/filesystems/entitites/public.py +52 -0
- orionis/luminate/foundation/config/logging/entities/channels.py +115 -0
- orionis/luminate/foundation/config/logging/entities/chunked.py +128 -0
- orionis/luminate/foundation/config/logging/entities/daily.py +113 -0
- orionis/luminate/foundation/config/logging/entities/hourly.py +100 -0
- orionis/luminate/foundation/config/logging/entities/logging.py +51 -0
- orionis/luminate/foundation/config/logging/entities/monthly.py +100 -0
- orionis/luminate/foundation/config/logging/entities/stack.py +74 -0
- orionis/luminate/foundation/config/logging/entities/weekly.py +102 -0
- orionis/luminate/foundation/config/logging/enums/levels.py +21 -0
- orionis/luminate/foundation/config/mail/entities/file.py +41 -0
- orionis/luminate/foundation/config/mail/entities/mail.py +56 -0
- orionis/luminate/foundation/config/mail/entities/mailers.py +54 -0
- orionis/luminate/foundation/config/mail/entities/smtp.py +104 -0
- orionis/luminate/foundation/config/queue/entities/brokers.py +55 -0
- orionis/luminate/foundation/config/queue/entities/database.py +107 -0
- orionis/luminate/foundation/config/queue/entities/queue.py +47 -0
- orionis/luminate/foundation/config/queue/enums/strategy.py +15 -0
- orionis/luminate/foundation/config/roots/paths.py +446 -0
- orionis/luminate/foundation/config/session/entities/session.py +147 -0
- orionis/luminate/foundation/config/session/enums/same_site_policy.py +14 -0
- orionis/luminate/foundation/config/session/helpers/secret_key.py +16 -0
- orionis/luminate/foundation/config/startup.py +203 -0
- orionis/luminate/foundation/config/testing/entities/__init__.py +0 -0
- orionis/luminate/{config → foundation/config/testing}/entities/testing.py +36 -20
- orionis/luminate/foundation/config/testing/enums/__init__.py +0 -0
- orionis/luminate/foundation/config/testing/enums/test_mode.py +12 -0
- orionis/luminate/patterns/__init__.py +0 -4
- orionis/luminate/patterns/singleton/__init__.py +0 -10
- orionis/luminate/services/asynchrony/__init__.py +0 -0
- orionis/luminate/services/asynchrony/async_io.py +31 -0
- orionis/luminate/services/environment/__init__.py +0 -10
- orionis/luminate/services/environment/contracts/__init__.py +0 -5
- orionis/luminate/services/environment/contracts/env.py +0 -11
- orionis/luminate/services/environment/dot_env.py +87 -163
- orionis/luminate/services/environment/env.py +0 -11
- orionis/luminate/services/introspection/__init__.py +0 -0
- orionis/luminate/services/introspection/abstracts/__init__.py +0 -0
- orionis/luminate/services/introspection/abstracts/entities/__init__.py +0 -0
- orionis/luminate/services/introspection/abstracts/entities/abstract_class_attributes.py +37 -0
- orionis/luminate/{support → services}/introspection/abstracts/reflect_abstract.py +1 -1
- orionis/luminate/services/introspection/dependencies/__init__.py +0 -0
- orionis/luminate/services/introspection/dependencies/contracts/__init__.py +0 -0
- orionis/luminate/{support → services}/introspection/dependencies/contracts/reflect_dependencies.py +2 -2
- orionis/luminate/services/introspection/dependencies/entities/__init__.py +0 -0
- orionis/luminate/services/introspection/dependencies/entities/class_dependencies.py +41 -0
- orionis/luminate/services/introspection/dependencies/entities/method_dependencies.py +42 -0
- orionis/luminate/services/introspection/dependencies/entities/resolved_dependencies.py +49 -0
- orionis/luminate/{support → services}/introspection/dependencies/reflect_dependencies.py +4 -4
- orionis/luminate/services/parsers/__init__.py +0 -0
- orionis/luminate/services/parsers/contracts/__init__.py +0 -0
- orionis/luminate/{support/parsers/exception_parser.py → services/parsers/exception.py} +1 -1
- orionis/luminate/services/parsers/serializer.py +15 -0
- orionis/luminate/services/paths/__init__.py +0 -9
- orionis/luminate/services/paths/resolver.py +1 -1
- orionis/luminate/services/standard/__init__.py +0 -0
- orionis/luminate/services/standard/contracts/__init__.py +0 -0
- orionis/luminate/{support → services}/standard/std.py +1 -1
- orionis/luminate/services/system/__init__.py +0 -0
- orionis/luminate/services/system/contracts/__init__.py +0 -0
- orionis/luminate/services/system/contracts/imports.py +31 -0
- orionis/luminate/services/system/contracts/workers.py +18 -0
- orionis/luminate/services/system/imports.py +124 -0
- orionis/luminate/services/system/runtime_imports.py +70 -0
- orionis/luminate/services/{workers/maximum_workers.py → system/workers.py} +2 -1
- orionis/luminate/services/wrapper/__init__.py +0 -0
- orionis/luminate/services/wrapper/dicts/__init__.py +0 -0
- orionis/luminate/services/wrapper/dicts/dot_dict.py +115 -0
- orionis/luminate/support/introspection/__init__.py +0 -5
- orionis/luminate/support/introspection/container_integrity.py +2 -2
- orionis/luminate/support/introspection/instances/__init__.py +0 -5
- orionis/luminate/support/introspection/reflection.py +1 -1
- orionis/luminate/test/__init__.py +0 -23
- orionis/luminate/test/cases/test_async.py +41 -9
- orionis/luminate/test/cases/test_case.py +27 -13
- orionis/luminate/test/cases/test_sync.py +28 -6
- orionis/luminate/test/output/contracts/{test_std_out.py → dumper.py} +2 -1
- orionis/luminate/test/output/{test_std_out.py → dumper.py} +7 -4
- orionis/luminate/test/suites/__init__.py +0 -0
- orionis/luminate/test/suites/contracts/__init__.py +0 -0
- orionis/luminate/test/suites/contracts/test_suite.py +23 -0
- orionis/luminate/test/suites/test_suite.py +101 -0
- orionis/luminate/test/{core → suites}/test_unit.py +16 -8
- orionis/unittesting.py +43 -0
- {orionis-0.252.0.dist-info → orionis-0.265.0.dist-info}/METADATA +19 -3
- orionis-0.265.0.dist-info/RECORD +440 -0
- {orionis-0.252.0.dist-info → orionis-0.265.0.dist-info}/WHEEL +1 -1
- orionis-0.265.0.dist-info/entry_points.txt +2 -0
- orionis-0.265.0.dist-info/zip-safe +1 -0
- tests/example/test_example.py +1 -1
- tests/foundation/__init__.py +0 -0
- tests/foundation/config/__init__.py +0 -0
- tests/foundation/config/app/__init__.py +0 -0
- tests/foundation/config/app/test_app.py +140 -0
- tests/foundation/config/auth/__init__.py +0 -0
- tests/{config → foundation/config/auth}/test_auth.py +6 -3
- tests/foundation/config/cache/__init__.py +0 -0
- tests/foundation/config/cache/test_cache.py +98 -0
- tests/foundation/config/cache/test_cache_file.py +78 -0
- tests/foundation/config/cache/test_cache_stores.py +88 -0
- tests/foundation/config/cors/__init__.py +0 -0
- tests/foundation/config/cors/test_cors.py +121 -0
- tests/foundation/config/database/__init__.py +0 -0
- tests/foundation/config/database/test_database.py +108 -0
- tests/foundation/config/database/test_database_connections.py +129 -0
- tests/foundation/config/database/test_database_mysql.py +231 -0
- tests/foundation/config/database/test_database_oracle.py +204 -0
- tests/foundation/config/database/test_database_pgsql.py +187 -0
- tests/foundation/config/database/test_database_sqlite.py +153 -0
- tests/foundation/config/exceptions/__init__.py +0 -0
- tests/foundation/config/exceptions/test_exceptions_integrity.py +83 -0
- tests/foundation/config/filesystems/__init__.py +0 -0
- tests/foundation/config/filesystems/test_filesystems.py +110 -0
- tests/foundation/config/filesystems/test_filesystems_aws.py +133 -0
- tests/foundation/config/filesystems/test_filesystems_disks.py +114 -0
- tests/foundation/config/filesystems/test_filesystems_local.py +95 -0
- tests/foundation/config/filesystems/test_filesystems_public.py +120 -0
- tests/foundation/config/logging/__init__.py +0 -0
- tests/foundation/config/logging/test_logging.py +48 -0
- tests/foundation/config/logging/test_logging_channels.py +157 -0
- tests/foundation/config/logging/test_logging_chunked.py +166 -0
- tests/foundation/config/logging/test_logging_daily.py +153 -0
- tests/foundation/config/logging/test_logging_hourly.py +131 -0
- tests/foundation/config/logging/test_logging_monthly.py +133 -0
- tests/foundation/config/logging/test_logging_stack.py +124 -0
- tests/foundation/config/logging/test_logging_weekly.py +133 -0
- tests/foundation/config/mail/__init__.py +0 -0
- tests/foundation/config/mail/test_mail.py +73 -0
- tests/foundation/config/mail/test_mail_file.py +61 -0
- tests/foundation/config/mail/test_mail_mailers.py +58 -0
- tests/foundation/config/mail/test_mail_smtp.py +102 -0
- tests/foundation/config/queue/__init__.py +0 -0
- tests/foundation/config/queue/test_queue.py +58 -0
- tests/foundation/config/queue/test_queue_brokers.py +67 -0
- tests/foundation/config/queue/test_queue_database.py +95 -0
- tests/foundation/config/root/__init__.py +0 -0
- tests/foundation/config/root/test_root_paths.py +134 -0
- tests/foundation/config/session/__init__.py +0 -0
- tests/foundation/config/session/test_session.py +138 -0
- tests/foundation/config/startup/__init__.py +0 -0
- tests/foundation/config/startup/test_config_startup.py +134 -0
- tests/foundation/config/testing/__init__.py +0 -0
- tests/foundation/config/testing/test_testing.py +167 -0
- tests/patterns/singleton/test_singleton.py +2 -2
- tests/services/asynchrony/__init__.py +0 -0
- tests/{support/async_io/test_async_coroutine.py → services/asynchrony/test_async_io.py} +6 -5
- tests/services/environment/test_env.py +155 -33
- tests/services/inspection/__init__.py +0 -0
- tests/services/inspection/dependencies/__init__.py +0 -0
- tests/services/inspection/dependencies/mocks/__init__.py +0 -0
- tests/services/inspection/dependencies/mocks/mock_user.py +30 -0
- tests/services/inspection/dependencies/mocks/mock_user_controller.py +27 -0
- tests/services/inspection/dependencies/mocks/mock_users_permissions.py +41 -0
- tests/services/inspection/dependencies/test_reflect_dependencies.py +94 -0
- tests/services/parsers/__init__.py +0 -0
- tests/services/parsers/mocks/__init__.py +0 -0
- tests/services/parsers/mocks/mock_custom_error.py +15 -0
- tests/{support → services}/parsers/test_exception_parser.py +8 -8
- tests/services/path/__init__.py +0 -0
- tests/services/path/test_resolver.py +73 -0
- tests/services/standard/__init__.py +0 -0
- tests/services/standard/test_std.py +127 -0
- tests/services/wrapper/__init__.py +0 -0
- tests/services/wrapper/test_wrapper_doc_dict.py +129 -0
- tests/testing/__init__.py +0 -0
- tests/testing/test_testing_result.py +92 -0
- tests/testing/test_testing_unit.py +138 -0
- orionis/luminate/config/app/__init__.py +0 -10
- orionis/luminate/config/auth/__init__.py +0 -7
- orionis/luminate/config/cache/__init__.py +0 -9
- orionis/luminate/config/cache/entities/cache.py +0 -58
- orionis/luminate/config/cache/entities/file.py +0 -29
- orionis/luminate/config/cache/entities/stores.py +0 -35
- orionis/luminate/config/entities/cors.py +0 -58
- orionis/luminate/config/entities/database.py +0 -204
- orionis/luminate/config/entities/filesystems.py +0 -98
- orionis/luminate/config/entities/logging.py +0 -157
- orionis/luminate/config/entities/mail.py +0 -76
- orionis/luminate/config/entities/queue.py +0 -62
- orionis/luminate/config/entities/session.py +0 -58
- orionis/luminate/providers/files/paths_provider.py +0 -20
- orionis/luminate/services/workers/__init__.py +0 -10
- orionis/luminate/support/adapters/dot_dict.py +0 -29
- orionis/luminate/support/asynchrony/async_io.py +0 -40
- orionis/luminate/support/asynchrony/contracts/async_coroutine.py +0 -26
- orionis/luminate/support/introspection/abstracts/entities/abstract_class_attributes.py +0 -11
- orionis/luminate/support/introspection/dependencies/__init__.py +0 -5
- orionis/luminate/support/introspection/dependencies/entities/class_dependencies.py +0 -11
- orionis/luminate/support/introspection/dependencies/entities/method_dependencies.py +0 -11
- orionis/luminate/support/introspection/dependencies/entities/resolved_dependencies.py +0 -12
- orionis/luminate/support/paths/contracts/resolver.py +0 -67
- orionis/luminate/support/paths/resolver.py +0 -83
- orionis/luminate/test/core/contracts/test_suite.py +0 -30
- orionis/luminate/test/core/test_suite.py +0 -93
- orionis-0.252.0.dist-info/RECORD +0 -318
- orionis-0.252.0.dist-info/entry_points.txt +0 -2
- tests/config/test_app.py +0 -122
- tests/config/test_cache.py +0 -20
- tests/support/adapters/fakes/fake_dict.py +0 -15
- tests/support/adapters/test_doct_dict.py +0 -21
- tests/support/inspection/fakes/fake_reflect_dependencies.py +0 -25
- tests/support/inspection/test_reflect_dependencies.py +0 -67
- tests/support/parsers/fakes/fake_custom_error.py +0 -27
- tests/support/path/test_resolver.py +0 -33
- tests/support/standard/test_std.py +0 -62
- /orionis/{console.py → clinstall.py} +0 -0
- /orionis/luminate/{config → _container}/__init__.py +0 -0
- /orionis/luminate/{container → _container}/exception.py +0 -0
- /orionis/luminate/{container → _container}/lifetimes.py +0 -0
- /orionis/luminate/{config/app/entities → _contracts}/__init__.py +0 -0
- /orionis/luminate/{config/app/enums → _contracts/config}/__init__.py +0 -0
- /orionis/luminate/{config/contracts → _contracts/config}/config.py +0 -0
- /orionis/luminate/{config/auth/entities → _contracts/console}/__init__.py +0 -0
- /orionis/luminate/{config/cache/entities → _contracts/console/base}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/console/base/command.py +0 -0
- /orionis/luminate/{contracts → _contracts}/console/command_filter.py +0 -0
- /orionis/luminate/{contracts → _contracts}/console/kernel.py +0 -0
- /orionis/luminate/{config/cache/enums → _contracts/console/output}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/console/output/console.py +0 -0
- /orionis/luminate/{contracts → _contracts}/console/output/executor.py +0 -0
- /orionis/luminate/{contracts → _contracts}/console/output/progress_bar.py +0 -0
- /orionis/luminate/{contracts → _contracts}/console/parser.py +0 -0
- /orionis/luminate/{contracts → _contracts}/container/container.py +0 -0
- /orionis/luminate/{contracts → _contracts}/container/container_integrity.py +0 -0
- /orionis/luminate/{config/contracts → _contracts/facades}/__init__.py +0 -0
- /orionis/luminate/{config/exceptions → _contracts/facades/commands}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/facades/commands/commands_facade.py +0 -0
- /orionis/luminate/{container → _contracts/facades/config}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/facades/config/config_facade.py +0 -0
- /orionis/luminate/{contracts → _contracts/facades/environment}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/facades/environment/environment_facade.py +0 -0
- /orionis/luminate/{contracts/config → _contracts/facades/files}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/facades/files/path_facade.py +0 -0
- /orionis/luminate/{contracts/console → _contracts/facades/log}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/facades/log/log_facade.py +0 -0
- /orionis/luminate/{contracts/console/base → _contracts/facades/tests}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/facades/tests/tests_facade.py +0 -0
- /orionis/luminate/{contracts/console/output → _contracts/foundation}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/foundation/bootstraper.py +0 -0
- /orionis/luminate/{contracts/facades → _contracts/foundation/config}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/foundation/config/config_bootstrapper.py +0 -0
- /orionis/luminate/{contracts/facades/commands → _contracts/foundation/console}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/foundation/console/command_bootstrapper.py +0 -0
- /orionis/luminate/{contracts/facades/config → _contracts/foundation/environment}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/foundation/environment/environment_bootstrapper.py +0 -0
- /orionis/luminate/{contracts/facades/environment → _contracts/foundation/providers}/__init__.py +0 -0
- /orionis/luminate/{contracts/facades/files → _contracts/providers}/__init__.py +0 -0
- /orionis/luminate/{contracts/facades/log → _contracts/services}/__init__.py +0 -0
- /orionis/luminate/{contracts/facades/tests → _contracts/services/commands}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/services/commands/reactor_commands_service.py +0 -0
- /orionis/luminate/{contracts → _contracts}/services/commands/schedule_service.py +0 -0
- /orionis/luminate/{contracts/foundation → _contracts/services/config}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/services/config/config_service.py +0 -0
- /orionis/luminate/{contracts/foundation/config → _contracts/services/environment}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/services/environment/environment_service.py +0 -0
- /orionis/luminate/{contracts/foundation/console → _contracts/services/files}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/services/files/path_resolver_service.py +0 -0
- /orionis/luminate/{contracts/foundation/environment → _contracts/services/log}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/services/log/log_service.py +0 -0
- /orionis/luminate/{contracts → _contracts}/support/exception_parse.py +0 -0
- /orionis/luminate/{contracts → _contracts}/support/reflection.py +0 -0
- /orionis/luminate/{contracts/foundation/providers → _facades}/__init__.py +0 -0
- /orionis/luminate/{contracts/providers → _facades/commands}/__init__.py +0 -0
- /orionis/luminate/{contracts/services → _facades/config}/__init__.py +0 -0
- /orionis/luminate/{contracts/services/commands → _facades/environment}/__init__.py +0 -0
- /orionis/luminate/{contracts/services/config → _facades/files}/__init__.py +0 -0
- /orionis/luminate/{contracts/services/environment → _facades/log}/__init__.py +0 -0
- /orionis/luminate/{contracts/services/files → _foundation}/__init__.py +0 -0
- /orionis/luminate/{contracts/services/log → _foundation/console}/__init__.py +0 -0
- /orionis/luminate/{facades → _foundation/environment}/__init__.py +0 -0
- /orionis/luminate/{facades/commands → _foundation/exceptions}/__init__.py +0 -0
- /orionis/luminate/{foundation → _foundation}/exceptions/exception_bootstrapper.py +0 -0
- /orionis/luminate/{foundation → _foundation}/exceptions/exception_providers.py +0 -0
- /orionis/luminate/{facades → _foundation/foundation}/config/__init__.py +0 -0
- /orionis/luminate/{facades/environment → _foundation/providers}/__init__.py +0 -0
- /orionis/luminate/{facades/files → _providers}/__init__.py +0 -0
- /orionis/luminate/{facades/log → _providers/commands}/__init__.py +0 -0
- /orionis/luminate/{foundation/console → _providers/config}/__init__.py +0 -0
- /orionis/luminate/{foundation → _providers}/environment/__init__.py +0 -0
- /orionis/luminate/{foundation/exceptions → _providers/files}/__init__.py +0 -0
- /orionis/luminate/{foundation/providers → _providers/log}/__init__.py +0 -0
- /orionis/luminate/{providers → _services}/__init__.py +0 -0
- /orionis/luminate/{providers → _services}/commands/__init__.py +0 -0
- /orionis/luminate/{providers → _services}/config/__init__.py +0 -0
- /orionis/luminate/{providers/environment → _services/log}/__init__.py +0 -0
- /orionis/luminate/{providers/files → foundation/config/app}/__init__.py +0 -0
- /orionis/luminate/{providers/log → foundation/config/app/entities}/__init__.py +0 -0
- /orionis/luminate/{services_ → foundation/config/app/enums}/__init__.py +0 -0
- /orionis/luminate/{config → foundation/config}/app/enums/ciphers.py +0 -0
- /orionis/luminate/{config → foundation/config}/app/enums/environments.py +0 -0
- /orionis/luminate/{services_/commands → foundation/config/auth}/__init__.py +0 -0
- /orionis/luminate/{services_/config → foundation/config/auth/entities}/__init__.py +0 -0
- /orionis/luminate/{services_/log → foundation/config/cache}/__init__.py +0 -0
- /orionis/luminate/{support/adapters → foundation/config/cache/entities}/__init__.py +0 -0
- /orionis/luminate/{support/asynchrony → foundation/config/cache/enums}/__init__.py +0 -0
- /orionis/luminate/{config → foundation/config}/cache/enums/drivers.py +0 -0
- /orionis/luminate/{support/asynchrony → foundation/config}/contracts/__init__.py +0 -0
- /orionis/luminate/{support/introspection/abstracts → foundation/config/cors}/__init__.py +0 -0
- /orionis/luminate/{support/introspection/abstracts → foundation/config/cors}/entities/__init__.py +0 -0
- /orionis/luminate/{support/introspection/dependencies/contracts → foundation/config/database}/__init__.py +0 -0
- /orionis/luminate/{support/introspection/dependencies → foundation/config/database}/entities/__init__.py +0 -0
- /orionis/luminate/{support/parsers → foundation/config/database/enums}/__init__.py +0 -0
- /orionis/luminate/{support/parsers/contracts → foundation/config/exceptions}/__init__.py +0 -0
- /orionis/luminate/{config/exceptions/integrity_exception.py → foundation/config/exceptions/integrity.py} +0 -0
- /orionis/luminate/{support/paths → foundation/config/filesystems}/__init__.py +0 -0
- /orionis/luminate/{support/paths/contracts → foundation/config/filesystems/entitites}/__init__.py +0 -0
- /orionis/luminate/{support/standard → foundation/config/logging}/__init__.py +0 -0
- /orionis/luminate/{support/standard/contracts → foundation/config/logging/entities}/__init__.py +0 -0
- /orionis/luminate/{test/core → foundation/config/logging/enums}/__init__.py +0 -0
- /orionis/luminate/{test/core/contracts → foundation/config/mail}/__init__.py +0 -0
- {tests/config → orionis/luminate/foundation/config/mail/entities}/__init__.py +0 -0
- {tests/support/adapters → orionis/luminate/foundation/config/queue}/__init__.py +0 -0
- {tests/support/adapters/fakes → orionis/luminate/foundation/config/queue/entities}/__init__.py +0 -0
- {tests/support/async_io → orionis/luminate/foundation/config/roots}/__init__.py +0 -0
- {tests/support/parsers → orionis/luminate/foundation/config/session}/__init__.py +0 -0
- {tests/support/parsers/fakes → orionis/luminate/foundation/config/session/entities}/__init__.py +0 -0
- {tests/support/path → orionis/luminate/foundation/config/session/enums}/__init__.py +0 -0
- {tests/support/standard → orionis/luminate/foundation/config/testing}/__init__.py +0 -0
- /orionis/luminate/{support → services}/parsers/contracts/exception_parser.py +0 -0
- /orionis/luminate/{support → services}/standard/contracts/std.py +0 -0
- /orionis/luminate/test/exceptions/{test_exception.py → test_failure_exception.py} +0 -0
- /orionis/luminate/test/{core → suites}/contracts/test_unit.py +0 -0
- {orionis-0.252.0.dist-info → orionis-0.265.0.dist-info/licenses}/LICENCE +0 -0
- {orionis-0.252.0.dist-info → orionis-0.265.0.dist-info}/top_level.txt +0 -0
@@ -1,9 +1,10 @@
|
|
1
|
-
import ast
|
2
1
|
import os
|
2
|
+
import ast
|
3
|
+
import threading
|
3
4
|
from pathlib import Path
|
4
5
|
from typing import Any, Optional, Union
|
5
6
|
from dotenv import dotenv_values, load_dotenv, set_key, unset_key
|
6
|
-
from orionis.luminate.patterns.singleton import Singleton
|
7
|
+
from orionis.luminate.patterns.singleton.meta_class import Singleton
|
7
8
|
|
8
9
|
class DotEnv(metaclass=Singleton):
|
9
10
|
"""
|
@@ -14,6 +15,8 @@ class DotEnv(metaclass=Singleton):
|
|
14
15
|
environment variables and vice versa.
|
15
16
|
"""
|
16
17
|
|
18
|
+
_lock = threading.RLock()
|
19
|
+
|
17
20
|
def __init__(self, path: str = None) -> None:
|
18
21
|
"""
|
19
22
|
Initializes the environment service by resolving the path to the `.env` file, ensuring its existence,
|
@@ -25,268 +28,189 @@ class DotEnv(metaclass=Singleton):
|
|
25
28
|
OSError: If the `.env` file cannot be created when it does not exist.
|
26
29
|
"""
|
27
30
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
31
|
+
with self._lock:
|
32
|
+
if path:
|
33
|
+
self._resolved_path = Path(path).expanduser().resolve()
|
34
|
+
else:
|
35
|
+
self._resolved_path = Path(os.getcwd()) / ".env"
|
33
36
|
|
34
|
-
|
35
|
-
|
36
|
-
self._resolved_path.touch()
|
37
|
+
if not self._resolved_path.exists():
|
38
|
+
self._resolved_path.touch()
|
37
39
|
|
38
|
-
|
39
|
-
load_dotenv(self._resolved_path)
|
40
|
+
load_dotenv(self._resolved_path)
|
40
41
|
|
41
|
-
def
|
42
|
-
"""
|
43
|
-
Deletes the `.env` file at the resolved path.
|
44
|
-
Returns:
|
45
|
-
bool: True if the `.env` file was successfully deleted, False if the file did not exist.
|
42
|
+
def get(self, key: str, default: Optional[Any] = None) -> Any:
|
46
43
|
"""
|
44
|
+
Retrieve the value of an environment variable by key.
|
47
45
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
46
|
+
This method first attempts to fetch the value from the dotenv file specified by
|
47
|
+
`self._resolved_path`. If the key is not found in the dotenv file, it falls back
|
48
|
+
to the system environment variables. If the key is not found in either location,
|
49
|
+
the provided `default` value is returned.
|
50
|
+
|
51
|
+
The returned value is parsed using the internal `__parseValue` method if found.
|
53
52
|
|
54
|
-
def get(self, key: str, default: Optional[Any] = None) -> Any:
|
55
|
-
"""
|
56
|
-
Retrieve the value of an environment variable.
|
57
|
-
This method attempts to fetch the value of the specified environment variable `key`
|
58
|
-
from a `.env` file. If the variable is not found in the `.env` file, it falls back
|
59
|
-
to the system environment variables. If the variable is still not found, the provided
|
60
|
-
`default` value is returned.
|
61
53
|
Args:
|
62
54
|
key (str): The name of the environment variable to retrieve.
|
63
|
-
default (Optional[Any], optional): The value to return if the
|
55
|
+
default (Optional[Any], optional): The value to return if the key is not found.
|
56
|
+
Defaults to None.
|
57
|
+
|
64
58
|
Returns:
|
65
|
-
Any: The value of the environment variable,
|
59
|
+
Any: The parsed value of the environment variable, or the default if not found.
|
66
60
|
"""
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
# If the value is not found, return the default value
|
74
|
-
return self.__parseValue(value) if value is not None else default
|
61
|
+
with self._lock:
|
62
|
+
value = dotenv_values(self._resolved_path).get(key)
|
63
|
+
if value is None:
|
64
|
+
value = os.getenv(key)
|
65
|
+
return self.__parseValue(value) if value is not None else default
|
75
66
|
|
76
67
|
def set(self, key: str, value: Union[str, int, float, bool, list, dict]) -> bool:
|
77
68
|
"""
|
78
|
-
Sets
|
79
|
-
Args:
|
80
|
-
key (str): The name of the environment variable to set.
|
81
|
-
value (Union[str, int, float, bool, list, dict]): The value to assign to the environment variable.
|
82
|
-
The value will be serialized before being written to the `.env` file.
|
83
|
-
Notes:
|
84
|
-
- The value is serialized for storage in the `.env` file.
|
85
|
-
- The environment variable is also set in the current process's environment, making it immediately available.
|
86
|
-
"""
|
87
|
-
|
88
|
-
# Serializes and sets the value of an environment variable in the `.env` file.
|
89
|
-
serialized_value = self.__serializeValue(value)
|
69
|
+
Sets an environment variable with the specified key and value.
|
90
70
|
|
91
|
-
|
92
|
-
set_key(str(self._resolved_path), key, serialized_value)
|
71
|
+
This method serializes the given value and updates both the .env file and the current process's environment variables.
|
93
72
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
os.environ[key] = str(value)
|
73
|
+
Args:
|
74
|
+
key (str): The name of the environment variable to set.
|
75
|
+
value (Union[str, int, float, bool, list, dict]): The value to assign to the environment variable. Supported types include string, integer, float, boolean, list, and dictionary.
|
98
76
|
|
99
|
-
|
100
|
-
|
77
|
+
Returns:
|
78
|
+
bool: True if the environment variable was successfully set.
|
79
|
+
"""
|
80
|
+
with self._lock:
|
81
|
+
serialized_value = self.__serializeValue(value)
|
82
|
+
set_key(str(self._resolved_path), key, serialized_value)
|
83
|
+
os.environ[key] = str(value)
|
84
|
+
return True
|
101
85
|
|
102
86
|
def unset(self, key: str) -> bool:
|
103
87
|
"""
|
104
|
-
Removes
|
105
|
-
Args:
|
106
|
-
key (str): The name of the environment variable to remove.
|
107
|
-
This method updates the `.env` file by removing the specified key and also ensures
|
108
|
-
that the variable is no longer present in the current process's environment variables.
|
109
|
-
"""
|
110
|
-
|
111
|
-
# Removes an environment variable from the `.env` file and from the system environment.
|
112
|
-
unset_key(str(self._resolved_path), key)
|
88
|
+
Removes the specified environment variable from both the .env file and the current process environment.
|
113
89
|
|
114
|
-
|
115
|
-
|
116
|
-
os.environ.pop(key, None)
|
90
|
+
Args:
|
91
|
+
key (str): The name of the environment variable to unset.
|
117
92
|
|
118
|
-
|
119
|
-
|
93
|
+
Returns:
|
94
|
+
bool: True if the operation was successful.
|
95
|
+
"""
|
96
|
+
with self._lock:
|
97
|
+
unset_key(str(self._resolved_path), key)
|
98
|
+
os.environ.pop(key, None)
|
99
|
+
return True
|
120
100
|
|
121
101
|
def all(self) -> dict:
|
122
102
|
"""
|
123
|
-
|
124
|
-
|
125
|
-
Reads the environment variables from the resolved `.env` file path, parses each value
|
126
|
-
using the `__parseValue` method, and returns a dictionary mapping variable names to their
|
127
|
-
parsed values.
|
103
|
+
Retrieves all environment variables from the resolved .env file.
|
128
104
|
|
129
105
|
Returns:
|
130
|
-
dict: A dictionary containing all environment
|
106
|
+
dict: A dictionary containing all environment variable key-value pairs,
|
107
|
+
with values parsed using the internal __parseValue method.
|
131
108
|
"""
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
raw_values = dotenv_values(self._resolved_path)
|
136
|
-
return {k: self.__parseValue(v) for k, v in raw_values.items()}
|
109
|
+
with self._lock:
|
110
|
+
raw_values = dotenv_values(self._resolved_path)
|
111
|
+
return {k: self.__parseValue(v) for k, v in raw_values.items()}
|
137
112
|
|
138
113
|
def toJson(self) -> str:
|
139
114
|
"""
|
140
|
-
|
141
|
-
|
142
|
-
This method retrieves all environment variables, parses their values using the
|
143
|
-
`__parseValue` method, and returns a JSON string representation of the resulting dictionary.
|
115
|
+
Serializes all environment variables managed by this instance to a JSON-formatted string.
|
144
116
|
|
145
117
|
Returns:
|
146
|
-
str: A JSON string
|
118
|
+
str: A JSON string representation of all environment variables, formatted with indentation for readability.
|
147
119
|
"""
|
148
|
-
|
149
|
-
# Converts the environment variables to a JSON string.
|
150
120
|
import json
|
151
|
-
|
121
|
+
with self._lock:
|
122
|
+
return json.dumps(self.all(), indent=4)
|
152
123
|
|
153
124
|
def toBase64(self) -> str:
|
154
125
|
"""
|
155
|
-
|
156
|
-
|
157
|
-
This method retrieves all environment variables, parses their values using the
|
158
|
-
`__parseValue` method, and returns a Base64 encoded string representation of the resulting dictionary.
|
126
|
+
Serializes all environment variables to a JSON string and encodes it in Base64.
|
159
127
|
|
160
128
|
Returns:
|
161
|
-
str: A Base64
|
129
|
+
str: A Base64-encoded string representation of all environment variables.
|
162
130
|
"""
|
163
|
-
|
164
|
-
# Converts the environment variables to a Base64 encoded string.
|
165
131
|
import base64
|
166
132
|
import json
|
167
|
-
|
133
|
+
with self._lock:
|
134
|
+
return base64.b64encode(json.dumps(self.all()).encode()).decode()
|
168
135
|
|
169
136
|
def __parseValue(self, value: Any) -> Any:
|
170
137
|
"""
|
171
|
-
Parses
|
172
|
-
|
173
|
-
- Returns None for None, empty strings, or string representations of null values ('none', 'null', 'nan').
|
174
|
-
- Returns the value unchanged if it is already a primitive type (bool, int, float).
|
175
|
-
- Converts string representations of booleans ('true', 'false') to their respective boolean values.
|
176
|
-
- Converts string representations of integers and floats to their respective numeric types.
|
177
|
-
- Attempts to evaluate the string as a Python literal (e.g., lists, dicts, tuples).
|
178
|
-
- Returns the original string if no conversion is possible.
|
138
|
+
Parses and converts the input value to an appropriate Python data type.
|
139
|
+
|
179
140
|
Args:
|
180
|
-
value (Any): The value to parse.
|
141
|
+
value (Any): The value to parse and convert.
|
142
|
+
|
181
143
|
Returns:
|
182
|
-
Any: The parsed value
|
144
|
+
Any: The parsed value, which may be of type None, bool, int, float, or the original string.
|
145
|
+
- Returns None for None, empty strings, or strings like 'none', 'null', 'nan' (case-insensitive).
|
146
|
+
- Returns a boolean for 'true'/'false' strings (case-insensitive).
|
147
|
+
- Returns an int if the string represents an integer.
|
148
|
+
- Returns a float if the string represents a float.
|
149
|
+
- Attempts to evaluate the string as a Python literal (e.g., list, dict, tuple).
|
150
|
+
- Returns the original string if no conversion is possible.
|
183
151
|
"""
|
184
|
-
|
185
|
-
# Parses a string value into a Python data type.
|
186
152
|
if value is None:
|
187
153
|
return None
|
188
|
-
|
189
|
-
# If it is already a primitive type, return it
|
190
154
|
if isinstance(value, (bool, int, float)):
|
191
155
|
return value
|
192
|
-
|
193
156
|
value_str = str(value).strip()
|
194
|
-
|
195
|
-
# Special cases: empty or representations of None
|
196
157
|
if not value_str or value_str.lower() in {'none', 'null', 'nan'}:
|
197
158
|
return None
|
198
|
-
|
199
|
-
# Booleans
|
200
159
|
if value_str.lower() == 'true':
|
201
160
|
return True
|
202
161
|
if value_str.lower() == 'false':
|
203
162
|
return False
|
204
|
-
|
205
|
-
# Try to convert to int
|
206
163
|
try:
|
207
164
|
if value_str.isdigit() or (value_str.startswith('-') and value_str[1:].isdigit()):
|
208
165
|
return int(value_str)
|
209
166
|
except Exception:
|
210
167
|
pass
|
211
|
-
|
212
|
-
# Try to convert to float
|
213
168
|
try:
|
214
169
|
float_val = float(value_str)
|
215
|
-
# Avoid converting strings like '1e10' to float if it is not really a number
|
216
170
|
if '.' in value_str or 'e' in value_str.lower():
|
217
171
|
return float_val
|
218
172
|
except Exception:
|
219
173
|
pass
|
220
|
-
|
221
|
-
# Try to evaluate as Python literal (lists, dicts, etc.)
|
222
174
|
try:
|
223
175
|
return ast.literal_eval(value_str)
|
224
176
|
except Exception:
|
225
177
|
pass
|
226
|
-
|
227
|
-
# If all else fails, return the original string
|
228
178
|
return value_str
|
229
179
|
|
230
180
|
def __serializeValue(self, value: Any) -> str:
|
231
181
|
"""
|
232
|
-
Serializes a
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
- int, float: converted to their string representation
|
238
|
-
- list, dict: converted to their string representation using repr()
|
239
|
-
Raises:
|
240
|
-
TypeError: If the value is an instance of a custom class or an unsupported type (e.g., set, tuple).
|
241
|
-
Args:
|
242
|
-
value (Any): The value to serialize.
|
182
|
+
Serializes a given value to a string suitable for storage in a .env file.
|
183
|
+
|
184
|
+
Parameters:
|
185
|
+
value (Any): The value to serialize. Supported types are None, str, bool, int, float, list, and dict.
|
186
|
+
|
243
187
|
Returns:
|
244
188
|
str: The serialized string representation of the value.
|
245
|
-
"""
|
246
189
|
|
247
|
-
|
248
|
-
|
190
|
+
Raises:
|
191
|
+
ValueError: If a float value is in scientific notation.
|
192
|
+
TypeError: If the value's type is not serializable for .env files.
|
193
|
+
"""
|
249
194
|
if value is None:
|
250
195
|
return "None"
|
251
|
-
|
252
|
-
# If it is a string, return it as is
|
253
196
|
if isinstance(value, str):
|
254
197
|
return value
|
255
|
-
|
256
|
-
# If it is a boolean, convert it to string
|
257
198
|
if isinstance(value, bool):
|
258
199
|
return str(value).lower()
|
259
|
-
|
260
|
-
# If it is a number, convert it to string
|
261
200
|
if isinstance(value, int):
|
262
201
|
return str(value)
|
263
|
-
|
264
|
-
# If is a float, convert it to string
|
265
202
|
if isinstance(value, float):
|
266
203
|
value = str(value)
|
267
204
|
if 'e' in value or 'E' in value:
|
268
205
|
raise ValueError('scientific notation is not supported, use a string instead')
|
269
206
|
return value
|
270
|
-
|
271
|
-
# If it is a list or dictionary, convert them to string
|
272
207
|
if isinstance(value, (list, dict)):
|
273
208
|
return repr(value)
|
274
|
-
|
275
|
-
# If it is an object of a custom class, raise an error
|
276
|
-
# This is useful to avoid problems when saving class instances in the .env file
|
277
209
|
if hasattr(value, '__dict__'):
|
278
210
|
raise TypeError(f"Type {type(value).__name__} is not serializable for .env")
|
279
|
-
|
280
|
-
# If it is an unsupported data type, raise an error
|
281
|
-
# This is useful to avoid problems when saving unsupported data types in the .env file
|
282
|
-
# such as sets, tuples, etc.
|
283
211
|
if not isinstance(value, (list, dict, bool, int, float, str)):
|
284
212
|
raise TypeError(f"Type {type(value).__name__} is not serializable for .env")
|
285
|
-
|
286
|
-
# Serializes a Python data type into a string for storing in the `.env` file.
|
287
|
-
# Only allows simple serializable types and not class instances.
|
288
213
|
if isinstance(value, (list, dict, bool, int, float, str)):
|
289
|
-
# Prevent serializing instances of custom classes
|
290
214
|
if type(value).__module__ != "builtins" and not isinstance(value, str):
|
291
215
|
raise TypeError(f"Type {type(value).__name__} is not serializable for .env")
|
292
216
|
return repr(value) if not isinstance(value, str) else value
|
@@ -51,17 +51,6 @@ class Env(IEnv):
|
|
51
51
|
"""
|
52
52
|
return Env._dotenv().all()
|
53
53
|
|
54
|
-
@staticmethod
|
55
|
-
def destroy() -> bool:
|
56
|
-
"""
|
57
|
-
Destroys the current environment by resetting the DotEnv instance.
|
58
|
-
"""
|
59
|
-
if Env._dotenv_instance is not None:
|
60
|
-
result = Env._dotenv_instance.destroy()
|
61
|
-
Env._dotenv_instance = None
|
62
|
-
return result
|
63
|
-
return False
|
64
|
-
|
65
54
|
@staticmethod
|
66
55
|
def toJson() -> str:
|
67
56
|
"""
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,37 @@
|
|
1
|
+
from dataclasses import dataclass, field
|
2
|
+
from typing import Any, Dict
|
3
|
+
|
4
|
+
@dataclass(frozen=True, kw_only=True)
|
5
|
+
class AbstractClassAttributes:
|
6
|
+
"""
|
7
|
+
A class to represent the attributes of an entity.
|
8
|
+
"""
|
9
|
+
public: Dict[str, Any] = field()
|
10
|
+
private: Dict[str, Any] = field()
|
11
|
+
protected: Dict[str, Any] = field()
|
12
|
+
|
13
|
+
def __post_init__(self):
|
14
|
+
"""
|
15
|
+
Post-initialization method to validate attribute types.
|
16
|
+
|
17
|
+
Ensures that the 'public', 'private', and 'protected' attributes of the instance
|
18
|
+
are all dictionaries. Raises a TypeError if any of these attributes are not of type dict.
|
19
|
+
|
20
|
+
Raises:
|
21
|
+
TypeError: If 'public', 'private', or 'protected' is not a dict.
|
22
|
+
"""
|
23
|
+
if not isinstance(self.public, dict):
|
24
|
+
raise TypeError(
|
25
|
+
f"Invalid type for 'public' attribute in {self.__class__.__name__}: "
|
26
|
+
f"expected 'dict', got '{type(self.public).__name__}'."
|
27
|
+
)
|
28
|
+
if not isinstance(self.private, dict):
|
29
|
+
raise TypeError(
|
30
|
+
f"Invalid type for 'private' attribute in {self.__class__.__name__}: "
|
31
|
+
f"expected 'dict', got '{type(self.private).__name__}'."
|
32
|
+
)
|
33
|
+
if not isinstance(self.protected, dict):
|
34
|
+
raise TypeError(
|
35
|
+
f"Invalid type for 'protected' attribute in {self.__class__.__name__}: "
|
36
|
+
f"expected 'dict', got '{type(self.protected).__name__}'."
|
37
|
+
)
|
@@ -3,7 +3,7 @@ import ast
|
|
3
3
|
import inspect
|
4
4
|
import types
|
5
5
|
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, TypeVar
|
6
|
-
from orionis.luminate.
|
6
|
+
from orionis.luminate.services.introspection.abstracts.entities.abstract_class_attributes import AbstractClassAttributes
|
7
7
|
|
8
8
|
ABC = TypeVar('ABC', bound=abc.ABC)
|
9
9
|
|
File without changes
|
File without changes
|
orionis/luminate/{support → services}/introspection/dependencies/contracts/reflect_dependencies.py
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
from abc import ABC, abstractmethod
|
2
|
-
from orionis.luminate.
|
3
|
-
from orionis.luminate.
|
2
|
+
from orionis.luminate.services.introspection.dependencies.entities.class_dependencies import ClassDependency
|
3
|
+
from orionis.luminate.services.introspection.dependencies.entities.method_dependencies import MethodDependency
|
4
4
|
|
5
5
|
class IReflectDependencies(ABC):
|
6
6
|
"""
|
File without changes
|
@@ -0,0 +1,41 @@
|
|
1
|
+
from dataclasses import dataclass
|
2
|
+
from typing import Any, Dict, List
|
3
|
+
from orionis.luminate.services.introspection.dependencies.entities.resolved_dependencies import ResolvedDependency
|
4
|
+
|
5
|
+
@dataclass(frozen=True, kw_only=True)
|
6
|
+
class ClassDependency:
|
7
|
+
"""
|
8
|
+
Represents the dependencies of a class, separating resolved and unresolved dependencies.
|
9
|
+
|
10
|
+
Attributes:
|
11
|
+
resolved (Dict[ResolvedDependency, Any]):
|
12
|
+
A dictionary mapping resolved dependency descriptors to their corresponding resolved instances or values.
|
13
|
+
All keys must be ResolvedDependency instances.
|
14
|
+
unresolved (List[str]):
|
15
|
+
A list of dependency names or identifiers that could not be resolved.
|
16
|
+
Must contain only strings.
|
17
|
+
"""
|
18
|
+
resolved: Dict[ResolvedDependency, Any]
|
19
|
+
unresolved: List[str]
|
20
|
+
|
21
|
+
def __post_init__(self):
|
22
|
+
"""
|
23
|
+
Validates types of attributes during initialization.
|
24
|
+
|
25
|
+
Raises:
|
26
|
+
TypeError: If types don't match the expected:
|
27
|
+
- resolved: Dict[ResolvedDependency, Any]
|
28
|
+
- unresolved: List[str]
|
29
|
+
ValueError: If resolved contains None keys or unresolved contains empty strings
|
30
|
+
"""
|
31
|
+
# Validate 'resolved' is a dict with ResolvedDependency keys
|
32
|
+
if not isinstance(self.resolved, dict):
|
33
|
+
raise TypeError(
|
34
|
+
f"'resolved' must be a dict, got {type(self.resolved).__name__}"
|
35
|
+
)
|
36
|
+
|
37
|
+
# Validate 'unresolved' is a list of non-empty strings
|
38
|
+
if not isinstance(self.unresolved, list):
|
39
|
+
raise TypeError(
|
40
|
+
f"'unresolved' must be a list, got {type(self.unresolved).__name__}"
|
41
|
+
)
|
@@ -0,0 +1,42 @@
|
|
1
|
+
from dataclasses import dataclass
|
2
|
+
from typing import Any, Dict, List
|
3
|
+
from orionis.luminate.services.introspection.dependencies.entities.resolved_dependencies import ResolvedDependency
|
4
|
+
|
5
|
+
@dataclass(frozen=True, kw_only=True)
|
6
|
+
class MethodDependency:
|
7
|
+
"""
|
8
|
+
Represents the dependencies of a method, separating resolved and unresolved dependencies.
|
9
|
+
|
10
|
+
Attributes:
|
11
|
+
resolved (Dict[ResolvedDependency, Any]):
|
12
|
+
A dictionary mapping resolved dependency descriptors to their corresponding
|
13
|
+
resolved instances or values for the method.
|
14
|
+
All keys must be ResolvedDependency instances.
|
15
|
+
unresolved (List[str]):
|
16
|
+
A list of method parameter names or dependency identifiers that could not be resolved.
|
17
|
+
Must contain only non-empty strings.
|
18
|
+
"""
|
19
|
+
resolved: Dict[ResolvedDependency, Any]
|
20
|
+
unresolved: List[str]
|
21
|
+
|
22
|
+
def __post_init__(self):
|
23
|
+
"""
|
24
|
+
Validates types and values of attributes during initialization.
|
25
|
+
|
26
|
+
Raises:
|
27
|
+
TypeError: If types don't match the expected:
|
28
|
+
- resolved: Dict[ResolvedDependency, Any]
|
29
|
+
- unresolved: List[str]
|
30
|
+
ValueError: If resolved contains None keys or unresolved contains empty strings
|
31
|
+
"""
|
32
|
+
# Validate 'resolved' is a dict with proper key types
|
33
|
+
if not isinstance(self.resolved, dict):
|
34
|
+
raise TypeError(
|
35
|
+
f"'resolved' must be a dict, got {type(self.resolved).__name__}"
|
36
|
+
)
|
37
|
+
|
38
|
+
# Validate 'unresolved' is a list of valid parameter names
|
39
|
+
if not isinstance(self.unresolved, list):
|
40
|
+
raise TypeError(
|
41
|
+
f"'unresolved' must be a list, got {type(self.unresolved).__name__}"
|
42
|
+
)
|
@@ -0,0 +1,49 @@
|
|
1
|
+
from dataclasses import dataclass
|
2
|
+
from typing import Type, Any
|
3
|
+
|
4
|
+
@dataclass(frozen=True, kw_only=True)
|
5
|
+
class ResolvedDependency:
|
6
|
+
"""
|
7
|
+
Represents a fully resolved dependency with complete type information.
|
8
|
+
|
9
|
+
Attributes:
|
10
|
+
module_name (str):
|
11
|
+
The name of the module where the dependency is defined.
|
12
|
+
Must be a non-empty string without spaces.
|
13
|
+
class_name (str):
|
14
|
+
The name of the class/type being resolved.
|
15
|
+
Must be a valid Python identifier.
|
16
|
+
type (Type):
|
17
|
+
The actual Python type object of the resolved dependency.
|
18
|
+
full_class_path (str):
|
19
|
+
The full import path to the class (e.g., 'package.module.ClassName').
|
20
|
+
Must match 'module_name.class_name' pattern.
|
21
|
+
"""
|
22
|
+
module_name: str
|
23
|
+
class_name: str
|
24
|
+
type: Type[Any]
|
25
|
+
full_class_path: str
|
26
|
+
|
27
|
+
def __post_init__(self):
|
28
|
+
"""
|
29
|
+
Validates all fields during initialization.
|
30
|
+
|
31
|
+
Raises:
|
32
|
+
TypeError: If any field has incorrect type.
|
33
|
+
ValueError: If string fields are empty or don't meet format requirements.
|
34
|
+
"""
|
35
|
+
# Validate module_name
|
36
|
+
if not isinstance(self.module_name, str):
|
37
|
+
raise TypeError(f"module_name must be str, got {type(self.module_name).__name__}")
|
38
|
+
|
39
|
+
# Validate class_name
|
40
|
+
if not isinstance(self.class_name, str):
|
41
|
+
raise TypeError(f"class_name must be str, got {type(self.class_name).__name__}")
|
42
|
+
|
43
|
+
# Validate type
|
44
|
+
if self.type is None:
|
45
|
+
raise ValueError("The 'type' field must not be None. Please provide a valid Python type object for the dependency.")
|
46
|
+
|
47
|
+
# Validate full_class_path
|
48
|
+
if not isinstance(self.full_class_path, str):
|
49
|
+
raise TypeError(f"full_class_path must be str, got {type(self.full_class_path).__name__}")
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import inspect
|
2
2
|
from typing import Any, Dict, List
|
3
|
-
from orionis.luminate.
|
4
|
-
from orionis.luminate.
|
5
|
-
from orionis.luminate.
|
6
|
-
from orionis.luminate.
|
3
|
+
from orionis.luminate.services.introspection.dependencies.contracts.reflect_dependencies import IReflectDependencies
|
4
|
+
from orionis.luminate.services.introspection.dependencies.entities.class_dependencies import ClassDependency
|
5
|
+
from orionis.luminate.services.introspection.dependencies.entities.method_dependencies import MethodDependency
|
6
|
+
from orionis.luminate.services.introspection.dependencies.entities.resolved_dependencies import ResolvedDependency
|
7
7
|
|
8
8
|
class ReflectDependencies(IReflectDependencies):
|
9
9
|
"""
|
File without changes
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import traceback
|
2
2
|
from typing import Any, Dict, List, Optional, Union
|
3
|
-
from orionis.luminate.
|
3
|
+
from orionis.luminate.services.parsers.contracts.exception_parser import IExceptionParser
|
4
4
|
|
5
5
|
class ExceptionParser(IExceptionParser):
|
6
6
|
"""
|
@@ -0,0 +1,15 @@
|
|
1
|
+
from orionis.luminate.services.parsers.exception import ExceptionParser
|
2
|
+
|
3
|
+
class Parser:
|
4
|
+
|
5
|
+
@staticmethod
|
6
|
+
def exception(exception: Exception) -> ExceptionParser:
|
7
|
+
"""
|
8
|
+
Creates and returns an ExceptionParser instance for the given exception.
|
9
|
+
Args:
|
10
|
+
exception (Exception): The exception to be parsed.
|
11
|
+
Returns:
|
12
|
+
ExceptionParser: An instance of ExceptionParser initialized with the provided exception.
|
13
|
+
"""
|
14
|
+
|
15
|
+
return ExceptionParser(exception)
|