Pydantic поднят до v2. Добавлена проверка минимальных версий#37
Merged
love-apples merged 7 commits intolove-apples:mainfrom Feb 17, 2026
Merged
Pydantic поднят до v2. Добавлена проверка минимальных версий#37love-apples merged 7 commits intolove-apples:mainfrom
love-apples merged 7 commits intolove-apples:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
PR обновляет библиотеку для совместимости с Pydantic v2 и добавляет проверку работы на минимально-совместимых версиях зависимостей в CI.
Changes:
- Миграция конфигураций Pydantic-моделей на v2-стиль (
ConfigDict) и заменаjson_encodersна сериализацию через@field_serializer. - Добавление утилит
to_ms/from_msи приведение ms↔datetime преобразований к единому стилю в коде. - Расширение GitHub Actions матрицы тестов, чтобы прогонять на “lowest-direct” и “highest” разрешении зависимостей.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Обновляет диапазоны версий зависимостей (в т.ч. pydantic>=2,<3) и dev-инструментов; уточняет optional-deps. |
maxapi/utils/time.py |
Добавляет общие функции преобразования времени в/из миллисекунд. |
tests/test_time_utils.py |
Добавляет unit-тесты на to_ms/from_ms. |
maxapi/types/chats.py |
Переводит модель на Pydantic v2, добавляет валидатор/сериализатор для participants (ms↔datetime). |
maxapi/types/message.py |
Переводит конфиг модели на ConfigDict для populate_by_name. |
maxapi/types/updates/update.py |
Переводит arbitrary_types_allowed на ConfigDict. |
maxapi/types/updates/dialog_muted.py |
Использует from_ms для вычисления muted_until_datetime. |
maxapi/types/attachments/attachment.py |
Переводит use_enum_values на ConfigDict. |
maxapi/types/attachments/buttons/button.py |
Переводит use_enum_values на ConfigDict. |
maxapi/types/users.py |
Удаляет устаревший json_encoders (и лишний импорт datetime). |
maxapi/methods/get_messages.py |
Использует to_ms при формировании параметров from/to. |
maxapi/dispatcher.py |
Использует to_ms/from_ms для текущего timestamp и логирования. |
.github/workflows/tests.yml |
Добавляет прогон тестов с разными стратегиями резолва зависимостей (lowest-direct/highest). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Owner
|
@Olegt0rr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #36
Обновляем проект до минимально‑необходимых изменений для совместимости с Pydantic v2:
Дополнительно добавляем в матрицу тестирования проверку работы библиотеки на минимально-совместимых версиях