Skip to content

Commit

Permalink
[typing] Annotate all getattr_migration callsites
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpieters committed Dec 19, 2024
1 parent aa9b78b commit 289c7b4
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 12 deletions.
4 changes: 3 additions & 1 deletion src/prefect/agent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
2024-06-27: This surfaces an actionable error message for moved or removed objects in Prefect 3.0 upgrade.
"""
from typing import Any, Callable

from prefect._internal.compatibility.migration import getattr_migration

__getattr__ = getattr_migration(__name__)
__getattr__: Callable[[str], Any] = getattr_migration(__name__)
6 changes: 4 additions & 2 deletions src/prefect/deployments/deployments.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from .._internal.compatibility.migration import getattr_migration
from typing import Any, Callable

__getattr__ = getattr_migration(__name__)
from prefect._internal.compatibility.migration import getattr_migration

__getattr__: Callable[[str], Any] = getattr_migration(__name__)
3 changes: 2 additions & 1 deletion src/prefect/engine.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import sys
from typing import Any, Callable
from uuid import UUID

from prefect._internal.compatibility.migration import getattr_migration
Expand Down Expand Up @@ -72,4 +73,4 @@
# Let the exit code be determined by the base exception type
raise

__getattr__ = getattr_migration(__name__)
__getattr__: Callable[[str], Any] = getattr_migration(__name__)
4 changes: 2 additions & 2 deletions src/prefect/filesystems.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import urllib.parse
from pathlib import Path
from shutil import copytree
from typing import Any, Dict, Optional
from typing import Any, Callable, Dict, Optional

import anyio
import fsspec
Expand Down Expand Up @@ -544,4 +544,4 @@ async def put_directory(
pass


__getattr__ = getattr_migration(__name__)
__getattr__: Callable[[str], Any] = getattr_migration(__name__)
4 changes: 3 additions & 1 deletion src/prefect/infrastructure/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
2024-06-27: This surfaces an actionable error message for moved or removed objects in Prefect 3.0 upgrade.
"""
from typing import Any, Callable

from prefect._internal.compatibility.migration import getattr_migration

__getattr__ = getattr_migration(__name__)
__getattr__: Callable[[str], Any] = getattr_migration(__name__)
4 changes: 3 additions & 1 deletion src/prefect/infrastructure/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
2024-06-27: This surfaces an actionable error message for moved or removed objects in Prefect 3.0 upgrade.
"""
from typing import Any, Callable

from prefect._internal.compatibility.migration import getattr_migration

__getattr__ = getattr_migration(__name__)
__getattr__: Callable[[str], Any] = getattr_migration(__name__)
4 changes: 2 additions & 2 deletions src/prefect/variables.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import Any, Callable, Optional

from pydantic import BaseModel, Field

Expand Down Expand Up @@ -256,4 +256,4 @@ def my_flow():
return False


__getattr__ = getattr_migration(__name__)
__getattr__: Callable[[str], Any] = getattr_migration(__name__)
4 changes: 3 additions & 1 deletion src/prefect/workers/block.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
2024-06-27: This surfaces an actionable error message for moved or removed objects in Prefect 3.0 upgrade.
"""
from typing import Any, Callable

from prefect._internal.compatibility.migration import getattr_migration

__getattr__ = getattr_migration(__name__)
__getattr__: Callable[[str], Any] = getattr_migration(__name__)
4 changes: 3 additions & 1 deletion src/prefect/workers/cloud.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
2024-06-27: This surfaces an actionable error message for moved or removed objects in Prefect 3.0 upgrade.
"""
from typing import Any, Callable

from prefect._internal.compatibility.migration import getattr_migration

__getattr__ = getattr_migration(__name__)
__getattr__: Callable[[str], Any] = getattr_migration(__name__)

0 comments on commit 289c7b4

Please sign in to comment.