Skip to content

Commit

Permalink
chore(deps): 更新 githubkit 0.11.7 与 pydantic 2.8.2 (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 authored Jul 18, 2024
1 parent 8ff88e4 commit 12a2aa4
Show file tree
Hide file tree
Showing 10 changed files with 276 additions and 277 deletions.
521 changes: 260 additions & 261 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository = "https://github.com/nonebot/noneflow"
python = "^3.10"
nonebot2 = "^2.3.0"
nonebot-adapter-github = "^0.4.1"
githubkit = "0.11.3"
githubkit = "^0.11.7"
pre-commit = "^3.3.2"
jinja2 = "^3.1.2"
pydantic-extra-types = "^2.5.0"
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/publish/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
WebhookIssueCommentCreatedPropIssueAllof0PropLabelsItems,
WebhookIssuesEditedPropIssuePropLabelsItems,
WebhookIssuesOpenedPropIssuePropLabelsItems,
WebhookIssuesReopenedPropIssueMergedLabels,
WebhookIssuesReopenedPropIssuePropLabelsItems,
WebhookPullRequestReviewSubmittedPropPullRequestPropLabelsItems,
)
from githubkit.typing import Missing
Expand Down Expand Up @@ -66,7 +66,7 @@ def get_type_by_labels(
labels: list[PullRequestPropLabelsItems]
| list[WebhookPullRequestReviewSubmittedPropPullRequestPropLabelsItems]
| Missing[list[WebhookIssuesOpenedPropIssuePropLabelsItems]]
| Missing[list[WebhookIssuesReopenedPropIssueMergedLabels]]
| Missing[list[WebhookIssuesReopenedPropIssuePropLabelsItems]]
| Missing[list[WebhookIssuesEditedPropIssuePropLabelsItems]]
| list[WebhookIssueCommentCreatedPropIssueAllof0PropLabelsItems] = Depends(
get_labels
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/publish/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
WebhookIssueCommentCreatedPropIssueAllof0PropLabelsItems,
WebhookIssuesEditedPropIssuePropLabelsItems,
WebhookIssuesOpenedPropIssuePropLabelsItems,
WebhookIssuesReopenedPropIssueMergedLabels,
WebhookIssuesReopenedPropIssuePropLabelsItems,
WebhookPullRequestReviewSubmittedPropPullRequestPropLabelsItems,
)

Expand All @@ -77,7 +77,7 @@ def get_type_by_labels(
| list["PullRequestSimplePropLabelsItems"]
| list["WebhookPullRequestReviewSubmittedPropPullRequestPropLabelsItems"]
| Missing[list["WebhookIssuesOpenedPropIssuePropLabelsItems"]]
| Missing[list["WebhookIssuesReopenedPropIssueMergedLabels"]]
| Missing[list["WebhookIssuesReopenedPropIssuePropLabelsItems"]]
| Missing[list["WebhookIssuesEditedPropIssuePropLabelsItems"]]
| list["WebhookIssueCommentCreatedPropIssueAllof0PropLabelsItems"],
) -> PublishType | None:
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/validation/fields/test_homepage.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async def test_homepage_failed_empty_homepage(mocked_api: MockRouter) -> None:
"msg": "字符串应满足格式 '^https?://.*$'",
"input": "",
"ctx": {"pattern": "^https?://.*$"},
"url": "https://errors.pydantic.dev/2.7/v/string_pattern_mismatch",
"url": "https://errors.pydantic.dev/2.8/v/string_pattern_mismatch",
}
]

Expand Down
2 changes: 1 addition & 1 deletion tests/utils/validation/fields/test_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async def test_name_too_long(mocked_api: MockRouter) -> None:
"msg": "字符串长度不能超过 50 个字符",
"input": "looooooooooooooooooooooooooooooooooooooooooooooooooooooooong",
"ctx": {"max_length": 50},
"url": "https://errors.pydantic.dev/2.7/v/string_too_long",
"url": "https://errors.pydantic.dev/2.8/v/string_too_long",
}
]

