Skip to content

Commit

Permalink
Merge pull request #8 from ApeWorX/fix/boto3-types
Browse files Browse the repository at this point in the history
fix: mypy_boto3_sqs dependency and conditional type checking import
  • Loading branch information
mikeshultz authored Aug 14, 2024
2 parents 15dee1c + 50bdba3 commit dec6aa7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dev = [
"flake8~=7.0.0",
"isort~=5.13.2",
"mypy~=1.8.0",
"mypy-boto3-sqs~=1.34.101",
"pytest~=7.4.4",
"requests~=2.31.0",
"setuptools-scm~=8.0.4",
Expand Down
10 changes: 8 additions & 2 deletions taskiq_sqs/broker.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
from __future__ import (
annotations, # Needed for conditional type import support
)

import asyncio
import logging
from datetime import datetime, timezone
from typing import AsyncGenerator, Callable, Optional, Union
from typing import TYPE_CHECKING, AsyncGenerator, Callable, Optional, Union

import boto3
from asyncer import asyncify
from botocore.exceptions import ClientError
from mypy_boto3_sqs.service_resource import Queue, SQSServiceResource
from taskiq import AsyncBroker
from taskiq.abc.result_backend import AsyncResultBackend
from taskiq.acks import AckableMessage
from taskiq.exceptions import BrokerError
from taskiq.message import BrokerMessage

if TYPE_CHECKING:
from mypy_boto3_sqs.service_resource import Queue, SQSServiceResource

logger = logging.getLogger(__name__)


Expand Down

0 comments on commit dec6aa7

Please sign in to comment.