Skip to content

Commit

Permalink
Merge pull request #219 from Starry-OvO/develop
Browse files Browse the repository at this point in the history
Update 4.4.7
  • Loading branch information
lumina37 authored Aug 1, 2024
2 parents 4a2b343 + 7a0760a commit 1482098
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 27 deletions.
25 changes: 9 additions & 16 deletions .github/workflows/CI-beta.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
name: CI-beta

on:
push:
branches: [develop]
paths:
- "aiotieba/**"
- "tests/**"
- ".github/workflows/CI-beta.yml"
pull_request:
branches: [develop]
paths:
- "aiotieba/**"
- "tests/**"
- ".github/workflows/CI-beta.yml"
workflow_dispatch:

jobs:
Expand All @@ -35,17 +23,22 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip"

- name: Setup UV
uses: yezz123/setup-uv@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libxml2-dev libxslt1-dev
pip install --user .[speedup]
pip install --user pytest pytest-asyncio pytest-rerunfailures
uv venv
uv pip install .
uv pip install pytest pytest-asyncio pytest-rerunfailures
- name: Run tests
env:
TB_BDUSS: ${{ secrets.BDUSS }}
TB_STOKEN: ${{ secrets.STOKEN }}
run: pytest
run: |
source .venv/bin/activate
pytest
2 changes: 1 addition & 1 deletion aiotieba/api/get_posts/_classdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ def from_tbdata(data_proto: TypeMessage) -> Posts:
thread.fname = forum.fname

objs = [Post.from_tbdata(p) for p in data_proto.post_list if not p.chat_content.bot_uk]
users = {i: UserInfo_p.from_tbdata(p) for p in data_proto.user_list if (i := p.id)}
users = {p.id: UserInfo_p.from_tbdata(p) for p in data_proto.user_list}
for post in objs:
post.fid = forum.fid
post.fname = forum.fname
Expand Down
2 changes: 1 addition & 1 deletion aiotieba/api/get_threads/_classdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ def from_tbdata(data_proto: TypeMessage) -> Threads:
tab_map = {p.tab_name: p.tab_id for p in data_proto.nav_tab_info.tab}

objs = [Thread.from_tbdata(p) for p in data_proto.thread_list]
users = {i: UserInfo_t.from_tbdata(p) for p in data_proto.user_list if (i := p.id)}
users = {p.id: UserInfo_t.from_tbdata(p) for p in data_proto.user_list}
for thread in objs:
thread.fname = forum.fname
thread.fid = forum.fid
Expand Down
2 changes: 1 addition & 1 deletion aiotieba/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MAIN_VERSION = "12.64.1.1"
MAIN_VERSION = "12.66.1.0"
POST_VERSION = "12.35.1.0"

APP_SECURE_SCHEME = "https"
Expand Down
4 changes: 2 additions & 2 deletions aiotieba/core/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ def set_account(self, new_account: Account) -> None:
BDUSS_morsel = Morsel()
BDUSS_morsel.set('BDUSS', new_account.BDUSS, new_account.BDUSS)
BDUSS_morsel['domain'] = "baidu.com"
self.web.cookie_jar._cookies[("baidu.com", "/")]['BDUSS'] = BDUSS_morsel
self.web.cookie_jar._cookies[("baidu.com", "")]['BDUSS'] = BDUSS_morsel
STOKEN_morsel = Morsel()
STOKEN_morsel.set('STOKEN', new_account.STOKEN, new_account.STOKEN)
STOKEN_morsel['domain'] = "tieba.baidu.com"
self.web.cookie_jar._cookies[("tieba.baidu.com", "/")]['STOKEN'] = STOKEN_morsel
self.web.cookie_jar._cookies[("tieba.baidu.com", "")]['STOKEN'] = STOKEN_morsel

def pack_form_request(self, url: yarl.URL, data: list[tuple[str, str]]) -> aiohttp.ClientRequest:
"""
Expand Down
13 changes: 7 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "aiotieba"
version = "4.4.7a0"
version = "4.4.7"
description = "Asynchronous I/O Client for Baidu Tieba"
authors = [{ name = "Starry-OvO", email = "[email protected]" }]
urls = { Repository = "https://github.com/Starry-OvO/aiotieba/", Documentation = "https://aiotieba.cc/" }
Expand All @@ -17,13 +17,14 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Internet :: WWW/HTTP :: Session",
]
requires-python = ">=3.8,<3.14"
dependencies = [
"aiohttp>=3.8.4,<3.10;python_version=='3.8'",
"aiohttp>=3.8.4,<4;python_version>='3.9' and python_version<'3.12'",
"aiohttp>=3.9.0,<4;python_version>='3.12'",
"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'",
Expand All @@ -34,7 +35,8 @@ dependencies = [
"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,<43;python_version>='3.12'",
"cryptography>=35.0.0,<44;python_version>='3.12'",
"cffi>=1.17.0rc1,<2;python_version>='3.13b1'",
"async-timeout>=4.0,<5;python_version<'3.11'",
"StrEnum>=0.4.0,<0.5;python_version<'3.11'",
]
Expand All @@ -45,7 +47,6 @@ img = [
"opencv-contrib-python>=4.6.0.66,<5;sys_platform!='linux'",
]
speedup = [
"aiodns>=3.0.0,<4",
"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'",
Expand Down

0 comments on commit 1482098

Please sign in to comment.