prefect-client 3.0.5__tar.gz → 3.0.7__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.
- {prefect-client-3.0.5/src/prefect_client.egg-info → prefect-client-3.0.7}/PKG-INFO +1 -1
- {prefect-client-3.0.5 → prefect-client-3.0.7}/setup.cfg +1 -1
- {prefect-client-3.0.5 → prefect-client-3.0.7}/setup.py +2 -5
- prefect-client-3.0.7/src/prefect/_version.py +21 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/blocks/notifications.py +21 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/flows.py +1 -1
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/futures.py +13 -13
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/settings.py +194 -126
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/task_engine.py +2 -2
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/task_runners.py +2 -2
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/collections.py +70 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/dockerutils.py +4 -3
- {prefect-client-3.0.5 → prefect-client-3.0.7/src/prefect_client.egg-info}/PKG-INFO +1 -1
- prefect-client-3.0.5/src/prefect/_version.py +0 -716
- {prefect-client-3.0.5 → prefect-client-3.0.7}/LICENSE +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/MANIFEST.in +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/README.md +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/requirements-client.txt +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/requirements-dev.txt +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/requirements.txt +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/.prefectignore +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/_logging.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/compatibility/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/compatibility/deprecated.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/compatibility/migration.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/concurrency/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/concurrency/api.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/concurrency/calls.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/concurrency/cancellation.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/concurrency/event_loop.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/concurrency/inspection.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/concurrency/primitives.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/concurrency/services.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/concurrency/threads.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/concurrency/waiters.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/integrations.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/pydantic/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/pydantic/annotations/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/pydantic/annotations/pendulum.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/pydantic/schemas.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/pydantic/v1_schema.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/pydantic/v2_schema.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/pydantic/v2_validated_func.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/pytz.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/retries.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/schemas/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/schemas/bases.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/schemas/fields.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/schemas/serializers.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/_internal/schemas/validators.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/agent.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/artifacts.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/automations.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/blocks/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/blocks/abstract.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/blocks/core.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/blocks/fields.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/blocks/redis.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/blocks/system.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/blocks/webhook.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/cache_policies.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/base.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/cloud.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/collections.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/constants.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/orchestration.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/schemas/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/schemas/actions.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/schemas/filters.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/schemas/objects.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/schemas/responses.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/schemas/schedules.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/schemas/sorting.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/subscriptions.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/types/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/types/flexible_schedule_list.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/client/utilities.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/concurrency/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/concurrency/asyncio.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/concurrency/context.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/concurrency/events.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/concurrency/services.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/concurrency/sync.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/concurrency/v1/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/concurrency/v1/asyncio.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/concurrency/v1/context.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/concurrency/v1/events.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/concurrency/v1/services.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/concurrency/v1/sync.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/context.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/deployments/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/deployments/base.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/deployments/deployments.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/deployments/flow_runs.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/deployments/runner.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/deployments/schedules.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/deployments/steps/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/deployments/steps/core.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/deployments/steps/pull.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/deployments/steps/utility.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/docker/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/docker/docker_image.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/engine.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/events/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/events/actions.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/events/cli/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/events/cli/automations.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/events/clients.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/events/filters.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/events/related.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/events/schemas/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/events/schemas/automations.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/events/schemas/deployment_triggers.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/events/schemas/events.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/events/schemas/labelling.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/events/utilities.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/events/worker.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/exceptions.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/filesystems.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/flow_engine.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/flow_runs.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/infrastructure/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/infrastructure/base.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/infrastructure/provisioners/modal.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/input/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/input/actions.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/input/run_input.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/locking/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/locking/filesystem.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/locking/memory.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/locking/protocol.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/logging/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/logging/configuration.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/logging/filters.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/logging/formatters.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/logging/handlers.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/logging/highlighters.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/logging/loggers.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/logging/logging.yml +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/main.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/plugins.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/profiles.toml +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/py.typed +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/records/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/records/base.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/records/filesystem.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/records/memory.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/records/result_store.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/results.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/runner/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/runner/runner.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/runner/server.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/runner/storage.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/runner/submit.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/runner/utils.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/runtime/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/runtime/deployment.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/runtime/flow_run.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/runtime/task_run.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/serializers.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/states.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/task_runs.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/task_worker.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/tasks.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/transactions.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/types/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/types/entrypoint.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/annotations.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/asyncutils.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/callables.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/compat.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/context.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/dispatch.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/engine.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/filesystem.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/hashing.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/importtools.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/math.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/names.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/processutils.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/pydantic.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/render_swagger.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/schema_tools/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/schema_tools/hydration.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/schema_tools/validation.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/services.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/slugify.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/templating.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/text.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/timeout.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/urls.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/utilities/visualization.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/variables.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/workers/__init__.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/workers/base.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/workers/block.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/workers/cloud.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/workers/process.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/workers/server.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect/workers/utilities.py +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect_client.egg-info/SOURCES.txt +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect_client.egg-info/dependency_links.txt +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect_client.egg-info/requires.txt +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/src/prefect_client.egg-info/top_level.txt +0 -0
- {prefect-client-3.0.5 → prefect-client-3.0.7}/versioneer.py +0 -0
@@ -57,7 +57,7 @@ ignore_missing_imports = True
|
|
57
57
|
|
58
58
|
[versioneer]
|
59
59
|
VCS = git
|
60
|
-
style = pep440
|
60
|
+
style = pep440-pre
|
61
61
|
versionfile_source = src/prefect/_version.py
|
62
62
|
versionfile_build = prefect/_version.py
|
63
63
|
version_regex = ^(\d+\.\d+\.\d+(?:[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*)?)$
|
@@ -3,10 +3,6 @@ from setuptools import find_packages, setup
|
|
3
3
|
|
4
4
|
install_requires = open("requirements-client.txt").read().strip().split("\n")
|
5
5
|
|
6
|
-
# grab and use the first three version digits (the generated tag)
|
7
|
-
_version = versioneer.get_version().split(".")
|
8
|
-
client_version = ".".join(_version[:3]).split("+")[0]
|
9
|
-
|
10
6
|
setup(
|
11
7
|
# Package metadata
|
12
8
|
name="prefect-client",
|
@@ -23,7 +19,8 @@ setup(
|
|
23
19
|
long_description=open("README.md").read(),
|
24
20
|
long_description_content_type="text/markdown",
|
25
21
|
# Versioning
|
26
|
-
version=
|
22
|
+
version=versioneer.get_version(),
|
23
|
+
cmdclass=versioneer.get_cmdclass(),
|
27
24
|
# Package setup
|
28
25
|
packages=find_packages(where="src"),
|
29
26
|
package_dir={"": "src"},
|
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
# This file was generated by 'versioneer.py' (0.29) from
|
3
|
+
# revision-control system data, or from the parent directory name of an
|
4
|
+
# unpacked source archive. Distribution tarballs contain a pre-generated copy
|
5
|
+
# of this file.
|
6
|
+
|
7
|
+
import json
|
8
|
+
|
9
|
+
version_json = '''
|
10
|
+
{
|
11
|
+
"date": "2024-10-09T17:55:58-0500",
|
12
|
+
"dirty": true,
|
13
|
+
"error": null,
|
14
|
+
"full-revisionid": "8fee9e1ef3f2b4f71adcf080bf9cb36db79c5f5a",
|
15
|
+
"version": "3.0.7"
|
16
|
+
}
|
17
|
+
''' # END VERSION_JSON
|
18
|
+
|
19
|
+
|
20
|
+
def get_versions():
|
21
|
+
return json.loads(version_json)
|
@@ -294,6 +294,27 @@ class PagerDutyWebHook(AbstractAppriseNotificationBlock):
|
|
294
294
|
)
|
295
295
|
self._start_apprise_client(url)
|
296
296
|
|
297
|
+
@sync_compatible
|
298
|
+
async def notify(
|
299
|
+
self,
|
300
|
+
body: str,
|
301
|
+
subject: Optional[str] = None,
|
302
|
+
):
|
303
|
+
"""
|
304
|
+
Apprise will combine subject and body by default, so we need to move
|
305
|
+
the body into the custom_details field. custom_details is part of the
|
306
|
+
webhook url, so we need to update the url and restart the client.
|
307
|
+
"""
|
308
|
+
if subject:
|
309
|
+
self.custom_details = self.custom_details or {}
|
310
|
+
self.custom_details.update(
|
311
|
+
{"Prefect Notification Body": body.replace(" ", "%20")}
|
312
|
+
)
|
313
|
+
body = " "
|
314
|
+
self.block_initialization()
|
315
|
+
|
316
|
+
await super().notify(body, subject)
|
317
|
+
|
297
318
|
|
298
319
|
class TwilioSMS(AbstractAppriseNotificationBlock):
|
299
320
|
"""Enables sending notifications via Twilio SMS.
|
@@ -593,7 +593,7 @@ class Flow(Generic[P, R]):
|
|
593
593
|
# Get the updated parameter dict with cast values from the model
|
594
594
|
cast_parameters = {
|
595
595
|
k: v
|
596
|
-
for k, v in model.
|
596
|
+
for k, v in dict(iter(model)).items()
|
597
597
|
if k in model.model_fields_set or model.model_fields[k].default_factory
|
598
598
|
}
|
599
599
|
return cast_parameters
|
@@ -116,7 +116,7 @@ class PrefectWrappedFuture(PrefectFuture, abc.ABC, Generic[R, F]):
|
|
116
116
|
"""The underlying future object wrapped by this Prefect future"""
|
117
117
|
return self._wrapped_future
|
118
118
|
|
119
|
-
def add_done_callback(self, fn: Callable[[PrefectFuture], None]):
|
119
|
+
def add_done_callback(self, fn: Callable[[PrefectFuture[R]], None]):
|
120
120
|
if not self._final_state:
|
121
121
|
|
122
122
|
def call_with_self(future):
|
@@ -193,7 +193,7 @@ class PrefectDistributedFuture(PrefectFuture[R]):
|
|
193
193
|
any task run scheduled in Prefect's API.
|
194
194
|
"""
|
195
195
|
|
196
|
-
done_callbacks: List[Callable[[PrefectFuture], None]] = []
|
196
|
+
done_callbacks: List[Callable[[PrefectFuture[R]], None]] = []
|
197
197
|
waiter = None
|
198
198
|
|
199
199
|
def wait(self, timeout: Optional[float] = None) -> None:
|
@@ -257,7 +257,7 @@ class PrefectDistributedFuture(PrefectFuture[R]):
|
|
257
257
|
raise_on_failure=raise_on_failure, fetch=True
|
258
258
|
)
|
259
259
|
|
260
|
-
def add_done_callback(self, fn: Callable[[PrefectFuture], None]):
|
260
|
+
def add_done_callback(self, fn: Callable[[PrefectFuture[R]], None]):
|
261
261
|
if self._final_state:
|
262
262
|
fn(self)
|
263
263
|
return
|
@@ -331,9 +331,9 @@ class PrefectFutureList(list, Iterator, Generic[F]):
|
|
331
331
|
|
332
332
|
|
333
333
|
def as_completed(
|
334
|
-
futures: List[PrefectFuture], timeout: Optional[float] = None
|
335
|
-
) -> Generator[PrefectFuture, None]:
|
336
|
-
unique_futures: Set[PrefectFuture] = set(futures)
|
334
|
+
futures: List[PrefectFuture[R]], timeout: Optional[float] = None
|
335
|
+
) -> Generator[PrefectFuture[R], None]:
|
336
|
+
unique_futures: Set[PrefectFuture[R]] = set(futures)
|
337
337
|
total_futures = len(unique_futures)
|
338
338
|
try:
|
339
339
|
with timeout_context(timeout):
|
@@ -373,7 +373,7 @@ def as_completed(
|
|
373
373
|
DoneAndNotDoneFutures = collections.namedtuple("DoneAndNotDoneFutures", "done not_done")
|
374
374
|
|
375
375
|
|
376
|
-
def wait(futures: List[PrefectFuture], timeout=None) -> DoneAndNotDoneFutures:
|
376
|
+
def wait(futures: List[PrefectFuture[R]], timeout=None) -> DoneAndNotDoneFutures:
|
377
377
|
"""
|
378
378
|
Wait for the futures in the given sequence to complete.
|
379
379
|
|
@@ -404,10 +404,10 @@ def wait(futures: List[PrefectFuture], timeout=None) -> DoneAndNotDoneFutures:
|
|
404
404
|
print(f"Not Done: {len(not_done)}")
|
405
405
|
```
|
406
406
|
"""
|
407
|
-
|
408
|
-
done = {f for f in
|
409
|
-
not_done =
|
410
|
-
if len(done) == len(
|
407
|
+
_futures = set(futures)
|
408
|
+
done = {f for f in _futures if f._final_state}
|
409
|
+
not_done = _futures - done
|
410
|
+
if len(done) == len(_futures):
|
411
411
|
return DoneAndNotDoneFutures(done, not_done)
|
412
412
|
try:
|
413
413
|
with timeout_context(timeout):
|
@@ -422,7 +422,7 @@ def wait(futures: List[PrefectFuture], timeout=None) -> DoneAndNotDoneFutures:
|
|
422
422
|
|
423
423
|
|
424
424
|
def resolve_futures_to_states(
|
425
|
-
expr: Union[PrefectFuture, Any],
|
425
|
+
expr: Union[PrefectFuture[R], Any],
|
426
426
|
) -> Union[State, Any]:
|
427
427
|
"""
|
428
428
|
Given a Python built-in collection, recursively find `PrefectFutures` and build a
|
@@ -431,7 +431,7 @@ def resolve_futures_to_states(
|
|
431
431
|
|
432
432
|
Unsupported object types will be returned without modification.
|
433
433
|
"""
|
434
|
-
futures: Set[PrefectFuture] = set()
|
434
|
+
futures: Set[PrefectFuture[R]] = set()
|
435
435
|
|
436
436
|
def _collect_futures(futures, expr, context):
|
437
437
|
# Expressions inside quotes should not be traversed
|
@@ -10,6 +10,7 @@ After https://github.com/pydantic/pydantic/issues/9789 is resolved, we will be a
|
|
10
10
|
for settings, at which point we will not need to use the "after" model_validator.
|
11
11
|
"""
|
12
12
|
|
13
|
+
import inspect
|
13
14
|
import os
|
14
15
|
import re
|
15
16
|
import sys
|
@@ -62,7 +63,11 @@ from typing_extensions import Literal, Self
|
|
62
63
|
|
63
64
|
from prefect.exceptions import ProfileSettingsValidationError
|
64
65
|
from prefect.types import ClientRetryExtraCodes, LogLevel
|
65
|
-
from prefect.utilities.collections import
|
66
|
+
from prefect.utilities.collections import (
|
67
|
+
deep_merge_dicts,
|
68
|
+
set_in_dict,
|
69
|
+
visit_collection,
|
70
|
+
)
|
66
71
|
from prefect.utilities.pydantic import handle_secret_render
|
67
72
|
|
68
73
|
T = TypeVar("T")
|
@@ -72,10 +77,12 @@ DEFAULT_PROFILES_PATH = Path(__file__).parent.joinpath("profiles.toml")
|
|
72
77
|
_SECRET_TYPES: Tuple[Type, ...] = (Secret, SecretStr)
|
73
78
|
|
74
79
|
|
75
|
-
def
|
80
|
+
def env_var_to_accessor(env_var: str) -> str:
|
76
81
|
"""
|
77
|
-
Convert an environment variable name to
|
82
|
+
Convert an environment variable name to a settings accessor.
|
78
83
|
"""
|
84
|
+
if SETTING_VARIABLES.get(env_var) is not None:
|
85
|
+
return SETTING_VARIABLES[env_var].accessor
|
79
86
|
return env_var.replace("PREFECT_", "").lower()
|
80
87
|
|
81
88
|
|
@@ -87,19 +94,21 @@ def is_test_mode() -> bool:
|
|
87
94
|
class Setting:
|
88
95
|
"""Mimics the old Setting object for compatibility with existing code."""
|
89
96
|
|
90
|
-
def __init__(
|
97
|
+
def __init__(
|
98
|
+
self, name: str, default: Any, type_: Any, accessor: Optional[str] = None
|
99
|
+
):
|
91
100
|
self._name = name
|
92
101
|
self._default = default
|
93
102
|
self._type = type_
|
103
|
+
if accessor is None:
|
104
|
+
self.accessor = env_var_to_accessor(name)
|
105
|
+
else:
|
106
|
+
self.accessor = accessor
|
94
107
|
|
95
108
|
@property
|
96
109
|
def name(self):
|
97
110
|
return self._name
|
98
111
|
|
99
|
-
@property
|
100
|
-
def field_name(self):
|
101
|
-
return env_var_to_attr_name(self.name)
|
102
|
-
|
103
112
|
@property
|
104
113
|
def is_secret(self):
|
105
114
|
if self._type in _SECRET_TYPES:
|
@@ -119,13 +128,19 @@ class Setting:
|
|
119
128
|
else:
|
120
129
|
return None
|
121
130
|
|
122
|
-
|
131
|
+
path = self.accessor.split(".")
|
132
|
+
current_value = get_current_settings()
|
133
|
+
for key in path:
|
134
|
+
current_value = getattr(current_value, key, None)
|
123
135
|
if isinstance(current_value, _SECRET_TYPES):
|
124
136
|
return current_value.get_secret_value()
|
125
137
|
return current_value
|
126
138
|
|
127
139
|
def value_from(self: Self, settings: "Settings") -> Any:
|
128
|
-
|
140
|
+
path = self.accessor.split(".")
|
141
|
+
current_value = settings
|
142
|
+
for key in path:
|
143
|
+
current_value = getattr(current_value, key, None)
|
129
144
|
if isinstance(current_value, _SECRET_TYPES):
|
130
145
|
return current_value.get_secret_value()
|
131
146
|
return current_value
|
@@ -157,7 +172,7 @@ def default_ui_url(settings: "Settings") -> Optional[str]:
|
|
157
172
|
return value
|
158
173
|
|
159
174
|
# Otherwise, infer a value from the API URL
|
160
|
-
ui_url = api_url = settings.
|
175
|
+
ui_url = api_url = settings.api.url
|
161
176
|
|
162
177
|
if not api_url:
|
163
178
|
return None
|
@@ -243,7 +258,7 @@ def warn_on_misconfigured_api_url(values):
|
|
243
258
|
"""
|
244
259
|
Validator for settings warning if the API URL is misconfigured.
|
245
260
|
"""
|
246
|
-
api_url = values
|
261
|
+
api_url = values.get("api", {}).get("url")
|
247
262
|
if api_url is not None:
|
248
263
|
misconfigured_mappings = {
|
249
264
|
"app.prefect.cloud": (
|
@@ -388,7 +403,9 @@ class ProfileSettingsTomlLoader(PydanticBaseSettingsSource):
|
|
388
403
|
self, field: FieldInfo, field_name: str
|
389
404
|
) -> Tuple[Any, str, bool]:
|
390
405
|
"""Concrete implementation to get the field value from the profile settings"""
|
391
|
-
value = self.profile_settings.get(
|
406
|
+
value = self.profile_settings.get(
|
407
|
+
f"{self.config.get('env_prefix','')}{field_name.upper()}"
|
408
|
+
)
|
392
409
|
return value, field_name, self.field_is_complex(field)
|
393
410
|
|
394
411
|
def __call__(self) -> Dict[str, Any]:
|
@@ -408,21 +425,7 @@ class ProfileSettingsTomlLoader(PydanticBaseSettingsSource):
|
|
408
425
|
|
409
426
|
###########################################################################
|
410
427
|
# Settings
|
411
|
-
|
412
|
-
|
413
|
-
class Settings(BaseSettings):
|
414
|
-
"""
|
415
|
-
Settings for Prefect using Pydantic settings.
|
416
|
-
|
417
|
-
See https://docs.pydantic.dev/latest/concepts/pydantic_settings
|
418
|
-
"""
|
419
|
-
|
420
|
-
model_config = SettingsConfigDict(
|
421
|
-
env_file=".env",
|
422
|
-
env_prefix="PREFECT_",
|
423
|
-
extra="ignore",
|
424
|
-
)
|
425
|
-
|
428
|
+
class PrefectBaseSettings(BaseSettings):
|
426
429
|
@classmethod
|
427
430
|
def settings_customise_sources(
|
428
431
|
cls,
|
@@ -447,6 +450,104 @@ class Settings(BaseSettings):
|
|
447
450
|
ProfileSettingsTomlLoader(settings_cls),
|
448
451
|
)
|
449
452
|
|
453
|
+
@classmethod
|
454
|
+
def valid_setting_names(cls) -> Set[str]:
|
455
|
+
"""
|
456
|
+
A set of valid setting names, e.g. "PREFECT_API_URL" or "PREFECT_API_KEY".
|
457
|
+
"""
|
458
|
+
settings_fields = set()
|
459
|
+
for field_name, field in cls.model_fields.items():
|
460
|
+
if inspect.isclass(field.annotation) and issubclass(
|
461
|
+
field.annotation, PrefectBaseSettings
|
462
|
+
):
|
463
|
+
settings_fields.update(field.annotation.valid_setting_names())
|
464
|
+
else:
|
465
|
+
settings_fields.add(
|
466
|
+
f"{cls.model_config.get('env_prefix')}{field_name.upper()}"
|
467
|
+
)
|
468
|
+
return settings_fields
|
469
|
+
|
470
|
+
def to_environment_variables(
|
471
|
+
self,
|
472
|
+
exclude_unset: bool = False,
|
473
|
+
include_secrets: bool = True,
|
474
|
+
) -> Dict[str, str]:
|
475
|
+
"""Convert the settings object to a dictionary of environment variables."""
|
476
|
+
|
477
|
+
env: Dict[str, Any] = self.model_dump(
|
478
|
+
exclude_unset=exclude_unset,
|
479
|
+
mode="json",
|
480
|
+
context={"include_secrets": include_secrets},
|
481
|
+
)
|
482
|
+
env_variables = {}
|
483
|
+
for key, value in env.items():
|
484
|
+
if isinstance(value, dict) and isinstance(
|
485
|
+
child_settings := getattr(self, key), PrefectBaseSettings
|
486
|
+
):
|
487
|
+
child_env = child_settings.to_environment_variables(
|
488
|
+
exclude_unset=exclude_unset,
|
489
|
+
include_secrets=include_secrets,
|
490
|
+
)
|
491
|
+
env_variables.update(child_env)
|
492
|
+
elif value is not None:
|
493
|
+
env_variables[
|
494
|
+
f"{self.model_config.get('env_prefix')}{key.upper()}"
|
495
|
+
] = str(value)
|
496
|
+
return env_variables
|
497
|
+
|
498
|
+
|
499
|
+
class APISettings(PrefectBaseSettings):
|
500
|
+
"""
|
501
|
+
Settings for interacting with the Prefect API
|
502
|
+
"""
|
503
|
+
|
504
|
+
model_config = SettingsConfigDict(
|
505
|
+
env_prefix="PREFECT_API_", env_file=".env", extra="ignore"
|
506
|
+
)
|
507
|
+
url: Optional[str] = Field(
|
508
|
+
default=None,
|
509
|
+
description="The URL of the Prefect API. If not set, the client will attempt to infer it.",
|
510
|
+
)
|
511
|
+
key: Optional[SecretStr] = Field(
|
512
|
+
default=None,
|
513
|
+
description="The API key used for authentication with the Prefect API. Should be kept secret.",
|
514
|
+
)
|
515
|
+
tls_insecure_skip_verify: bool = Field(
|
516
|
+
default=False,
|
517
|
+
description="If `True`, disables SSL checking to allow insecure requests. This is recommended only during development, e.g. when using self-signed certificates.",
|
518
|
+
)
|
519
|
+
ssl_cert_file: Optional[str] = Field(
|
520
|
+
default=os.environ.get("SSL_CERT_FILE"),
|
521
|
+
description="This configuration settings option specifies the path to an SSL certificate file.",
|
522
|
+
)
|
523
|
+
enable_http2: bool = Field(
|
524
|
+
default=False,
|
525
|
+
description="If true, enable support for HTTP/2 for communicating with an API. If the API does not support HTTP/2, this will have no effect and connections will be made via HTTP/1.1.",
|
526
|
+
)
|
527
|
+
request_timeout: float = Field(
|
528
|
+
default=60.0,
|
529
|
+
description="The default timeout for requests to the API",
|
530
|
+
)
|
531
|
+
default_limit: int = Field(
|
532
|
+
default=200,
|
533
|
+
description="The default limit applied to queries that can return multiple objects, such as `POST /flow_runs/filter`.",
|
534
|
+
)
|
535
|
+
|
536
|
+
|
537
|
+
class Settings(PrefectBaseSettings):
|
538
|
+
"""
|
539
|
+
Settings for Prefect using Pydantic settings.
|
540
|
+
|
541
|
+
See https://docs.pydantic.dev/latest/concepts/pydantic_settings
|
542
|
+
"""
|
543
|
+
|
544
|
+
model_config = SettingsConfigDict(
|
545
|
+
env_file=".env",
|
546
|
+
env_prefix="PREFECT_",
|
547
|
+
env_nested_delimiter=None,
|
548
|
+
extra="ignore",
|
549
|
+
)
|
550
|
+
|
450
551
|
###########################################################################
|
451
552
|
# CLI
|
452
553
|
|
@@ -504,33 +605,9 @@ class Settings(BaseSettings):
|
|
504
605
|
###########################################################################
|
505
606
|
# API settings
|
506
607
|
|
507
|
-
|
508
|
-
|
509
|
-
description="
|
510
|
-
)
|
511
|
-
api_key: Optional[SecretStr] = Field(
|
512
|
-
default=None,
|
513
|
-
description="The API key used for authentication with the Prefect API. Should be kept secret.",
|
514
|
-
)
|
515
|
-
|
516
|
-
api_tls_insecure_skip_verify: bool = Field(
|
517
|
-
default=False,
|
518
|
-
description="If `True`, disables SSL checking to allow insecure requests. This is recommended only during development, e.g. when using self-signed certificates.",
|
519
|
-
)
|
520
|
-
|
521
|
-
api_ssl_cert_file: Optional[str] = Field(
|
522
|
-
default=os.environ.get("SSL_CERT_FILE"),
|
523
|
-
description="This configuration settings option specifies the path to an SSL certificate file.",
|
524
|
-
)
|
525
|
-
|
526
|
-
api_enable_http2: bool = Field(
|
527
|
-
default=False,
|
528
|
-
description="If true, enable support for HTTP/2 for communicating with an API. If the API does not support HTTP/2, this will have no effect and connections will be made via HTTP/1.1.",
|
529
|
-
)
|
530
|
-
|
531
|
-
api_request_timeout: float = Field(
|
532
|
-
default=60.0,
|
533
|
-
description="The default timeout for requests to the API",
|
608
|
+
api: APISettings = Field(
|
609
|
+
default_factory=APISettings,
|
610
|
+
description="Settings for interacting with the Prefect API",
|
534
611
|
)
|
535
612
|
|
536
613
|
api_blocks_register_on_start: bool = Field(
|
@@ -1429,7 +1506,7 @@ class Settings(BaseSettings):
|
|
1429
1506
|
|
1430
1507
|
def __getattribute__(self, name: str) -> Any:
|
1431
1508
|
if name.startswith("PREFECT_"):
|
1432
|
-
field_name =
|
1509
|
+
field_name = env_var_to_accessor(name)
|
1433
1510
|
warnings.warn(
|
1434
1511
|
f"Accessing `Settings().{name}` is deprecated. Use `Settings().{field_name}` instead.",
|
1435
1512
|
DeprecationWarning,
|
@@ -1456,8 +1533,10 @@ class Settings(BaseSettings):
|
|
1456
1533
|
self.ui_url = default_ui_url(self)
|
1457
1534
|
self.__pydantic_fields_set__.remove("ui_url")
|
1458
1535
|
if self.ui_api_url is None:
|
1459
|
-
if self.
|
1460
|
-
self.ui_api_url = self.
|
1536
|
+
if self.api.url:
|
1537
|
+
self.ui_api_url = self.api.url
|
1538
|
+
if self.api.url:
|
1539
|
+
self.ui_api_url = self.api.url
|
1461
1540
|
self.__pydantic_fields_set__.remove("ui_api_url")
|
1462
1541
|
else:
|
1463
1542
|
self.ui_api_url = (
|
@@ -1521,16 +1600,6 @@ class Settings(BaseSettings):
|
|
1521
1600
|
##########################################################################
|
1522
1601
|
# Settings methods
|
1523
1602
|
|
1524
|
-
@classmethod
|
1525
|
-
def valid_setting_names(cls) -> Set[str]:
|
1526
|
-
"""
|
1527
|
-
A set of valid setting names, e.g. "PREFECT_API_URL" or "PREFECT_API_KEY".
|
1528
|
-
"""
|
1529
|
-
return set(
|
1530
|
-
f"{cls.model_config.get('env_prefix')}{key.upper()}"
|
1531
|
-
for key in cls.model_fields.keys()
|
1532
|
-
)
|
1533
|
-
|
1534
1603
|
def copy_with_update(
|
1535
1604
|
self: Self,
|
1536
1605
|
updates: Optional[Mapping[Setting, Any]] = None,
|
@@ -1550,14 +1619,26 @@ class Settings(BaseSettings):
|
|
1550
1619
|
Returns:
|
1551
1620
|
A new Settings object.
|
1552
1621
|
"""
|
1553
|
-
|
1622
|
+
restore_defaults_obj = {}
|
1623
|
+
for r in restore_defaults or []:
|
1624
|
+
set_in_dict(restore_defaults_obj, r.accessor, True)
|
1554
1625
|
updates = updates or {}
|
1555
1626
|
set_defaults = set_defaults or {}
|
1556
1627
|
|
1628
|
+
set_defaults_obj = {}
|
1629
|
+
for setting, value in set_defaults.items():
|
1630
|
+
set_in_dict(set_defaults_obj, setting.accessor, value)
|
1631
|
+
|
1632
|
+
updates_obj = {}
|
1633
|
+
for setting, value in updates.items():
|
1634
|
+
set_in_dict(updates_obj, setting.accessor, value)
|
1635
|
+
|
1557
1636
|
new_settings = self.__class__(
|
1558
|
-
**
|
1559
|
-
|
1560
|
-
|
1637
|
+
**deep_merge_dicts(
|
1638
|
+
set_defaults_obj,
|
1639
|
+
self.model_dump(exclude_unset=True, exclude=restore_defaults_obj),
|
1640
|
+
updates_obj,
|
1641
|
+
)
|
1561
1642
|
)
|
1562
1643
|
return new_settings
|
1563
1644
|
|
@@ -1569,37 +1650,6 @@ class Settings(BaseSettings):
|
|
1569
1650
|
env_variables = self.to_environment_variables()
|
1570
1651
|
return str(hash(tuple((key, value) for key, value in env_variables.items())))
|
1571
1652
|
|
1572
|
-
def to_environment_variables(
|
1573
|
-
self,
|
1574
|
-
include: Optional[Iterable[Setting]] = None,
|
1575
|
-
exclude: Optional[Iterable[Setting]] = None,
|
1576
|
-
exclude_unset: bool = False,
|
1577
|
-
include_secrets: bool = True,
|
1578
|
-
) -> Dict[str, str]:
|
1579
|
-
"""Convert the settings object to a dictionary of environment variables."""
|
1580
|
-
included_names = {s.field_name for s in include} if include else None
|
1581
|
-
excluded_names = {s.field_name for s in exclude} if exclude else None
|
1582
|
-
|
1583
|
-
if exclude_unset:
|
1584
|
-
if included_names is None:
|
1585
|
-
included_names = set(self.model_dump(exclude_unset=True).keys())
|
1586
|
-
else:
|
1587
|
-
included_names.intersection_update(
|
1588
|
-
{key for key in self.model_dump(exclude_unset=True)}
|
1589
|
-
)
|
1590
|
-
|
1591
|
-
env: Dict[str, Any] = self.model_dump(
|
1592
|
-
include=included_names,
|
1593
|
-
exclude=excluded_names,
|
1594
|
-
mode="json",
|
1595
|
-
context={"include_secrets": include_secrets},
|
1596
|
-
)
|
1597
|
-
return {
|
1598
|
-
f"{self.model_config.get('env_prefix')}{key.upper()}": str(value)
|
1599
|
-
for key, value in env.items()
|
1600
|
-
if value is not None
|
1601
|
-
}
|
1602
|
-
|
1603
1653
|
@model_serializer(
|
1604
1654
|
mode="wrap", when_used="always"
|
1605
1655
|
) # TODO: reconsider `when_used` default for more control
|
@@ -1609,7 +1659,11 @@ class Settings(BaseSettings):
|
|
1609
1659
|
ctx = info.context
|
1610
1660
|
jsonable_self = handler(self)
|
1611
1661
|
if ctx and ctx.get("include_secrets") is True:
|
1612
|
-
dump_kwargs = dict(
|
1662
|
+
dump_kwargs = dict(
|
1663
|
+
include=info.include,
|
1664
|
+
exclude=info.exclude,
|
1665
|
+
exclude_unset=info.exclude_unset,
|
1666
|
+
)
|
1613
1667
|
jsonable_self.update(
|
1614
1668
|
{
|
1615
1669
|
field_name: visit_collection(
|
@@ -1639,12 +1693,7 @@ def _cast_settings(
|
|
1639
1693
|
for k, value in settings.items():
|
1640
1694
|
try:
|
1641
1695
|
if isinstance(k, str):
|
1642
|
-
|
1643
|
-
setting = Setting(
|
1644
|
-
name=k,
|
1645
|
-
default=field.default,
|
1646
|
-
type_=field.annotation,
|
1647
|
-
)
|
1696
|
+
setting = SETTING_VARIABLES[k]
|
1648
1697
|
else:
|
1649
1698
|
setting = k
|
1650
1699
|
casted_settings[setting] = value
|
@@ -1739,9 +1788,16 @@ class Profile(BaseModel):
|
|
1739
1788
|
errors: List[Tuple[Setting, ValidationError]] = []
|
1740
1789
|
for setting, value in self.settings.items():
|
1741
1790
|
try:
|
1742
|
-
|
1743
|
-
|
1744
|
-
|
1791
|
+
model_fields = Settings.model_fields
|
1792
|
+
annotation = None
|
1793
|
+
for section in setting.accessor.split("."):
|
1794
|
+
annotation = model_fields[section].annotation
|
1795
|
+
if inspect.isclass(annotation) and issubclass(
|
1796
|
+
annotation, BaseSettings
|
1797
|
+
):
|
1798
|
+
model_fields = annotation.model_fields
|
1799
|
+
|
1800
|
+
TypeAdapter(annotation).validate_python(value)
|
1745
1801
|
except ValidationError as e:
|
1746
1802
|
errors.append((setting, e))
|
1747
1803
|
if errors:
|
@@ -2058,26 +2114,38 @@ def update_current_profile(
|
|
2058
2114
|
# Allow traditional env var access
|
2059
2115
|
|
2060
2116
|
|
2061
|
-
|
2062
|
-
|
2063
|
-
|
2064
|
-
|
2065
|
-
|
2066
|
-
|
2067
|
-
|
2068
|
-
|
2069
|
-
|
2070
|
-
|
2071
|
-
|
2117
|
+
def _collect_settings_fields(
|
2118
|
+
settings_cls: Type[BaseSettings], accessor_prefix: Optional[str] = None
|
2119
|
+
) -> Dict[str, Setting]:
|
2120
|
+
settings_fields: Dict[str, Setting] = {}
|
2121
|
+
for field_name, field in settings_cls.model_fields.items():
|
2122
|
+
if inspect.isclass(field.annotation) and issubclass(
|
2123
|
+
field.annotation, BaseSettings
|
2124
|
+
):
|
2125
|
+
accessor = (
|
2126
|
+
field_name
|
2127
|
+
if accessor_prefix is None
|
2128
|
+
else f"{accessor_prefix}.{field_name}"
|
2129
|
+
)
|
2130
|
+
settings_fields.update(_collect_settings_fields(field.annotation, accessor))
|
2131
|
+
else:
|
2132
|
+
accessor = (
|
2133
|
+
field_name
|
2134
|
+
if accessor_prefix is None
|
2135
|
+
else f"{accessor_prefix}.{field_name}"
|
2136
|
+
)
|
2072
2137
|
setting = Setting(
|
2073
2138
|
name=f"{settings_cls.model_config.get('env_prefix')}{field_name.upper()}",
|
2074
2139
|
default=field.default,
|
2075
2140
|
type_=field.annotation,
|
2141
|
+
accessor=accessor,
|
2076
2142
|
)
|
2077
|
-
|
2143
|
+
settings_fields[setting.name] = setting
|
2144
|
+
settings_fields[setting.accessor] = setting
|
2145
|
+
return settings_fields
|
2078
2146
|
|
2079
2147
|
|
2080
|
-
SETTING_VARIABLES: dict[str, Setting] =
|
2148
|
+
SETTING_VARIABLES: dict[str, Setting] = _collect_settings_fields(Settings)
|
2081
2149
|
|
2082
2150
|
|
2083
2151
|
def __getattr__(name: str) -> Setting:
|
@@ -658,7 +658,7 @@ class SyncTaskRunEngine(BaseTaskRunEngine[P, R]):
|
|
658
658
|
|
659
659
|
with self.setup_run_context():
|
660
660
|
# setup_run_context might update the task run name, so log creation here
|
661
|
-
self.logger.
|
661
|
+
self.logger.debug(
|
662
662
|
f"Created task run {self.task_run.name!r} for task {self.task.name!r}"
|
663
663
|
)
|
664
664
|
yield self
|
@@ -1167,7 +1167,7 @@ class AsyncTaskRunEngine(BaseTaskRunEngine[P, R]):
|
|
1167
1167
|
|
1168
1168
|
async with self.setup_run_context():
|
1169
1169
|
# setup_run_context might update the task run name, so log creation here
|
1170
|
-
self.logger.
|
1170
|
+
self.logger.debug(
|
1171
1171
|
f"Created task run {self.task_run.name!r} for task {self.task.name!r}"
|
1172
1172
|
)
|
1173
1173
|
yield self
|