Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump actions/download-artifact from 3 to 4 #280

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: wheels
- name: Publish to PyPI
Expand Down
8 changes: 4 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@
import os.path

# User's Sphinx configurations
language_user = globals().get('language', None)
latex_engine_user = globals().get('latex_engine', None)
latex_elements_user = globals().get('latex_elements', None)
language_user = globals().get("language", None)
latex_engine_user = globals().get("latex_engine", None)
latex_elements_user = globals().get("latex_elements", None)

# Remove this once xindy gets installed in Docker image and XINDYOPS
# env variable is supported
# https://github.com/rtfd/readthedocs-docker-images/pull/98
latex_use_xindy = False
latex_use_xindy = False
4 changes: 3 additions & 1 deletion iamai/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ class Bot:
plugin_state: Dict[str, Any]
global_state: Dict[Any, Any]

_condition: asyncio.Condition # Condition used to handle get # pyright: ignore[reportUninitializedInstanceVariable]
_condition: (
asyncio.Condition
) # Condition used to handle get # pyright: ignore[reportUninitializedInstanceVariable]
_current_event: Optional[Event[Any]] # Event currently pending

_restart_flag: bool # Restart flag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
本适配器用于实现定时任务,适配器将使用 APScheduler 实现定时任务,在设定的时间产生一个事件供插件处理。
APScheduler 使用方法请参考:[APScheduler](https://apscheduler.readthedocs.io/)。
"""

import inspect
from functools import wraps
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Dict, Type, Union
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""APScheduler 适配器配置。"""

from typing import Any, Dict

from pydantic import Field
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""APScheduler 适配器事件。"""

from typing import TYPE_CHECKING, Any, Dict, Optional, Type, Union

from apscheduler.job import Job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [ ] onebot 适配
- [ ] api
"""

import os
import re
import sys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,10 @@ async def _init_host_server(self):
) as res:
if res.status != 200:
logger.warning(
"room %d getConf失败:%d %s", self._room_id, res.status, res.reason
"room %d getConf失败:%d %s",
self._room_id,
res.status,
res.reason,
)
return False
data = await res.json()
Expand Down Expand Up @@ -336,7 +339,9 @@ async def _message_loop(self):
logger.warn(f"{self.room_id} 程序被強制取消。")
raise
except Exception:
logger.exception("room %d 处理消息时发生错误:", self.room_id)
logger.exception(
"room %d 处理消息时发生错误:", self.room_id
)

except asyncio.CancelledError:
break
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Bililive 适配器配置。"""

from typing import Any, Dict, List, Union, Literal, Optional

from iamai.config import ConfigModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Bililive 适配器事件。"""

import asyncio
import inspect
from enum import IntEnum
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Bililive 适配器异常。"""

from typing import Optional

from iamai.exceptions import AdapterException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Bililive 适配器消息。"""

import json
from io import StringIO
from dataclasses import dataclass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Console适配器。

"""

from asyncio import Condition

from iamai.event import Event
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Console 适配器配置。"""

from typing import Any, Dict

from iamai.config import ConfigModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Console 适配器事件。"""

import inspect
from datetime import datetime
from typing import (
Expand Down Expand Up @@ -63,4 +64,4 @@ def get_session_id(self) -> str:

def is_tome(self) -> bool:
"""获取事件是否与机器人有关的方法。"""
return True
return True
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
本适配器适配了钉钉企业自建机器人协议。
协议详情请参考:[钉钉开放平台](https://open.dingtalk.com/document/robots/robot-overview)。
"""

import base64
import hashlib
import hmac
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DingTalk 适配器配置。"""

from iamai.config import ConfigModel

__all__ = ["Config"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DingTalk 适配器事件。"""

import time
from typing import TYPE_CHECKING, Any, Dict, List, Literal, Optional, Union
from typing_extensions import Self
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DingTalk 适配器异常。"""

from iamai.exceptions import AdapterException

__all__ = ["DingTalkException", "NetworkError", "WebhookExpiredError"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DingTalk 适配器消息。"""

from typing import Any, Dict, List, Optional