Expand Down
10 changes: 5 additions & 5 deletions tests/utils/validation/fields/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async def test_tags_color_missing(mocked_api: MockRouter) -> None:
"loc": ("tags", 0, "color"),
"msg": "字段不存在",
"input": {"label": "test"},
"url": "https://errors.pydantic.dev/2.7/v/missing",
"url": "https://errors.pydantic.dev/2.8/v/missing",
}
]

Expand Down Expand Up @@ -69,7 +69,7 @@ async def test_tags_label_invalid(mocked_api: MockRouter) -> None:
"msg": "字符串长度不能超过 10 个字符",
"input": "12345678901",
"ctx": {"max_length": 10},
"url": "https://errors.pydantic.dev/2.7/v/string_too_long",
"url": "https://errors.pydantic.dev/2.8/v/string_too_long",
}
]

Expand Down Expand Up @@ -106,7 +106,7 @@ async def test_tags_number_invalid(mocked_api: MockRouter) -> None:
{"label": "4", "color": "#ffffff"},
],
"ctx": {"field_type": "List", "max_length": 3, "actual_length": 4},
"url": "https://errors.pydantic.dev/2.7/v/too_long",
"url": "https://errors.pydantic.dev/2.8/v/too_long",
}
]

Expand Down Expand Up @@ -155,7 +155,7 @@ async def test_tags_json_not_list(mocked_api: MockRouter) -> None:
"loc": ("tags",),
"msg": "值不是合法的列表",
"input": {"test": "test"},
"url": "https://errors.pydantic.dev/2.7/v/list_type",
"url": "https://errors.pydantic.dev/2.8/v/list_type",
}
]

Expand All @@ -180,7 +180,7 @@ async def test_tags_json_not_dict(mocked_api: MockRouter) -> None:
"msg": "值不是合法的字典",
"input": "1",
"ctx": {"class_name": "Tag"},
"url": "https://errors.pydantic.dev/2.7/v/model_type",
"url": "https://errors.pydantic.dev/2.8/v/model_type",
}
]

Expand Down
2 changes: 1 addition & 1 deletion tests/utils/validation/test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async def test_adapter_info_validation_failed(mocked_api: MockRouter) -> None:
"msg": "字符串长度不能超过 10 个字符",
"input": "testtoolong",
"ctx": {"max_length": 10},
"url": "https://errors.pydantic.dev/2.7/v/string_too_long",
"url": "https://errors.pydantic.dev/2.8/v/string_too_long",
},
{
"type": "color_error",
Expand Down
4 changes: 2 additions & 2 deletions tests/utils/validation/test_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async def test_bot_info_validation_failed(mocked_api: MockRouter) -> None:
"msg": "字符串长度不能超过 50 个字符",
"input": "tooooooooooooooooooooooooooooooooooooooooooooooooog",
"ctx": {"max_length": 50},
"url": "https://errors.pydantic.dev/2.7/v/string_too_long",
"url": "https://errors.pydantic.dev/2.8/v/string_too_long",
},
{
"type": "homepage",
Expand All @@ -70,7 +70,7 @@ async def test_bot_info_validation_failed(mocked_api: MockRouter) -> None:
"msg": "字符串长度不能超过 10 个字符",
"input": "testtoolong",
"ctx": {"max_length": 10},
"url": "https://errors.pydantic.dev/2.7/v/string_too_long",
"url": "https://errors.pydantic.dev/2.8/v/string_too_long",
},
{
"type": "color_error",
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/validation/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async def test_plugin_info_validation_failed(mocked_api: MockRouter) -> None:
"msg": "字符串长度不能超过 10 个字符",
"input": "testtoolong",
"ctx": {"max_length": 10},
"url": "https://errors.pydantic.dev/2.7/v/string_too_long",
"url": "https://errors.pydantic.dev/2.8/v/string_too_long",
},
{
"type": "color_error",
Expand Down

0 comments on commit 12a2aa4

Please sign in to comment.