From a6777f5d26d2706ae2d3719ade7a7d17b0cb2f48 Mon Sep 17 00:00:00 2001 From: FHU-yezi Date: Mon, 2 Dec 2024 14:52:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=B1=E4=BA=8E=20m?= =?UTF-8?q?sgspec=20=E8=BF=90=E8=A1=8C=E6=97=B6=E7=B1=BB=E5=9E=8B=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E5=AF=BC=E8=87=B4=E7=9A=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/jianshu/article_earning_ranking_record.py | 8 ++------ models/jianshu/user.py | 5 +---- models/jianshu/user_assets_ranking_record.py | 8 ++------ models/jpep/credit_record.py | 14 +++++--------- models/jpep/ftn_order.py | 8 ++------ models/jpep/user.py | 11 ++++------- pyproject.toml | 5 ++--- requirements-dev.txt | 4 ++-- requirements.txt | 2 +- uv.lock | 14 +++++++------- 10 files changed, 28 insertions(+), 51 deletions(-) diff --git a/models/jianshu/article_earning_ranking_record.py b/models/jianshu/article_earning_ranking_record.py index 6bdc552..7f1b5a0 100644 --- a/models/jianshu/article_earning_ranking_record.py +++ b/models/jianshu/article_earning_ranking_record.py @@ -1,16 +1,12 @@ from __future__ import annotations -from typing import TYPE_CHECKING +from datetime import date from sshared.postgres import Table +from sshared.strict_struct import NonEmptyStr, PositiveFloat, PositiveInt from utils.db import jianshu_pool -if TYPE_CHECKING: - from datetime import date - - from sshared.strict_struct import NonEmptyStr, PositiveFloat, PositiveInt - class ArticleEarningRankingRecord(Table, frozen=True): date: date diff --git a/models/jianshu/user.py b/models/jianshu/user.py index 503dea6..5e3c7ac 100644 --- a/models/jianshu/user.py +++ b/models/jianshu/user.py @@ -2,15 +2,12 @@ from datetime import datetime from enum import Enum -from typing import TYPE_CHECKING from sshared.postgres import Table +from sshared.strict_struct import NonEmptyStr, PositiveInt from utils.db import jianshu_pool -if TYPE_CHECKING: - from sshared.strict_struct import NonEmptyStr, PositiveInt - class StatusEnum(Enum): NORMAL = "NORMAL" diff --git a/models/jianshu/user_assets_ranking_record.py b/models/jianshu/user_assets_ranking_record.py index 6c9f9ad..e866bcd 100644 --- a/models/jianshu/user_assets_ranking_record.py +++ b/models/jianshu/user_assets_ranking_record.py @@ -1,16 +1,12 @@ from __future__ import annotations -from typing import TYPE_CHECKING +from datetime import date from sshared.postgres import Table +from sshared.strict_struct import NonEmptyStr, NonNegativeFloat, PositiveInt from utils.db import jianshu_pool -if TYPE_CHECKING: - from datetime import date - - from sshared.strict_struct import NonEmptyStr, NonNegativeFloat, PositiveInt - class UserAssetsRankingRecord(Table, frozen=True): date: date diff --git a/models/jpep/credit_record.py b/models/jpep/credit_record.py index b814435..f3922b8 100644 --- a/models/jpep/credit_record.py +++ b/models/jpep/credit_record.py @@ -1,19 +1,15 @@ from __future__ import annotations -from typing import TYPE_CHECKING +from datetime import datetime from sshared.postgres import Table +from sshared.strict_struct import ( + NonNegativeInt, + PositiveInt, +) from utils.db import jpep_pool -if TYPE_CHECKING: - from datetime import datetime - - from sshared.strict_struct import ( - NonNegativeInt, - PositiveInt, - ) - class CreditRecord(Table, frozen=True): time: datetime diff --git a/models/jpep/ftn_order.py b/models/jpep/ftn_order.py index 1777239..945fd80 100644 --- a/models/jpep/ftn_order.py +++ b/models/jpep/ftn_order.py @@ -1,17 +1,13 @@ from __future__ import annotations +from datetime import datetime from enum import Enum -from typing import TYPE_CHECKING from sshared.postgres import Table +from sshared.strict_struct import PositiveInt from utils.db import jpep_pool -if TYPE_CHECKING: - from datetime import datetime - - from sshared.strict_struct import PositiveInt - class TypeEnum(Enum): BUY = "BUY" diff --git a/models/jpep/user.py b/models/jpep/user.py index 236d2d8..ab22525 100644 --- a/models/jpep/user.py +++ b/models/jpep/user.py @@ -1,18 +1,15 @@ from __future__ import annotations from datetime import datetime -from typing import TYPE_CHECKING from sshared.postgres import Table +from sshared.strict_struct import ( + NonEmptyStr, + PositiveInt, +) from utils.db import jpep_pool -if TYPE_CHECKING: - from sshared.strict_struct import ( - NonEmptyStr, - PositiveInt, - ) - class User(Table, frozen=True): id: PositiveInt diff --git a/pyproject.toml b/pyproject.toml index 839b9f0..9d83c65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,10 +7,10 @@ license = { file = "LICENSE" } authors = [{ name = "FHU-yezi", email = "yehaowei20060411@qq.com" }] requires-python = ">=3.9" dependencies = [ + "httpx<0.28.0", "jkit>=3.0.0a16", "prefect<3.0.0", - "psycopg[binary]>=3.2.0", - "sshared[config,postgres]>=0.18.0", + "sshared[config, postgres]>=0.19.0", ] [tool.uv] @@ -46,7 +46,6 @@ lint.select = [ "SIM", "SLF", "T20", - "TC", "TID", "TRY", "UP", diff --git a/requirements-dev.txt b/requirements-dev.txt index c516640..e7b9f00 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -88,12 +88,12 @@ rpds-py==0.21.0 rsa==4.9 ruamel-yaml==0.18.6 ruamel-yaml-clib==0.2.12 ; python_full_version < '3.13' and platform_python_implementation == 'CPython' -ruff==0.7.3 +ruff==0.8.0 shellingham==1.5.4 six==1.16.0 sniffio==1.3.1 sqlalchemy==2.0.35 -sshared==0.18.0 +sshared==0.19.1 text-unidecode==1.3 time-machine==2.16.0 ; python_full_version >= '3.12' and implementation_name != 'pypy' toml==0.10.2 diff --git a/requirements.txt b/requirements.txt index 84c3c06..f4110df 100644 --- a/requirements.txt +++ b/requirements.txt @@ -90,7 +90,7 @@ shellingham==1.5.4 six==1.16.0 sniffio==1.3.1 sqlalchemy==2.0.35 -sshared==0.18.0 +sshared==0.19.1 text-unidecode==1.3 time-machine==2.16.0 ; python_full_version >= '3.12' and implementation_name != 'pypy' toml==0.10.2 diff --git a/uv.lock b/uv.lock index 52d2a35..11dda6b 100644 --- a/uv.lock +++ b/uv.lock @@ -710,9 +710,9 @@ name = "jfetcher" version = "3.10.0" source = { virtual = "." } dependencies = [ + { name = "httpx" }, { name = "jkit" }, { name = "prefect" }, - { name = "psycopg", extra = ["binary"] }, { name = "sshared", extra = ["config", "postgres"] }, ] @@ -724,10 +724,10 @@ dev = [ [package.metadata] requires-dist = [ + { name = "httpx", specifier = "<0.28.0" }, { name = "jkit", specifier = ">=3.0.0a16" }, { name = "prefect", specifier = "<3.0.0" }, - { name = "psycopg", extras = ["binary"], specifier = ">=3.2.0" }, - { name = "sshared", extras = ["config", "postgres"], specifier = ">=0.18.0" }, + { name = "sshared", extras = ["config", "postgres"], specifier = ">=0.19.0" }, ] [package.metadata.requires-dev] @@ -2031,14 +2031,14 @@ asyncio = [ [[package]] name = "sshared" -version = "0.18.0" +version = "0.19.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "msgspec" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/bd/0a/f3c1dd9d53ec18b27638b5e5f0a6abce2875d9ecfea14ebf8675c1ddf137/sshared-0.18.0.tar.gz", hash = "sha256:0c5d1e5cc12e349b1495630f9386ce470f3432959da6870cdc4690c0dc14b4dd", size = 17696 } +sdist = { url = "https://files.pythonhosted.org/packages/7c/c4/0c95970998f74029a18b659701efd18ddecc142ddf616b3251f7e5c94e85/sshared-0.19.1.tar.gz", hash = "sha256:9bd3d27d4ab693682527a36b7c494f137ca1df76a1e3bfa011fdc9f05dff4a5a", size = 15212 } wheels = [ - { url = "https://files.pythonhosted.org/packages/ef/48/2e2de70c0a3d97416ebb01715d0efac7dc84630ec172c4e41de9421d654d/sshared-0.18.0-py3-none-any.whl", hash = "sha256:cc413cd8959baafc527ece31c20cd61ebfc719325d8899eb54ef319c3b6ad328", size = 26155 }, + { url = "https://files.pythonhosted.org/packages/57/61/3fdb4250993bfd58c551c2f5561e64abd78ee4ffe9ae6a60961804297202/sshared-0.19.1-py3-none-any.whl", hash = "sha256:2aded4f465345df8a335a4c3cb8055b43df8d83001d5263d9cd80514679be103", size = 21835 }, ] [package.optional-dependencies] @@ -2046,7 +2046,7 @@ config = [ { name = "tomli" }, ] postgres = [ - { name = "psycopg" }, + { name = "psycopg", extra = ["binary"] }, ] [[package]]