prefect-client 2.19.9__tar.gz → 2.20.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {prefect-client-2.19.9/src/prefect_client.egg-info → prefect-client-2.20.0}/PKG-INFO +1 -1
- {prefect-client-2.19.9 → prefect-client-2.20.0}/requirements-client.txt +1 -1
- {prefect-client-2.19.9 → prefect-client-2.20.0}/requirements.txt +2 -1
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/notifications.py +30 -2
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/engine.py +8 -6
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/flows.py +151 -8
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/task_server.py +23 -9
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/asyncutils.py +6 -4
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/callables.py +5 -3
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/engine.py +14 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/importtools.py +138 -58
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/services.py +7 -1
- {prefect-client-2.19.9 → prefect-client-2.20.0/src/prefect_client.egg-info}/PKG-INFO +1 -1
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect_client.egg-info/requires.txt +1 -1
- {prefect-client-2.19.9 → prefect-client-2.20.0}/LICENSE +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/MANIFEST.in +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/README.md +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/requirements-dev.txt +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/setup.cfg +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/setup.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/.prefectignore +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/_logging.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/compatibility/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/compatibility/deprecated.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/compatibility/experimental.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/api.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/calls.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/cancellation.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/event_loop.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/inspection.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/primitives.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/services.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/threads.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/waiters.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/_base_model.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/_compat.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/_flags.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/_types.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/annotations/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/annotations/pendulum.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/schemas.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/config_dict.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/field_validator.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_construct.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_copy.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_dump.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_dump_json.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_fields.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_fields_set.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_json_schema.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_rebuild.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_validate.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_validate_json.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_validator.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/type_adapter.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/v1_schema.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/v2_schema.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/v2_validated_func.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/pytz.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/schemas/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/schemas/bases.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/schemas/fields.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/schemas/serializers.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_internal/schemas/validators.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/applications.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/background.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/concurrency.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/datastructures.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/dependencies/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/dependencies/models.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/dependencies/utils.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/encoders.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/exception_handlers.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/exceptions.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/logger.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/asyncexitstack.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/cors.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/gzip.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/httpsredirect.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/trustedhost.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/wsgi.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/openapi/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/openapi/constants.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/openapi/docs.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/openapi/models.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/openapi/utils.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/param_functions.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/params.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/requests.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/responses.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/routing.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/api_key.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/base.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/http.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/oauth2.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/open_id_connect_url.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/utils.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/staticfiles.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/templating.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/testclient.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/types.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/utils.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/websockets.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/_compat.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/_exception_handler.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/_utils.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/applications.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/authentication.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/background.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/concurrency.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/config.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/convertors.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/datastructures.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/endpoints.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/exceptions.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/formparsers.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/authentication.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/base.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/cors.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/errors.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/exceptions.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/gzip.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/httpsredirect.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/sessions.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/trustedhost.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/wsgi.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/requests.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/responses.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/routing.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/schemas.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/staticfiles.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/status.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/templating.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/testclient.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/types.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/websockets.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/_version.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/agent.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/artifacts.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/automations.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/abstract.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/core.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/fields.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/kubernetes.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/system.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/blocks/webhook.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/base.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/cloud.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/collections.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/constants.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/orchestration.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/schemas/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/schemas/actions.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/schemas/filters.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/schemas/objects.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/schemas/responses.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/schemas/schedules.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/schemas/sorting.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/subscriptions.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/client/utilities.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/concurrency/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/concurrency/asyncio.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/concurrency/events.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/concurrency/services.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/concurrency/sync.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/context.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/base.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/deployments.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/runner.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/schedules.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/steps/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/steps/core.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/steps/pull.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deployments/steps/utility.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/data_documents.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/base.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/docker.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/file.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/orion.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/serializers.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/actions.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/cli/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/cli/automations.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/clients.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/filters.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/instrument.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/related.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/schemas/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/schemas/automations.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/schemas/deployment_triggers.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/schemas/events.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/schemas/labelling.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/utilities.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/events/worker.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/exceptions.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/filesystems.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/flow_runs.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/futures.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/base.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/container.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/kubernetes.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/process.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/infrastructure/provisioners/modal.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/input/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/input/actions.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/input/run_input.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/configuration.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/filters.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/formatters.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/handlers.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/highlighters.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/loggers.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/logging/logging.yml +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/manifests.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/new_flow_engine.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/new_task_engine.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/plugins.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/profiles.toml +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/py.typed +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/pydantic/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/pydantic/main.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/results.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runner/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runner/runner.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runner/server.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runner/storage.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runner/submit.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runner/utils.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runtime/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runtime/deployment.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runtime/flow_run.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/runtime/task_run.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/serializers.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/settings.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/software/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/software/base.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/software/conda.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/software/pip.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/software/python.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/states.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/task_engine.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/task_runners.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/tasks.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/types/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/annotations.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/collections.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/compat.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/context.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/dispatch.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/dockerutils.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/filesystem.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/hashing.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/math.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/names.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/processutils.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/pydantic.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/render_swagger.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/schema_tools/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/schema_tools/hydration.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/schema_tools/validation.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/slugify.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/templating.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/text.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/timeout.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/utilities/visualization.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/variables.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/workers/__init__.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/workers/base.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/workers/block.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/workers/process.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/workers/server.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect/workers/utilities.py +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect_client.egg-info/SOURCES.txt +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect_client.egg-info/dependency_links.txt +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/src/prefect_client.egg-info/top_level.txt +0 -0
- {prefect-client-2.19.9 → prefect-client-2.20.0}/versioneer.py +0 -0
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
aiosqlite >= 0.17.0
|
4
4
|
alembic >= 1.7.5, < 2.0.0
|
5
|
-
apprise >= 1.
|
5
|
+
apprise >= 1.8.0, < 2.0.0
|
6
6
|
asyncpg >= 0.23
|
7
7
|
click >= 8.0, < 8.2
|
8
8
|
cryptography >= 36.0.1
|
@@ -18,3 +18,4 @@ pytz >= 2021.1, < 2025
|
|
18
18
|
readchar >= 4.0.0, < 5.0.0
|
19
19
|
sqlalchemy[asyncio] >= 1.4.22, != 1.4.33, < 3.0.0
|
20
20
|
typer >= 0.12.0, != 0.12.2, < 0.13.0
|
21
|
+
exceptiongroup >= 1.2.1
|
@@ -139,12 +139,40 @@ class MicrosoftTeamsWebhook(AppriseNotificationBlock):
|
|
139
139
|
url: SecretStr = Field(
|
140
140
|
...,
|
141
141
|
title="Webhook URL",
|
142
|
-
description="The
|
142
|
+
description="The Microsoft Power Automate (Workflows) URL used to send notifications to Teams.",
|
143
143
|
examples=[
|
144
|
-
"https://
|
144
|
+
"https://prod-NO.LOCATION.logic.azure.com:443/workflows/WFID/triggers/manual/paths/invoke?sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=SIGNATURE"
|
145
145
|
],
|
146
146
|
)
|
147
147
|
|
148
|
+
include_image: bool = Field(
|
149
|
+
default=True,
|
150
|
+
description="Include an image with the notification.",
|
151
|
+
)
|
152
|
+
|
153
|
+
wrap: bool = Field(
|
154
|
+
default=True,
|
155
|
+
description="Wrap the notification text.",
|
156
|
+
)
|
157
|
+
|
158
|
+
def block_initialization(self) -> None:
|
159
|
+
"""see https://github.com/caronc/apprise/pull/1172"""
|
160
|
+
from apprise.plugins.workflows import NotifyWorkflows
|
161
|
+
|
162
|
+
if not (
|
163
|
+
parsed_url := NotifyWorkflows.parse_native_url(self.url.get_secret_value())
|
164
|
+
):
|
165
|
+
raise ValueError("Invalid Microsoft Teams Workflow URL provided.")
|
166
|
+
|
167
|
+
parsed_url.update(
|
168
|
+
{
|
169
|
+
"include_image": self.include_image,
|
170
|
+
"wrap": self.wrap,
|
171
|
+
}
|
172
|
+
)
|
173
|
+
|
174
|
+
self._start_apprise_client(SecretStr(NotifyWorkflows(**parsed_url).url()))
|
175
|
+
|
148
176
|
|
149
177
|
class PagerDutyWebHook(AbstractAppriseNotificationBlock):
|
150
178
|
"""
|
@@ -107,7 +107,7 @@ from uuid import UUID, uuid4
|
|
107
107
|
|
108
108
|
import anyio
|
109
109
|
import pendulum
|
110
|
-
from anyio import start_blocking_portal
|
110
|
+
from anyio.from_thread import start_blocking_portal
|
111
111
|
from typing_extensions import Literal
|
112
112
|
|
113
113
|
import prefect
|
@@ -211,6 +211,7 @@ from prefect.utilities.engine import (
|
|
211
211
|
_resolve_custom_task_run_name,
|
212
212
|
capture_sigterm,
|
213
213
|
check_api_reachable,
|
214
|
+
collapse_excgroups,
|
214
215
|
collect_task_run_inputs,
|
215
216
|
emit_task_run_state_change_event,
|
216
217
|
propose_state,
|
@@ -279,7 +280,7 @@ def enter_flow_run_engine_from_flow_call(
|
|
279
280
|
# the user. Generally, you should enter contexts _within_ the async `begin_run`
|
280
281
|
# instead but if you need to enter a context from the main thread you'll need to do
|
281
282
|
# it here.
|
282
|
-
contexts = [capture_sigterm()]
|
283
|
+
contexts = [capture_sigterm(), collapse_excgroups()]
|
283
284
|
|
284
285
|
if flow.isasync and (
|
285
286
|
not is_subflow_run or (is_subflow_run and parent_flow_run_context.flow.isasync)
|
@@ -324,7 +325,7 @@ def enter_flow_run_engine_from_subprocess(flow_run_id: UUID) -> State:
|
|
324
325
|
flow_run_id,
|
325
326
|
user_thread=threading.current_thread(),
|
326
327
|
),
|
327
|
-
contexts=[capture_sigterm()],
|
328
|
+
contexts=[capture_sigterm(), collapse_excgroups()],
|
328
329
|
)
|
329
330
|
|
330
331
|
APILogHandler.flush()
|
@@ -2248,9 +2249,9 @@ async def report_flow_run_crashes(flow_run: FlowRun, client: PrefectClient, flow
|
|
2248
2249
|
|
2249
2250
|
This context _must_ reraise the exception to properly exit the run.
|
2250
2251
|
"""
|
2251
|
-
|
2252
2252
|
try:
|
2253
|
-
|
2253
|
+
with collapse_excgroups():
|
2254
|
+
yield
|
2254
2255
|
except (Abort, Pause):
|
2255
2256
|
# Do not capture internal signals as crashes
|
2256
2257
|
raise
|
@@ -2287,7 +2288,8 @@ async def report_task_run_crashes(task_run: TaskRun, client: PrefectClient):
|
|
2287
2288
|
This context _must_ reraise the exception to properly exit the run.
|
2288
2289
|
"""
|
2289
2290
|
try:
|
2290
|
-
|
2291
|
+
with collapse_excgroups():
|
2292
|
+
yield
|
2291
2293
|
except (Abort, Pause):
|
2292
2294
|
# Do not capture internal signals as crashes
|
2293
2295
|
raise
|
@@ -1676,6 +1676,7 @@ def load_flow_from_entrypoint(
|
|
1676
1676
|
if ":" in entrypoint:
|
1677
1677
|
# split by the last colon once to handle Windows paths with drive letters i.e C:\path\to\file.py:do_stuff
|
1678
1678
|
path, func_name = entrypoint.rsplit(":", maxsplit=1)
|
1679
|
+
|
1679
1680
|
else:
|
1680
1681
|
path, func_name = entrypoint.rsplit(".", maxsplit=1)
|
1681
1682
|
try:
|
@@ -1684,15 +1685,13 @@ def load_flow_from_entrypoint(
|
|
1684
1685
|
raise MissingFlowError(
|
1685
1686
|
f"Flow function with name {func_name!r} not found in {path!r}. "
|
1686
1687
|
) from exc
|
1687
|
-
except ScriptError
|
1688
|
+
except ScriptError:
|
1688
1689
|
# If the flow has dependencies that are not installed in the current
|
1689
|
-
# environment, fallback to loading the flow via AST parsing.
|
1690
|
-
# drawback of this approach is that we're unable to actually load the
|
1691
|
-
# function, so we create a placeholder flow that will re-raise this
|
1692
|
-
# exception when called.
|
1693
|
-
|
1690
|
+
# environment, fallback to loading the flow via AST parsing.
|
1694
1691
|
if use_placeholder_flow:
|
1695
|
-
flow =
|
1692
|
+
flow = safe_load_flow_from_entrypoint(entrypoint)
|
1693
|
+
if flow is None:
|
1694
|
+
raise
|
1696
1695
|
else:
|
1697
1696
|
raise
|
1698
1697
|
|
@@ -1855,6 +1854,147 @@ def load_placeholder_flow(entrypoint: str, raises: Exception):
|
|
1855
1854
|
return Flow(**arguments)
|
1856
1855
|
|
1857
1856
|
|
1857
|
+
def safe_load_flow_from_entrypoint(entrypoint: str) -> Optional[Flow]:
|
1858
|
+
"""
|
1859
|
+
Load a flow from an entrypoint and return None if an exception is raised.
|
1860
|
+
|
1861
|
+
Args:
|
1862
|
+
entrypoint: a string in the format `<path_to_script>:<flow_func_name>`
|
1863
|
+
or a module path to a flow function
|
1864
|
+
"""
|
1865
|
+
func_def, source_code = _entrypoint_definition_and_source(entrypoint)
|
1866
|
+
path = None
|
1867
|
+
if ":" in entrypoint:
|
1868
|
+
path = entrypoint.rsplit(":")[0]
|
1869
|
+
namespace = safe_load_namespace(source_code, filepath=path)
|
1870
|
+
if func_def.name in namespace:
|
1871
|
+
return namespace[func_def.name]
|
1872
|
+
else:
|
1873
|
+
# If the function is not in the namespace, if may be due to missing dependencies
|
1874
|
+
# for the function. We will attempt to compile each annotation and default value
|
1875
|
+
# and remove them from the function definition to see if the function can be
|
1876
|
+
# compiled without them.
|
1877
|
+
|
1878
|
+
return _sanitize_and_load_flow(func_def, namespace)
|
1879
|
+
|
1880
|
+
|
1881
|
+
def _sanitize_and_load_flow(
|
1882
|
+
func_def: Union[ast.FunctionDef, ast.AsyncFunctionDef], namespace: Dict[str, Any]
|
1883
|
+
) -> Optional[Flow]:
|
1884
|
+
"""
|
1885
|
+
Attempt to load a flow from the function definition after sanitizing the annotations
|
1886
|
+
and defaults that can't be compiled.
|
1887
|
+
|
1888
|
+
Args:
|
1889
|
+
func_def: the function definition
|
1890
|
+
namespace: the namespace to load the function into
|
1891
|
+
|
1892
|
+
Returns:
|
1893
|
+
The loaded function or None if the function can't be loaded
|
1894
|
+
after sanitizing the annotations and defaults.
|
1895
|
+
"""
|
1896
|
+
args = func_def.args.posonlyargs + func_def.args.args + func_def.args.kwonlyargs
|
1897
|
+
if func_def.args.vararg:
|
1898
|
+
args.append(func_def.args.vararg)
|
1899
|
+
if func_def.args.kwarg:
|
1900
|
+
args.append(func_def.args.kwarg)
|
1901
|
+
# Remove annotations that can't be compiled
|
1902
|
+
for arg in args:
|
1903
|
+
if arg.annotation is not None:
|
1904
|
+
try:
|
1905
|
+
code = compile(
|
1906
|
+
ast.Expression(arg.annotation),
|
1907
|
+
filename="<ast>",
|
1908
|
+
mode="eval",
|
1909
|
+
)
|
1910
|
+
exec(code, namespace)
|
1911
|
+
except Exception as e:
|
1912
|
+
logger.debug(
|
1913
|
+
"Failed to evaluate annotation for argument %s due to the following error. Ignoring annotation.",
|
1914
|
+
arg.arg,
|
1915
|
+
exc_info=e,
|
1916
|
+
)
|
1917
|
+
arg.annotation = None
|
1918
|
+
|
1919
|
+
# Remove defaults that can't be compiled
|
1920
|
+
new_defaults = []
|
1921
|
+
for default in func_def.args.defaults:
|
1922
|
+
try:
|
1923
|
+
code = compile(ast.Expression(default), "<ast>", "eval")
|
1924
|
+
exec(code, namespace)
|
1925
|
+
new_defaults.append(default)
|
1926
|
+
except Exception as e:
|
1927
|
+
logger.debug(
|
1928
|
+
"Failed to evaluate default value %s due to the following error. Ignoring default.",
|
1929
|
+
default,
|
1930
|
+
exc_info=e,
|
1931
|
+
)
|
1932
|
+
new_defaults.append(
|
1933
|
+
ast.Constant(
|
1934
|
+
value=None, lineno=default.lineno, col_offset=default.col_offset
|
1935
|
+
)
|
1936
|
+
)
|
1937
|
+
func_def.args.defaults = new_defaults
|
1938
|
+
|
1939
|
+
# Remove kw_defaults that can't be compiled
|
1940
|
+
new_kw_defaults = []
|
1941
|
+
for default in func_def.args.kw_defaults:
|
1942
|
+
if default is not None:
|
1943
|
+
try:
|
1944
|
+
code = compile(ast.Expression(default), "<ast>", "eval")
|
1945
|
+
exec(code, namespace)
|
1946
|
+
new_kw_defaults.append(default)
|
1947
|
+
except Exception as e:
|
1948
|
+
logger.debug(
|
1949
|
+
"Failed to evaluate default value %s due to the following error. Ignoring default.",
|
1950
|
+
default,
|
1951
|
+
exc_info=e,
|
1952
|
+
)
|
1953
|
+
new_kw_defaults.append(
|
1954
|
+
ast.Constant(
|
1955
|
+
value=None,
|
1956
|
+
lineno=default.lineno,
|
1957
|
+
col_offset=default.col_offset,
|
1958
|
+
)
|
1959
|
+
)
|
1960
|
+
else:
|
1961
|
+
new_kw_defaults.append(
|
1962
|
+
ast.Constant(
|
1963
|
+
value=None,
|
1964
|
+
lineno=func_def.lineno,
|
1965
|
+
col_offset=func_def.col_offset,
|
1966
|
+
)
|
1967
|
+
)
|
1968
|
+
func_def.args.kw_defaults = new_kw_defaults
|
1969
|
+
|
1970
|
+
if func_def.returns is not None:
|
1971
|
+
try:
|
1972
|
+
code = compile(
|
1973
|
+
ast.Expression(func_def.returns), filename="<ast>", mode="eval"
|
1974
|
+
)
|
1975
|
+
exec(code, namespace)
|
1976
|
+
except Exception as e:
|
1977
|
+
logger.debug(
|
1978
|
+
"Failed to evaluate return annotation due to the following error. Ignoring annotation.",
|
1979
|
+
exc_info=e,
|
1980
|
+
)
|
1981
|
+
func_def.returns = None
|
1982
|
+
|
1983
|
+
# Attempt to compile the function without annotations and defaults that
|
1984
|
+
# can't be compiled
|
1985
|
+
try:
|
1986
|
+
code = compile(
|
1987
|
+
ast.Module(body=[func_def], type_ignores=[]),
|
1988
|
+
filename="<ast>",
|
1989
|
+
mode="exec",
|
1990
|
+
)
|
1991
|
+
exec(code, namespace)
|
1992
|
+
except Exception as e:
|
1993
|
+
logger.debug("Failed to compile: %s", e)
|
1994
|
+
else:
|
1995
|
+
return namespace.get(func_def.name)
|
1996
|
+
|
1997
|
+
|
1858
1998
|
def load_flow_arguments_from_entrypoint(
|
1859
1999
|
entrypoint: str, arguments: Optional[Union[List[str], Set[str]]] = None
|
1860
2000
|
) -> Dict[str, Any]:
|
@@ -1870,6 +2010,9 @@ def load_flow_arguments_from_entrypoint(
|
|
1870
2010
|
"""
|
1871
2011
|
|
1872
2012
|
func_def, source_code = _entrypoint_definition_and_source(entrypoint)
|
2013
|
+
path = None
|
2014
|
+
if ":" in entrypoint:
|
2015
|
+
path = entrypoint.rsplit(":")[0]
|
1873
2016
|
|
1874
2017
|
if arguments is None:
|
1875
2018
|
# If no arguments are provided default to known arguments that are of
|
@@ -1905,7 +2048,7 @@ def load_flow_arguments_from_entrypoint(
|
|
1905
2048
|
|
1906
2049
|
# if the arg value is not a raw str (i.e. a variable or expression),
|
1907
2050
|
# then attempt to evaluate it
|
1908
|
-
namespace = safe_load_namespace(source_code)
|
2051
|
+
namespace = safe_load_namespace(source_code, filepath=path)
|
1909
2052
|
literal_arg_value = ast.get_source_segment(source_code, keyword.value)
|
1910
2053
|
cleaned_value = (
|
1911
2054
|
literal_arg_value.replace("\n", "") if literal_arg_value else ""
|
@@ -9,6 +9,7 @@ from functools import partial
|
|
9
9
|
from typing import List, Optional, Type
|
10
10
|
|
11
11
|
import anyio
|
12
|
+
from exceptiongroup import BaseExceptionGroup # novermin
|
12
13
|
from websockets.exceptions import InvalidStatusCode
|
13
14
|
|
14
15
|
from prefect import Task, get_client
|
@@ -225,16 +226,21 @@ class TaskServer:
|
|
225
226
|
validated_state=state,
|
226
227
|
)
|
227
228
|
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
229
|
+
try:
|
230
|
+
self._runs_task_group.start_soon(
|
231
|
+
partial(
|
232
|
+
submit_autonomous_task_run_to_engine,
|
233
|
+
task=task,
|
234
|
+
task_run=task_run,
|
235
|
+
parameters=parameters,
|
236
|
+
task_runner=self.task_runner,
|
237
|
+
client=self._client,
|
238
|
+
)
|
239
|
+
)
|
240
|
+
except BaseException as exc:
|
241
|
+
logger.exception(
|
242
|
+
f"Failed to submit task run {task_run.id!r} to engine", exc_info=exc
|
236
243
|
)
|
237
|
-
)
|
238
244
|
|
239
245
|
async def execute_task_run(self, task_run: TaskRun):
|
240
246
|
"""Execute a task run in the task server."""
|
@@ -301,6 +307,14 @@ async def serve(*tasks: Task, task_runner: Optional[Type[BaseTaskRunner]] = None
|
|
301
307
|
try:
|
302
308
|
await task_server.start()
|
303
309
|
|
310
|
+
except BaseExceptionGroup as exc: # novermin
|
311
|
+
exceptions = exc.exceptions
|
312
|
+
n_exceptions = len(exceptions)
|
313
|
+
logger.error(
|
314
|
+
f"Task worker stopped with {n_exceptions} exception{'s' if n_exceptions != 1 else ''}:"
|
315
|
+
f"\n" + "\n".join(str(e) for e in exceptions)
|
316
|
+
)
|
317
|
+
|
304
318
|
except StopTaskServer:
|
305
319
|
logger.info("Task server stopped.")
|
306
320
|
|
@@ -29,7 +29,9 @@ from uuid import UUID, uuid4
|
|
29
29
|
|
30
30
|
import anyio
|
31
31
|
import anyio.abc
|
32
|
+
import anyio.to_thread
|
32
33
|
import sniffio
|
34
|
+
from anyio.from_thread import start_blocking_portal
|
33
35
|
from typing_extensions import Literal, ParamSpec, TypeGuard
|
34
36
|
|
35
37
|
from prefect.logging import get_logger
|
@@ -134,7 +136,7 @@ async def run_sync_in_worker_thread(
|
|
134
136
|
"""
|
135
137
|
call = partial(__fn, *args, **kwargs)
|
136
138
|
return await anyio.to_thread.run_sync(
|
137
|
-
call,
|
139
|
+
call, abandon_on_cancel=True, limiter=get_thread_limiter()
|
138
140
|
)
|
139
141
|
|
140
142
|
|
@@ -202,7 +204,7 @@ async def run_sync_in_interruptible_worker_thread(
|
|
202
204
|
partial(
|
203
205
|
anyio.to_thread.run_sync,
|
204
206
|
capture_worker_thread_and_result,
|
205
|
-
|
207
|
+
abandon_on_cancel=True,
|
206
208
|
limiter=get_thread_limiter(),
|
207
209
|
)
|
208
210
|
)
|
@@ -228,7 +230,7 @@ def run_async_in_new_loop(__fn: Callable[..., Awaitable[T]], *args: Any, **kwarg
|
|
228
230
|
|
229
231
|
def in_async_worker_thread() -> bool:
|
230
232
|
try:
|
231
|
-
anyio.from_thread.threadlocals.
|
233
|
+
anyio.from_thread.threadlocals.current_async_backend
|
232
234
|
except AttributeError:
|
233
235
|
return False
|
234
236
|
else:
|
@@ -338,7 +340,7 @@ def sync(__async_fn: Callable[P, Awaitable[T]], *args: P.args, **kwargs: P.kwarg
|
|
338
340
|
"`sync` called from an asynchronous context; "
|
339
341
|
"you should `await` the async function directly instead."
|
340
342
|
)
|
341
|
-
with
|
343
|
+
with start_blocking_portal() as portal:
|
342
344
|
return portal.call(partial(__async_fn, *args, **kwargs))
|
343
345
|
elif in_async_worker_thread():
|
344
346
|
# In a sync context but we can access the event loop thread; send the async
|
@@ -346,17 +346,19 @@ def parameter_schema_from_entrypoint(entrypoint: str) -> ParameterSchema:
|
|
346
346
|
Returns:
|
347
347
|
ParameterSchema: The parameter schema for the function.
|
348
348
|
"""
|
349
|
+
filepath = None
|
349
350
|
if ":" in entrypoint:
|
350
351
|
# split by the last colon once to handle Windows paths with drive letters i.e C:\path\to\file.py:do_stuff
|
351
352
|
path, func_name = entrypoint.rsplit(":", maxsplit=1)
|
352
353
|
source_code = Path(path).read_text()
|
354
|
+
filepath = path
|
353
355
|
else:
|
354
356
|
path, func_name = entrypoint.rsplit(".", maxsplit=1)
|
355
357
|
spec = importlib.util.find_spec(path)
|
356
358
|
if not spec or not spec.origin:
|
357
359
|
raise ValueError(f"Could not find module {path!r}")
|
358
360
|
source_code = Path(spec.origin).read_text()
|
359
|
-
signature = _generate_signature_from_source(source_code, func_name)
|
361
|
+
signature = _generate_signature_from_source(source_code, func_name, filepath)
|
360
362
|
docstring = _get_docstring_from_source(source_code, func_name)
|
361
363
|
return generate_parameter_schema(signature, parameter_docstrings(docstring))
|
362
364
|
|
@@ -424,7 +426,7 @@ def raise_for_reserved_arguments(fn: Callable, reserved_arguments: Iterable[str]
|
|
424
426
|
|
425
427
|
|
426
428
|
def _generate_signature_from_source(
|
427
|
-
source_code: str, func_name: str
|
429
|
+
source_code: str, func_name: str, filepath: Optional[str] = None
|
428
430
|
) -> inspect.Signature:
|
429
431
|
"""
|
430
432
|
Extract the signature of a function from its source code.
|
@@ -440,7 +442,7 @@ def _generate_signature_from_source(
|
|
440
442
|
"""
|
441
443
|
# Load the namespace from the source code. Missing imports and exceptions while
|
442
444
|
# loading local class definitions are ignored.
|
443
|
-
namespace = safe_load_namespace(source_code)
|
445
|
+
namespace = safe_load_namespace(source_code, filepath=filepath)
|
444
446
|
# Parse the source code into an AST
|
445
447
|
parsed_code = ast.parse(source_code)
|
446
448
|
|
@@ -4,11 +4,13 @@ import inspect
|
|
4
4
|
import os
|
5
5
|
import signal
|
6
6
|
import time
|
7
|
+
from contextlib import contextmanager
|
7
8
|
from functools import partial
|
8
9
|
from typing import (
|
9
10
|
Any,
|
10
11
|
Callable,
|
11
12
|
Dict,
|
13
|
+
Generator,
|
12
14
|
Iterable,
|
13
15
|
Optional,
|
14
16
|
Set,
|
@@ -18,6 +20,7 @@ from typing import (
|
|
18
20
|
from uuid import UUID, uuid4
|
19
21
|
|
20
22
|
import anyio
|
23
|
+
from exceptiongroup import BaseExceptionGroup # novermin
|
21
24
|
from typing_extensions import Literal
|
22
25
|
|
23
26
|
import prefect
|
@@ -734,3 +737,14 @@ def emit_task_run_state_change_event(
|
|
734
737
|
},
|
735
738
|
follows=follows,
|
736
739
|
)
|
740
|
+
|
741
|
+
|
742
|
+
@contextmanager
|
743
|
+
def collapse_excgroups() -> Generator[None, None, None]:
|
744
|
+
try:
|
745
|
+
yield
|
746
|
+
except BaseException as exc:
|
747
|
+
while isinstance(exc, BaseExceptionGroup) and len(exc.exceptions) == 1:
|
748
|
+
exc = exc.exceptions[0]
|
749
|
+
|
750
|
+
raise exc
|