from pydantic import model_serializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
本适配器适配了 gensokyo obv11 协议。
协议详情请参考:[OneBot](https://github.com/howmanybots/onebot/blob/master/README.md)。
"""

import asyncio
import inspect
import json
Expand Down Expand Up @@ -101,9 +102,11 @@ async def websocket_connect(self) -> None:
logger.info("Tying to connect to WebSocket server...")
async with self.session.ws_connect(
f"ws://{self.host}:{self.port}/",
headers={"Authorization": f"Bearer {self.config.access_token}"}
if self.config.access_token
else None,
headers=(
{"Authorization": f"Bearer {self.config.access_token}"}
if self.config.access_token
else None
),
) as self.websocket:
await self.handle_websocket()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""GSK 适配器配置。"""

from typing import Literal

from iamai.config import ConfigModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""GSK 适配器事件。"""

# pyright: reportIncompatibleVariableOverride=false

from typing import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""GSK 适配器异常。"""

from typing import Any, ClassVar, Dict

from iamai.exceptions import AdapterException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""GSK 适配器消息。"""

from typing import Literal, Optional, Type, Union
from typing_extensions import Self

Expand Down
1 change: 1 addition & 0 deletions packages/iamai-adapter-kook/iamai/adapter/kook/_event.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Kook 适配器事件。"""

import asyncio
import inspect
from enum import IntEnum
Expand Down
3 changes: 1 addition & 2 deletions packages/iamai-adapter-kook/iamai/adapter/kook/api/client.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
class ApiClient:
...
class ApiClient: ...
8 changes: 8 additions & 0 deletions packages/iamai-adapter-kook/iamai/adapter/kook/api/client.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class ApiClient:
ChannelRoleInfo: 频道角色权限详情
"""
...

async def channelRole_update(
self,
*,
Expand Down Expand Up @@ -95,6 +96,7 @@ class ApiClient:
msg_id (str): 消息 id
"""
...

async def directMessage_deleteReaction(
self, *, msg_id: str, emoji: str, user_id: Optional[str] = ...
) -> None: ...
Expand Down Expand Up @@ -126,6 +128,7 @@ class ApiClient:
DirectMessagesReturn:获取私信聊天消息列表返回信息
"""
...

async def directMessage_reactionList(
self, *, msg_id: str, emoji: str
) -> List[ReactionUser]: ...
Expand All @@ -143,6 +146,7 @@ class ApiClient:
回复某条消息的msgId. 如果为空,则代表删除回复,不传则无影响.
"""
...

async def directMessage_view(
self, *, chat_code: str, msg_id: str
) -> DirectMessage: ...
Expand Down Expand Up @@ -216,6 +220,7 @@ class ApiClient:
GuildsReturn: 当前用户加入的服务器列表返回信息
"""
...

async def guild_nickname(
self,
*,
Expand Down Expand Up @@ -254,6 +259,7 @@ class ApiClient:
GuildsReturn: 服务器中的用户列表返回信息
"""
...

async def guild_view(self, *, guild_id: str) -> Guild:
"""获取服务器详情

Expand All @@ -264,6 +270,7 @@ class ApiClient:
Guild: 服务器详情
"""
...

async def intimacy_index(self, *, user_id: str) -> IntimacyIndexReturn: ...
async def intimacy_update(
self,
Expand Down Expand Up @@ -342,6 +349,7 @@ class ApiClient:
async def user_offline(self) -> None:
"""下线机器人"""
...

async def user_view(
self, *, user_id: str, guild_id: Optional[str] = ...
) -> User: ...
1 change: 1 addition & 0 deletions packages/iamai-adapter-kook/iamai/adapter/kook/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Kook 适配器配置。"""

from typing import Literal

from iamai.config import ConfigModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Kook 适配器异常。"""

from typing import Optional

from iamai.exceptions import AdapterException
Expand Down
1 change: 1 addition & 0 deletions packages/iamai-adapter-kook/iamai/adapter/kook/message.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Kook 适配器消息。"""

import json
from io import StringIO
from dataclasses import dataclass
Expand Down
9 changes: 6 additions & 3 deletions packages/iamai-adapter-red/iamai/adapter/red/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
本适配器适配了 red 协议。
协议详情请参考: [RedProtocol](https://chrononeko.github.io/QQNTRedProtocol/) 。
"""

import os
import json
import asyncio
Expand Down Expand Up @@ -70,9 +71,11 @@ async def websocket_connect(self):
logger.info("Tying to connect to WebSocket server...")
async with self.session.ws_connect(
f"ws://{self.host}:{self.port}/",
headers={"Authorization": f"Bearer {self.access_token}"}
if self.access_token
else None,
headers=(
{"Authorization": f"Bearer {self.access_token}"}
if self.access_token
else None
),
) as self.websocket:
connect = {
"type": "meta::connect",
Expand Down
4 changes: 2 additions & 2 deletions packages/iamai-adapter-red/iamai/adapter/red/event.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Red 适配器事件。"""

import inspect
from enum import IntEnum
from datetime import datetime, timedelta
Expand Down Expand Up @@ -44,8 +45,7 @@ class EmojiZplan(BaseModel):
bytesReserveInfo: str


class ThumbPath(BaseModel):
...
class ThumbPath(BaseModel): ...


class TextElement(BaseModel):
Expand Down
Loading