diff --git a/.clang-format b/.clang-format index 10e3ac5f..93c0ec2b 100644 --- a/.clang-format +++ b/.clang-format @@ -5,6 +5,8 @@ ColumnLimit: 120 Language: Cpp AccessModifierOffset: -4 PointerAlignment: Left +IndentPPDirectives: AfterHash +RequiresExpressionIndentation: OuterScope BreakBeforeBraces: Custom BraceWrapping: AfterClass: true diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 34608f41..52ef074b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: - python-version: ["3.8", "3.12"] + python-version: ["3.9", "3.12"] steps: - name: Checkout develop diff --git a/.github/workflows/Publish.yml b/.github/workflows/Publish.yml index 0e722414..c624e5d6 100644 --- a/.github/workflows/Publish.yml +++ b/.github/workflows/Publish.yml @@ -12,13 +12,13 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: ["ubuntu-latest", "windows-latest", "macos-latest"] + os: ["ubuntu-latest", "windows-latest", "macos-latest", "macos-13"] steps: - uses: actions/checkout@v4 - name: Build wheels - uses: pypa/cibuildwheel@v2.19.2 + uses: pypa/cibuildwheel@v2.20.0 - uses: actions/upload-artifact@v4 with: diff --git a/.gitignore b/.gitignore index 887e6156..dd30b1ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,12 @@ -.venv/ -.vscode/ +.*/ +!.github/ *_cache/ *.py[cd] __pycache__ log/ dist/ -build/ +*build*/ .python-version *.lock diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ce129d9..1d1e328f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,9 @@ cmake_minimum_required(VERSION 3.15 FATAL_ERROR) +if (NOT SKBUILD_PROJECT_NAME) + set(SKBUILD_PROJECT_NAME "aiotieba") +endif () + project(${SKBUILD_PROJECT_NAME} VERSION ${SKBUILD_PROJECT_VERSION}) find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module) diff --git a/aiotieba/api/_classdef/container.py b/aiotieba/api/_classdef/container.py index acd26bcd..9df76b9b 100644 --- a/aiotieba/api/_classdef/container.py +++ b/aiotieba/api/_classdef/container.py @@ -1,7 +1,8 @@ from __future__ import annotations import dataclasses as dcs -from typing import Generic, Iterator, SupportsIndex, TypeVar, overload +from collections.abc import Iterator +from typing import Generic, SupportsIndex, TypeVar, overload TypeContainer = TypeVar('TypeContainer') diff --git a/aiotieba/api/get_ats/_classdef.py b/aiotieba/api/get_ats/_classdef.py index 1d2fcc13..aa51136d 100644 --- a/aiotieba/api/get_ats/_classdef.py +++ b/aiotieba/api/get_ats/_classdef.py @@ -1,8 +1,8 @@ from __future__ import annotations import dataclasses as dcs +from collections.abc import Mapping from functools import cached_property -from typing import Mapping from ...enums import PrivLike, PrivReply from ...exception import TbErrorExt diff --git a/aiotieba/api/get_bawu_perm/_classdef.py b/aiotieba/api/get_bawu_perm/_classdef.py index 7520e918..4a6ae036 100644 --- a/aiotieba/api/get_bawu_perm/_classdef.py +++ b/aiotieba/api/get_bawu_perm/_classdef.py @@ -1,7 +1,7 @@ from __future__ import annotations import dataclasses as dcs -from typing import Mapping +from collections.abc import Mapping from ...enums import BawuPermType from ...exception import TbErrorExt diff --git a/aiotieba/api/get_bawu_postlogs/_classdef.py b/aiotieba/api/get_bawu_postlogs/_classdef.py index acacc9b6..cbdb132d 100644 --- a/aiotieba/api/get_bawu_postlogs/_classdef.py +++ b/aiotieba/api/get_bawu_postlogs/_classdef.py @@ -6,7 +6,7 @@ import bs4 from ...exception import TbErrorExt -from ...helper import default_datetime, removeprefix +from ...helper import default_datetime from .._classdef import Containers from .._classdef.contents import _IMAGEHASH_EXP @@ -101,7 +101,7 @@ def from_tbdata(data_tag: bs4.element.Tag) -> Postlog: pid = 0 text = f"{title}\n{text}" else: - title = removeprefix(title, '回复:') + title = title.removeprefix('回复:') if media_list_item := text_item.next_sibling: medias = [Media_postlog.from_tbdata(tag) for tag in media_list_item.find_all('a')] diff --git a/aiotieba/api/get_blacklist/_classdef.py b/aiotieba/api/get_blacklist/_classdef.py index a71f88a5..956f791e 100644 --- a/aiotieba/api/get_blacklist/_classdef.py +++ b/aiotieba/api/get_blacklist/_classdef.py @@ -1,8 +1,8 @@ from __future__ import annotations import dataclasses as dcs +from collections.abc import Mapping from functools import cached_property -from typing import Mapping from ...enums import BlacklistType from ...exception import TbErrorExt diff --git a/aiotieba/api/get_blocks/_classdef.py b/aiotieba/api/get_blocks/_classdef.py index cb702f75..f9859e09 100644 --- a/aiotieba/api/get_blocks/_classdef.py +++ b/aiotieba/api/get_blocks/_classdef.py @@ -1,7 +1,7 @@ from __future__ import annotations import dataclasses as dcs -from typing import Mapping +from collections.abc import Mapping import bs4 diff --git a/aiotieba/api/get_comments/_classdef.py b/aiotieba/api/get_comments/_classdef.py index 3f199058..d7393e20 100644 --- a/aiotieba/api/get_comments/_classdef.py +++ b/aiotieba/api/get_comments/_classdef.py @@ -5,7 +5,6 @@ from ...enums import Gender, PrivLike, PrivReply from ...exception import TbErrorExt -from ...helper import removeprefix from .._classdef import Containers, TypeMessage from .._classdef.contents import ( _IMAGEHASH_EXP, @@ -277,7 +276,7 @@ def from_tbdata(data_proto: TypeMessage) -> None: contents.texts = contents.texts[2:] if contents.texts: first_text_frag = contents.texts[0] - first_text_frag.text = removeprefix(first_text_frag.text, ' :') + first_text_frag.text = first_text_frag.text.removeprefix(' :') pid = data_proto.id user = UserInfo_c.from_tbdata(data_proto.author) diff --git a/aiotieba/api/get_fans/_classdef.py b/aiotieba/api/get_fans/_classdef.py index acdaab7d..d828afb9 100644 --- a/aiotieba/api/get_fans/_classdef.py +++ b/aiotieba/api/get_fans/_classdef.py @@ -1,8 +1,8 @@ from __future__ import annotations import dataclasses as dcs +from collections.abc import Mapping from functools import cached_property -from typing import Mapping from ...exception import TbErrorExt from .._classdef import Containers diff --git a/aiotieba/api/get_follow_forums/_classdef.py b/aiotieba/api/get_follow_forums/_classdef.py index b0854332..c2dcb743 100644 --- a/aiotieba/api/get_follow_forums/_classdef.py +++ b/aiotieba/api/get_follow_forums/_classdef.py @@ -1,7 +1,7 @@ from __future__ import annotations import dataclasses as dcs -from typing import Mapping +from collections.abc import Mapping from ...exception import TbErrorExt from .._classdef import Containers diff --git a/aiotieba/api/get_follows/_classdef.py b/aiotieba/api/get_follows/_classdef.py index 9ccc4361..6b955514 100644 --- a/aiotieba/api/get_follows/_classdef.py +++ b/aiotieba/api/get_follows/_classdef.py @@ -1,8 +1,8 @@ from __future__ import annotations import dataclasses as dcs +from collections.abc import Mapping from functools import cached_property -from typing import Mapping from ...exception import TbErrorExt from .._classdef import Containers diff --git a/aiotieba/api/get_forum/_classdef.py b/aiotieba/api/get_forum/_classdef.py index 726e7462..f6b68e28 100644 --- a/aiotieba/api/get_forum/_classdef.py +++ b/aiotieba/api/get_forum/_classdef.py @@ -1,7 +1,7 @@ from __future__ import annotations import dataclasses as dcs -from typing import Mapping +from collections.abc import Mapping from ...exception import TbErrorExt diff --git a/aiotieba/api/get_god_threads/_classdef.py b/aiotieba/api/get_god_threads/_classdef.py index 99b9dbd9..17b0c053 100644 --- a/aiotieba/api/get_god_threads/_classdef.py +++ b/aiotieba/api/get_god_threads/_classdef.py @@ -1,7 +1,7 @@ from __future__ import annotations import dataclasses as dcs -from typing import Mapping +from collections.abc import Mapping from ...exception import TbErrorExt from .._classdef import Containers diff --git a/aiotieba/api/get_posts/_classdef.py b/aiotieba/api/get_posts/_classdef.py index 97611c72..9062d012 100644 --- a/aiotieba/api/get_posts/_classdef.py +++ b/aiotieba/api/get_posts/_classdef.py @@ -5,7 +5,6 @@ from ...enums import Gender, PrivLike, PrivReply from ...exception import TbErrorExt -from ...helper import removeprefix from .._classdef import Containers, TypeMessage, VirtualImage, VoteInfo from .._classdef.contents import ( _IMAGEHASH_EXP, @@ -471,7 +470,7 @@ def from_tbdata(data_proto: TypeMessage) -> Comment_p: contents.texts = contents.texts[2:] if contents.texts: first_text_frag = contents.texts[0] - first_text_frag.text = removeprefix(first_text_frag.text, ' :') + first_text_frag.text = first_text_frag.text.removeprefix(' :') contents = contents diff --git a/aiotieba/api/get_rank_users/_classdef.py b/aiotieba/api/get_rank_users/_classdef.py index 1e1b52cb..58266123 100644 --- a/aiotieba/api/get_rank_users/_classdef.py +++ b/aiotieba/api/get_rank_users/_classdef.py @@ -1,7 +1,7 @@ from __future__ import annotations import dataclasses as dcs -from typing import Mapping +from collections.abc import Mapping import bs4 diff --git a/aiotieba/api/get_recom_status/_classdef.py b/aiotieba/api/get_recom_status/_classdef.py index c1cfbd2b..7f538d9f 100644 --- a/aiotieba/api/get_recom_status/_classdef.py +++ b/aiotieba/api/get_recom_status/_classdef.py @@ -1,7 +1,7 @@ from __future__ import annotations import dataclasses as dcs -from typing import Mapping +from collections.abc import Mapping from ...exception import TbErrorExt diff --git a/aiotieba/api/get_recovers/_classdef.py b/aiotieba/api/get_recovers/_classdef.py index 6143d8c2..2e466f3e 100644 --- a/aiotieba/api/get_recovers/_classdef.py +++ b/aiotieba/api/get_recovers/_classdef.py @@ -1,8 +1,8 @@ from __future__ import annotations import dataclasses as dcs +from collections.abc import Mapping from functools import cached_property -from typing import Mapping from ...exception import TbErrorExt from .._classdef import Containers diff --git a/aiotieba/api/get_self_follow_forums/_classdef.py b/aiotieba/api/get_self_follow_forums/_classdef.py index 4e85df67..958da90a 100644 --- a/aiotieba/api/get_self_follow_forums/_classdef.py +++ b/aiotieba/api/get_self_follow_forums/_classdef.py @@ -1,7 +1,7 @@ from __future__ import annotations import dataclasses as dcs -from typing import Mapping +from collections.abc import Mapping from ...exception import TbErrorExt from .._classdef import Containers diff --git a/aiotieba/api/get_selfinfo_initNickname/_classdef.py b/aiotieba/api/get_selfinfo_initNickname/_classdef.py index d69eefac..f0b3b85e 100644 --- a/aiotieba/api/get_selfinfo_initNickname/_classdef.py +++ b/aiotieba/api/get_selfinfo_initNickname/_classdef.py @@ -1,8 +1,8 @@ from __future__ import annotations import dataclasses as dcs +from collections.abc import Mapping from functools import cached_property -from typing import Mapping @dcs.dataclass diff --git a/aiotieba/api/get_selfinfo_moindex/_classdef.py b/aiotieba/api/get_selfinfo_moindex/_classdef.py index 0d9e6596..50ef73b9 100644 --- a/aiotieba/api/get_selfinfo_moindex/_classdef.py +++ b/aiotieba/api/get_selfinfo_moindex/_classdef.py @@ -1,8 +1,8 @@ from __future__ import annotations import dataclasses as dcs +from collections.abc import Mapping from functools import cached_property -from typing import Mapping from ...enums import Gender diff --git a/aiotieba/api/get_statistics/_classdef.py b/aiotieba/api/get_statistics/_classdef.py index e333fbb2..4b1a6caa 100644 --- a/aiotieba/api/get_statistics/_classdef.py +++ b/aiotieba/api/get_statistics/_classdef.py @@ -1,7 +1,7 @@ from __future__ import annotations import dataclasses as dcs -from typing import Sequence +from collections.abc import Sequence @dcs.dataclass diff --git a/aiotieba/api/get_uinfo_getUserInfo_web/_classdef.py b/aiotieba/api/get_uinfo_getUserInfo_web/_classdef.py index d1c84121..58dfd07c 100644 --- a/aiotieba/api/get_uinfo_getUserInfo_web/_classdef.py +++ b/aiotieba/api/get_uinfo_getUserInfo_web/_classdef.py @@ -1,8 +1,8 @@ from __future__ import annotations import dataclasses as dcs +from collections.abc import Mapping from functools import cached_property -from typing import Mapping from ...exception import TbErrorExt diff --git a/aiotieba/api/get_uinfo_panel/_classdef.py b/aiotieba/api/get_uinfo_panel/_classdef.py index b394526d..cfbcff0b 100644 --- a/aiotieba/api/get_uinfo_panel/_classdef.py +++ b/aiotieba/api/get_uinfo_panel/_classdef.py @@ -1,17 +1,16 @@ from __future__ import annotations import dataclasses as dcs +from collections.abc import Mapping from functools import cached_property -from typing import Mapping from ...enums import Gender from ...exception import TbErrorExt -from ...helper import removesuffix def _tbnum2int(tb_num: str) -> int: if isinstance(tb_num, str): - return int(float(removesuffix(tb_num, '万')) * 1e4) + return int(float(tb_num.removesuffix('万')) * 1e4) else: return tb_num diff --git a/aiotieba/api/get_uinfo_user_json/_classdef.py b/aiotieba/api/get_uinfo_user_json/_classdef.py index ac710312..4e8516aa 100644 --- a/aiotieba/api/get_uinfo_user_json/_classdef.py +++ b/aiotieba/api/get_uinfo_user_json/_classdef.py @@ -1,7 +1,7 @@ from __future__ import annotations import dataclasses as dcs -from typing import Mapping +from collections.abc import Mapping from ...exception import TbErrorExt diff --git a/aiotieba/api/get_unblock_appeals/_classdef.py b/aiotieba/api/get_unblock_appeals/_classdef.py index 11f44ddc..8fd0dee3 100644 --- a/aiotieba/api/get_unblock_appeals/_classdef.py +++ b/aiotieba/api/get_unblock_appeals/_classdef.py @@ -1,7 +1,7 @@ from __future__ import annotations import dataclasses as dcs -from typing import Mapping +from collections.abc import Mapping from ...exception import TbErrorExt from .._classdef import Containers diff --git a/aiotieba/api/login/_classdef.py b/aiotieba/api/login/_classdef.py index fb18b75e..29d1b01a 100644 --- a/aiotieba/api/login/_classdef.py +++ b/aiotieba/api/login/_classdef.py @@ -1,7 +1,7 @@ from __future__ import annotations import dataclasses as dcs -from typing import Mapping +from collections.abc import Mapping @dcs.dataclass diff --git a/aiotieba/api/search_exact/_classdef.py b/aiotieba/api/search_exact/_classdef.py index 009eb6d1..c6eddbb5 100644 --- a/aiotieba/api/search_exact/_classdef.py +++ b/aiotieba/api/search_exact/_classdef.py @@ -1,7 +1,7 @@ from __future__ import annotations import dataclasses as dcs -from typing import Mapping +from collections.abc import Mapping from ...exception import TbErrorExt from .._classdef import Containers diff --git a/aiotieba/const.py b/aiotieba/const.py index 03263019..b5ddbf63 100644 --- a/aiotieba/const.py +++ b/aiotieba/const.py @@ -1,4 +1,4 @@ -MAIN_VERSION = "12.66.1.0" +MAIN_VERSION = "12.66.1.1" POST_VERSION = "12.35.1.0" APP_SECURE_SCHEME = "https" diff --git a/aiotieba/core/account.py b/aiotieba/core/account.py index 7b8a8b02..27ea5fbc 100644 --- a/aiotieba/core/account.py +++ b/aiotieba/core/account.py @@ -1,10 +1,11 @@ from __future__ import annotations +import random + from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC -from ..helper import randbytes_nosec from ..helper.crypto import c3_aid, cuid_galaxy2 @@ -180,7 +181,7 @@ def android_id(self) -> str: """ if self._android_id is None: - self._android_id = randbytes_nosec(8).hex() + self._android_id = random.randbytes(8).hex() return self._android_id @android_id.setter @@ -380,7 +381,7 @@ def aes_ecb_sec_key(self) -> bytes: """ if self._aes_ecb_sec_key is None: - self._aes_ecb_sec_key = randbytes_nosec(31) + self._aes_ecb_sec_key = random.randbytes(31) return self._aes_ecb_sec_key @aes_ecb_sec_key.setter @@ -417,7 +418,7 @@ def aes_cbc_sec_key(self) -> bytes: """ if self._aes_cbc_sec_key is None: - self._aes_cbc_sec_key = randbytes_nosec(16) + self._aes_cbc_sec_key = random.randbytes(16) return self._aes_cbc_sec_key @aes_ecb_sec_key.setter diff --git a/aiotieba/core/websocket.py b/aiotieba/core/websocket.py index 61513138..7bd3fa93 100644 --- a/aiotieba/core/websocket.py +++ b/aiotieba/core/websocket.py @@ -4,9 +4,11 @@ import binascii import dataclasses as dcs import gzip +import random import time import weakref -from typing import Awaitable, Callable +from collections.abc import Awaitable +from typing import Callable import aiohttp import yarl @@ -15,7 +17,7 @@ from ..enums import WsStatus from ..exception import HTTPStatusError -from ..helper import randbytes_nosec, timeout +from ..helper import timeout from .account import Account from .net import NetCore @@ -306,7 +308,7 @@ async def connect(self) -> None: from aiohttp import hdrs ws_url = yarl.URL.build(scheme="ws", host="im.tieba.baidu.com", port=8000) - sec_key_bytes = binascii.b2a_base64(randbytes_nosec(16), newline=False) + sec_key_bytes = binascii.b2a_base64(random.randbytes(16), newline=False) headers = { hdrs.UPGRADE: "websocket", hdrs.CONNECTION: "upgrade", diff --git a/aiotieba/helper/__init__.py b/aiotieba/helper/__init__.py index 8d7acad6..25d11028 100644 --- a/aiotieba/helper/__init__.py +++ b/aiotieba/helper/__init__.py @@ -7,8 +7,5 @@ jsonlib, pack_json, parse_json, - randbytes_nosec, - removeprefix, - removesuffix, timeout, ) diff --git a/aiotieba/helper/crypto/include/tbcrypto/pywrap.h b/aiotieba/helper/crypto/include/tbcrypto/pywrap.h index 7518799c..189ab2ad 100644 --- a/aiotieba/helper/crypto/include/tbcrypto/pywrap.h +++ b/aiotieba/helper/crypto/include/tbcrypto/pywrap.h @@ -3,15 +3,15 @@ #define PY_SSIZE_T_CLEAN // use Py_ssize_t instead of int #ifdef TBC_PYTHON_DEBUG -#include +# include #else -#ifdef _DEBUG -#undef _DEBUG // use these steps to avoid linking with python_d.lib -#define __TBC_RESTORE_DEBUG -#endif -#include -#ifdef __TBC_RESTORE_DEBUG -#define _DEBUG -#undef __TBC_RESTORE_DEBUG -#endif +# ifdef _DEBUG +# undef _DEBUG // use these steps to avoid linking with python_d.lib +# define __TBC_RESTORE_DEBUG +# endif +# include +# ifdef __TBC_RESTORE_DEBUG +# define _DEBUG +# undef __TBC_RESTORE_DEBUG +# endif #endif diff --git a/aiotieba/helper/crypto/src/tbcrypto/lib.c b/aiotieba/helper/crypto/src/tbcrypto/lib.c index 82ccf5f6..f2285ddd 100644 --- a/aiotieba/helper/crypto/src/tbcrypto/lib.c +++ b/aiotieba/helper/crypto/src/tbcrypto/lib.c @@ -91,4 +91,16 @@ static PyMethodDef crypto_methods[] = { static PyModuleDef crypto_module = {PyModuleDef_HEAD_INIT, "crypto", NULL, -1, crypto_methods}; -PyMODINIT_FUNC PyInit_crypto(void) { return PyModule_Create(&crypto_module); } +PyMODINIT_FUNC PyInit_crypto(void) +{ + PyObject* mod = PyModule_Create(&crypto_module); + if (mod == NULL) { + return NULL; + } + +#ifdef Py_GIL_DISABLED + PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED); +#endif + + return mod; +} diff --git a/aiotieba/helper/utils.py b/aiotieba/helper/utils.py index 6006a731..ad51d234 100644 --- a/aiotieba/helper/utils.py +++ b/aiotieba/helper/utils.py @@ -7,6 +7,8 @@ from datetime import datetime from typing import Any, Callable +from ..logging import get_logger + if sys.version_info >= (3, 11): async_timeout = asyncio else: @@ -27,91 +29,6 @@ def pack_json(obj: Any) -> str: parse_json = jsonlib.loads -if sys.version_info >= (3, 9): - import random - - randbytes_nosec = random.randbytes - -else: - import secrets - - randbytes_nosec = secrets.token_bytes - - -from ..logging import get_logger - -if sys.version_info >= (3, 9): - - def removeprefix(s: str, prefix: str) -> str: - """ - 移除字符串前缀 - - Args: - s (str): 待移除前缀的字符串 - prefix (str): 待移除的前缀 - - Returns: - str: 移除前缀后的字符串 - """ - - return s.removeprefix(prefix) - - def removesuffix(s: str, suffix: str) -> str: - """ - 移除字符串前缀 - - Args: - s (str): 待移除前缀的字符串 - suffix (str): 待移除的前缀 - - Returns: - str: 移除前缀后的字符串 - """ - - return s.removesuffix(suffix) - -else: - - def removeprefix(s: str, prefix: str) -> str: - """ - 移除字符串前缀 - - Args: - s (str): 待移除前缀的字符串 - prefix (str): 待移除的前缀 - - Returns: - str: 移除前缀后的字符串 - - Note: - 该函数不会拷贝字符串 - """ - - if s.startswith(prefix): - return s[len(prefix) :] - return s - - def removesuffix(s: str, suffix: str) -> str: - """ - 移除字符串后缀 - 该函数将不会拷贝字符串 - - Args: - s (str): 待移除前缀的字符串 - suffix (str): 待移除的前缀 - - Returns: - str: 移除前缀后的字符串 - - Note: - 该函数不会拷贝字符串 - """ - - if s.endswith(suffix): - return s[: len(suffix)] - return s - - def is_portrait(portrait: Any) -> bool: """ 简单判断输入是否符合portrait格式 diff --git a/pyproject.toml b/pyproject.toml index 8b15edac..22a4ae4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "aiotieba" -version = "4.4.7" +version = "4.4.8" description = "Asynchronous I/O Client for Baidu Tieba" authors = [{ name = "Starry-OvO", email = "starry.qvq@gmail.com" }] urls = { Repository = "https://github.com/Starry-OvO/aiotieba/", Documentation = "https://aiotieba.cc/" } @@ -12,7 +12,6 @@ classifiers = [ "Intended Audience :: Developers", "License :: OSI Approved :: The Unlicense (Unlicense)", "Operating System :: OS Independent", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -20,23 +19,20 @@ classifiers = [ "Programming Language :: Python :: 3.13", "Topic :: Internet :: WWW/HTTP :: Session", ] -requires-python = ">=3.8,<3.14" +requires-python = ">=3.9,<3.14" dependencies = [ - "aiohttp>=3.10.0,<3.11;python_version=='3.8'", "aiohttp>=3.10.0,<4;python_version>='3.9' and python_version<'3.12'", "aiohttp>=3.10.0,<4;python_version>='3.12'", - "beautifulsoup4>=4.4.1,<4.13;python_version=='3.8'", "beautifulsoup4>=4.5.2,<5;python_version=='3.9'", "beautifulsoup4>=4.7.1,<5;python_version>='3.10'", - "lxml>=4.4.1,<5.3;python_version=='3.8'", "lxml>=4.6.0,<6;python_version=='3.9'", "lxml>=4.6.4,<6;python_version=='3.10'", "lxml>=4.9.2,<6;python_version=='3.11'", "lxml>=4.9.3,<6;python_version>='3.12'", "protobuf>=4.21.0,<6", - "cryptography>=35.0.0,<41;python_version>='3.8' and python_version<'3.12'", + "cryptography>=35.0.0,<41;python_version>='3.9' and python_version<'3.12'", "cryptography>=35.0.0,<44;python_version>='3.12'", - "cffi>=1.17.0rc1,<2;python_version>='3.13b1'", + "cffi>=1.17.0rc1,<2;python_version>='3.13rc1'", "async-timeout>=4.0,<5;python_version<'3.11'", "StrEnum>=0.4.0,<0.5;python_version<'3.11'", ] @@ -47,12 +43,10 @@ img = [ "opencv-contrib-python>=4.6.0.66,<5;sys_platform!='linux'", ] speedup = [ - "orjson>=2.0.11,<3.11;python_version=='3.8'", "orjson>=2.2.0,<4;python_version=='3.9'", "orjson>=3.4.7,<4;python_version=='3.10'", "orjson>=3.7.10,<4;python_version=='3.11'", "orjson>=3.9.10,<4;python_version>='3.12'", - "uvloop>=0.14.0,<0.20.0;python_version=='3.8' and sys_platform!='win32'", "uvloop>=0.15.0,<1.0;python_version=='3.9' and sys_platform!='win32'", "uvloop>=0.16.0,<1.0;python_version=='3.10' and sys_platform!='win32'", "uvloop>=0.17.0,<1.0;python_version=='3.11' and sys_platform!='win32'", @@ -60,15 +54,15 @@ speedup = [ ] [build-system] -requires = ["scikit-build-core<0.10,>=0.8"] +requires = ["scikit-build-core<0.11,>=0.8"] build-backend = "scikit_build_core.build" [tool.rye] managed = true dev-dependencies = [ "aiotieba[speedup]", - "pytest==8.2.2", - "pytest-asyncio==0.23.7", + "pytest==8.3.2", + "pytest-asyncio==0.23.8", "pytest-rerunfailures==14.0", "mkdocs-material", "mkdocstrings[python]", @@ -83,12 +77,13 @@ path = "aiotieba/__version__.py" template = '''__version__ = "${version}"''' [tool.cibuildwheel] -build = "cp38-* cp39-* cp310-* cp311-* cp312-* pp38-* pp39-* pp310-*" +build = "cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* cp313t-* pp38-* pp39-* pp310-*" +free-threaded-support = true skip = "*-win32 *_i686 *_s390x *_ppc64le" [tool.ruff] line-length = 120 -target-version = "py38" +target-version = "py39" preview = true [tool.ruff.format]