mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
* #1579 Fixed `Default` object annotation resolution in `pydantic` models. Reformat code. * Bump mongo and Redis dependencies * Update pydantic version constraints based on Python version Adjusted the version constraints for the pydantic library in `pyproject.toml` to ensure compatibility with different Python versions. This helps maintain stability and compatibility across various development environments. * Adjust version * Fixed typo
This commit is contained in:
parent
b7d61b6379
commit
f9f847f603
5 changed files with 12 additions and 7 deletions
1
CHANGES/1579.bugfix.rst
Normal file
1
CHANGES/1579.bugfix.rst
Normal file
|
|
@ -0,0 +1 @@
|
|||
Fixed `Default` object annotation resolution using `pydantic`
|
||||
|
|
@ -162,6 +162,7 @@ from .paid_media import PaidMedia
|
|||
from .paid_media_info import PaidMediaInfo
|
||||
from .paid_media_photo import PaidMediaPhoto
|
||||
from .paid_media_preview import PaidMediaPreview
|
||||
from .paid_media_purchased import PaidMediaPurchased
|
||||
from .paid_media_video import PaidMediaVideo
|
||||
from .passport_data import PassportData
|
||||
from .passport_element_error import PassportElementError
|
||||
|
|
@ -233,7 +234,6 @@ from .web_app_data import WebAppData
|
|||
from .web_app_info import WebAppInfo
|
||||
from .webhook_info import WebhookInfo
|
||||
from .write_access_allowed import WriteAccessAllowed
|
||||
from .paid_media_purchased import PaidMediaPurchased
|
||||
|
||||
__all__ = (
|
||||
"Animation",
|
||||
|
|
@ -473,6 +473,8 @@ __all__ = (
|
|||
"WriteAccessAllowed",
|
||||
)
|
||||
|
||||
from ..client.default import Default as _Default
|
||||
|
||||
# Load typing forward refs for every TelegramObject
|
||||
for _entity_name in __all__:
|
||||
_entity = globals()[_entity_name]
|
||||
|
|
@ -484,6 +486,7 @@ for _entity_name in __all__:
|
|||
"Optional": Optional,
|
||||
"Union": Union,
|
||||
"Literal": Literal,
|
||||
"Default": _Default,
|
||||
**{k: v for k, v in globals().items() if k in __all__},
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, Optional, cast
|
||||
|
||||
from .base import TelegramObject
|
||||
from ..utils.mypy_hacks import lru_cache
|
||||
from .base import TelegramObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .business_connection import BusinessConnection
|
||||
|
|
@ -18,11 +18,11 @@ if TYPE_CHECKING:
|
|||
from .message import Message
|
||||
from .message_reaction_count_updated import MessageReactionCountUpdated
|
||||
from .message_reaction_updated import MessageReactionUpdated
|
||||
from .paid_media_purchased import PaidMediaPurchased
|
||||
from .poll import Poll
|
||||
from .poll_answer import PollAnswer
|
||||
from .pre_checkout_query import PreCheckoutQuery
|
||||
from .shipping_query import ShippingQuery
|
||||
from .paid_media_purchased import PaidMediaPurchased
|
||||
|
||||
|
||||
class Update(TelegramObject):
|
||||
|
|
|
|||
|
|
@ -43,7 +43,8 @@ classifiers = [
|
|||
dependencies = [
|
||||
"magic-filter>=1.0.12,<1.1",
|
||||
"aiohttp>=3.9.0,<3.11",
|
||||
"pydantic>=2.4.1,<2.10",
|
||||
"pydantic>=2.4.1,<2.9; python_version < '3.9'", # v2.9 breaks compatibility with Python 3.8 without any reason
|
||||
"pydantic>=2.4.1,<2.10; python_version >= '3.9'",
|
||||
"aiofiles>=23.2.1,<24.2",
|
||||
"certifi>=2023.7.22",
|
||||
"typing-extensions>=4.7.0,<=5.0",
|
||||
|
|
@ -59,10 +60,10 @@ fast = [
|
|||
"aiodns>=3.0.0",
|
||||
]
|
||||
redis = [
|
||||
"redis[hiredis]~=5.0.1",
|
||||
"redis[hiredis]>=5.0.1,<5.1.0",
|
||||
]
|
||||
mongo = [
|
||||
"motor~=3.3.2",
|
||||
"motor>=3.3.2,<3.7.0",
|
||||
]
|
||||
proxy = [
|
||||
"aiohttp-socks~=0.8.3",
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ from aiogram.types import (
|
|||
Message,
|
||||
MessageReactionCountUpdated,
|
||||
MessageReactionUpdated,
|
||||
PaidMediaPurchased,
|
||||
Poll,
|
||||
PollAnswer,
|
||||
PollOption,
|
||||
|
|
@ -42,7 +43,6 @@ from aiogram.types import (
|
|||
ShippingQuery,
|
||||
Update,
|
||||
User,
|
||||
PaidMediaPurchased,
|
||||
)
|
||||
from aiogram.types.error_event import ErrorEvent
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue