Skip to content

Commit 53e1e37

Browse files
authored
update dependencies (#29)
* update dependencies * update codecov.yml
1 parent a45f69e commit 53e1e37

11 files changed

Lines changed: 539 additions & 769 deletions

File tree

.github/workflows/codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
15-
python-version: ["3.8", "3.9", "3.10", "3.11"]
15+
python-version: ["3.9", "3.10", "3.11", "3.12"]
1616
os: [ubuntu-latest, windows-latest, macos-latest]
1717
fail-fast: false
1818
env:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ dist/
33
.vscode/
44
data/
55
.env
6+
node_modules/

.pre-commit-config.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,6 @@ repos:
1212
args: [--fix, --exit-non-zero-on-fix]
1313
stages: [commit]
1414

15-
- repo: https://github.com/pycqa/isort
16-
rev: 5.13.2
17-
hooks:
18-
- id: isort
19-
stages: [commit]
20-
21-
- repo: https://github.com/psf/black
22-
rev: 24.4.2
23-
hooks:
24-
- id: black
25-
stages: [commit]
26-
2715
- repo: https://github.com/pre-commit/mirrors-prettier
2816
rev: v4.0.0-alpha.8
2917
hooks:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ _✨ [Nonebot2](https://github.com/nonebot/nonebot2) 会话信息提取与会话
1010

1111
<p align="center">
1212
<img src="https://img.shields.io/github/license/noneplugin/nonebot-plugin-session" alt="license">
13-
<img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="Python">
14-
<img src="https://img.shields.io/badge/nonebot-2.0.0+-red.svg" alt="NoneBot">
13+
<img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="Python">
14+
<img src="https://img.shields.io/badge/nonebot-2.3.0+-red.svg" alt="NoneBot">
1515
<a href="https://pypi.org/project/nonebot-plugin-session">
1616
<img src="https://badgen.net/pypi/v/nonebot-plugin-session" alt="pypi">
1717
</a>

nonebot_plugin_session/extractor.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
from typing import Generic, List, NamedTuple, Optional, Type, TypeVar, Union
1+
from typing import Annotated, Generic, NamedTuple, Optional, TypeVar, Union
22

33
from nonebot.adapters import Bot, Event
44
from nonebot.params import Depends
5-
from typing_extensions import Annotated
65

76
from .const import SupportedPlatform
87
from .session import Session, SessionIdType, SessionLevel
@@ -53,16 +52,16 @@ def extract(self) -> Session:
5352

5453

5554
class SessionExtractorTuple(NamedTuple):
56-
bot: Type[Bot]
57-
event: Type[Event]
58-
extractor: Type[SessionExtractor]
55+
bot: type[Bot]
56+
event: type[Event]
57+
extractor: type[SessionExtractor]
5958

6059

61-
_session_extractors: List[SessionExtractorTuple] = []
60+
_session_extractors: list[SessionExtractorTuple] = []
6261

6362

64-
def register_session_extractor(bot: Type[Bot], event: Type[Event]):
65-
def wrapper(extractor: Type[SessionExtractor]):
63+
def register_session_extractor(bot: type[Bot], event: type[Event]):
64+
def wrapper(extractor: type[SessionExtractor]):
6665
_session_extractors.append(SessionExtractorTuple(bot, event, extractor))
6766
return extractor
6867

@@ -87,7 +86,7 @@ def SessionId(
8786
include_platform: bool = True,
8887
include_bot_type: bool = True,
8988
include_bot_id: bool = True,
90-
seperator: str = "_"
89+
seperator: str = "_",
9190
):
9291
def dependency(bot: Bot, event: Event) -> str:
9392
session = extract_session(bot, event)

nonebot_plugin_session/session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from enum import IntEnum
2-
from typing import List, Optional, Union
2+
from typing import Optional, Union
33

44
from pydantic import BaseModel
55

@@ -63,7 +63,7 @@ def get_id(
6363
include_id2 = bool((id_type >> 1) & 1)
6464
include_id3 = bool((id_type >> 2) & 1)
6565

66-
parts: List[str] = []
66+
parts: list[str] = []
6767
if include_platform:
6868
parts.append(self.platform)
6969
if include_bot_type:

poetry.lock

Lines changed: 443 additions & 449 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ homepage = "https://github.com/noneplugin/nonebot-plugin-session"
99
repository = "https://github.com/noneplugin/nonebot-plugin-session"
1010

1111
[tool.poetry.dependencies]
12-
python = "^3.8"
13-
nonebot2 = "^2.0.0"
14-
strenum = "^0.4.8"
12+
python = "^3.9"
13+
nonebot2 = "^2.3.0"
14+
strenum = "^0.4.15"
1515

1616
[tool.poetry.group.dev.dependencies]
1717

1818
[tool.poetry.group.test.dependencies]
19-
pytest-cov = "^4.0.0"
20-
pytest-asyncio = "^0.20.0"
19+
pytest-cov = "^5.0.0"
20+
pytest-asyncio = "^0.23.0"
2121
nonebug = "^0.3.0"
2222
websockets = { version = ">=10.0" }
2323
fastapi = { version = ">=0.93.0,<1.0.0" }
@@ -28,28 +28,33 @@ uvicorn = { version = ">=0.20.0,<1.0.0", extras = ["standard"] }
2828
optional = true
2929

3030
[tool.poetry.group.adapters.dependencies]
31-
nonebot-adapter-onebot = "^2.4.0"
32-
nonebot-adapter-console = "^0.5.0"
33-
nonebot-adapter-kaiheila = "^0.3.1"
34-
nonebot-adapter-telegram = { git = "https://github.com/nonebot/adapter-telegram.git" }
35-
nonebot-adapter-feishu = "^2.4.0"
31+
nonebot-adapter-onebot = "^2.4.4"
32+
nonebot-adapter-console = "^0.6.0"
33+
nonebot-adapter-kaiheila = "^0.3.4"
34+
nonebot-adapter-telegram = "^0.1.0b17"
35+
nonebot-adapter-feishu = "^2.6.2"
3636
nonebot-adapter-red = "^0.9.0"
37-
nonebot-adapter-discord = { git = "https://github.com/nonebot/adapter-discord.git" }
38-
nonebot-adapter-satori = "^0.9.3"
39-
nonebot-adapter-qq = "^1.4.1"
40-
nonebot-adapter-dodo = "^0.2.0"
37+
nonebot-adapter-discord = "^0.1.8"
38+
nonebot-adapter-satori = "^0.12.3"
39+
nonebot-adapter-qq = "^1.5.0"
40+
nonebot-adapter-dodo = "^0.2.1"
4141

4242
[tool.nonebot]
4343
plugins = ["nonebot_plugin_session"]
4444
adapters = [
4545
{ name = "OneBot V11", module_name = "nonebot.adapters.onebot.v11" },
4646
]
4747

48-
[tool.isort]
49-
profile = "black"
50-
skip_gitignore = true
48+
[tool.pyright]
49+
pythonVersion = "3.9"
50+
pythonPlatform = "All"
51+
typeCheckingMode = "basic"
5152

5253
[tool.ruff]
54+
line-length = 88
55+
target-version = "py39"
56+
57+
[tool.ruff.lint]
5358
select = ["E", "W", "F", "UP", "C", "T", "PYI", "Q"]
5459
ignore = ["E402", "E501", "E711", "C901", "UP037"]
5560

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pathlib import Path
2-
from typing import TYPE_CHECKING, Set
2+
from typing import TYPE_CHECKING
33

44
import nonebot
55
import pytest
@@ -25,6 +25,6 @@ async def app():
2525

2626

2727
@pytest.fixture(scope="session", autouse=True)
28-
def load_plugin(nonebug_init: None) -> Set["Plugin"]:
28+
def load_plugin(nonebug_init: None) -> set["Plugin"]:
2929
# preload global plugins
3030
return nonebot.load_plugins(str(Path(__file__).parent / "plugins"))

0 commit comments

Comments
 (0)