From df9a61c9921006819acfa44dc62d22e4307b3a9e Mon Sep 17 00:00:00 2001 From: Trim21 Date: Thu, 24 Oct 2024 01:34:14 +0800 Subject: [PATCH] fix types --- Taskfile.yaml | 3 +-- gql/app.py | 4 ++-- poetry.lock | 19 ++++++++++++++++--- pyproject.toml | 3 ++- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 26fef19..548d135 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -4,7 +4,6 @@ dotenv: [ .env ] tasks: default: - silent: true cmds: - ruff check . - black . @@ -24,7 +23,7 @@ tasks: --input-file-type graphql --output gql/model.py --output-model-type dataclasses.dataclass -# --use-standard-collections + # --use-standard-collections gen-grpc: desc: generate grpc python files diff --git a/gql/app.py b/gql/app.py index fc65caf..ca29961 100644 --- a/gql/app.py +++ b/gql/app.py @@ -1,12 +1,12 @@ from pathlib import Path from typing import Any, Iterator +import php_serialize from ariadne import ObjectType, QueryType, gql from ariadne.asgi import GraphQL from ariadne.contrib.federation import make_federated_schema from sqlalchemy import select -from chii.compat import phpseralize from chii.config import config from chii.const import CollectionType from chii.db import sa @@ -40,7 +40,7 @@ async def timeline_collection(*_: Any) -> list[CollectTimeline]: result = [] for row in rows: - meme = phpseralize.loads(row.memo.encode()) + meme = php_serialize.loads(row.memo.encode()) if not row.batch: result.append( CollectTimeline( diff --git a/poetry.lock b/poetry.lock index 8d43edc..7cc69f0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -278,8 +278,8 @@ jinja2 = ">=2.10.1,<4.0" packaging = "*" pydantic = [ {version = ">=1.10.0,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.12\" and python_version < \"4.0\""}, - {version = ">=1.10.0,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, {version = ">=1.9.0,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.10\" and python_version < \"3.11\""}, + {version = ">=1.10.0,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, ] pyyaml = ">=6.0.1" toml = {version = ">=0.10.0,<1.0.0", markers = "python_version < \"3.11\""} @@ -471,13 +471,26 @@ files = [ {file = "greenlet-3.1.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d0028e725ee18175c6e422797c407874da24381ce0690d6b9396c204c7f7276e"}, {file = "greenlet-3.1.1-cp39-cp39-win32.whl", hash = "sha256:5e06afd14cbaf9e00899fae69b24a32f2196c19de08fcb9f4779dd4f004e5e7c"}, {file = "greenlet-3.1.1-cp39-cp39-win_amd64.whl", hash = "sha256:3319aa75e0e0639bc15ff54ca327e8dc7a6fe404003496e3c6925cd3142e0e22"}, - {file = "greenlet-3.1.1.tar.gz", hash = "sha256:4ce3ac6cdb6adf7946475d7ef31777c26d94bccc377e070a7986bd2d5c515467"}, ] [package.extras] docs = ["Sphinx", "furo"] test = ["objgraph", "psutil"] +[[package]] +name = "grpc-stubs" +version = "1.53.0.5" +description = "Mypy stubs for gRPC" +optional = false +python-versions = ">=3.6" +files = [ + {file = "grpc-stubs-1.53.0.5.tar.gz", hash = "sha256:3e1b642775cbc3e0c6332cfcedfccb022176db87e518757bef3a1241397be406"}, + {file = "grpc_stubs-1.53.0.5-py3-none-any.whl", hash = "sha256:04183fb65a1b166a1febb9627e3d9647d3926ccc2dfe049fe7b6af243428dbe1"}, +] + +[package.dependencies] +grpcio = "*" + [[package]] name = "grpcio" version = "1.66.2" @@ -1900,4 +1913,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "073c666a5333ab8cbf8557fd2f1ae510c1dda69bb4d6776c5d311eb79fac6f80" +content-hash = "7d63cbed8ff1c6f07abe5d4e68dd911f91e46659c0d52e67e3644ccc3da799f4" diff --git a/pyproject.toml b/pyproject.toml index 9a0f39c..c13d72f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,7 @@ pre-commit = "==4.0.0" mypy = "==1.11.2" types-protobuf = "^5.27.0.20240920" types-six = "^1.16.21.20240513" +grpc-stubs = "^1.53.0.5" [tool.poetry-plugin-bump] commit_msg = 'bump: v{version}' @@ -60,7 +61,7 @@ addopts = '-rav' env = ['D:TESTING=true', 'SQLALCHEMY_WARN_20=true'] [tool.mypy] -ignore_missing_imports = true +ignore_missing_imports = false warn_return_any = true warn_unused_configs = true show_error_codes = true