| @@ -1,11 +1,11 @@ | |||||
| repos: | repos: | ||||
| - repo: https://github.com/astral-sh/ruff-pre-commit | - repo: https://github.com/astral-sh/ruff-pre-commit | ||||
| rev: v0.6.8 | |||||
| rev: v0.15.12 | |||||
| hooks: | hooks: | ||||
| - id: ruff | |||||
| - id: ruff-check | |||||
| args: [--fix] | args: [--fix] | ||||
| - id: ruff-format | - id: ruff-format | ||||
| - repo: https://github.com/RobertCraigie/pyright-python | - repo: https://github.com/RobertCraigie/pyright-python | ||||
| rev: v1.1.383 | |||||
| rev: v1.1.409 | |||||
| hooks: | hooks: | ||||
| - id: pyright | - id: pyright | ||||
| @@ -6,10 +6,10 @@ authors = [ | |||||
| ] | ] | ||||
| description = "A copyright violation detector web tool for Wikipedia articles" | description = "A copyright violation detector web tool for Wikipedia articles" | ||||
| readme = "README.md" | readme = "README.md" | ||||
| requires-python = ">=3.11" | |||||
| requires-python = ">=3.13" | |||||
| dependencies = [ | dependencies = [ | ||||
| "earwigbot[sql,copyvios] >= 0.4", | "earwigbot[sql,copyvios] >= 0.4", | ||||
| "mwparserfromhell >= 0.6", | |||||
| "mwparserfromhell >= 0.7", | |||||
| "flask >= 3.0", | "flask >= 3.0", | ||||
| "requests >= 2.32.3", | "requests >= 2.32.3", | ||||
| "pydantic >= 2.9.2", | "pydantic >= 2.9.2", | ||||
| @@ -26,12 +26,12 @@ requires = ["setuptools>=61.0"] | |||||
| build-backend = "setuptools.build_meta" | build-backend = "setuptools.build_meta" | ||||
| [tool.pyright] | [tool.pyright] | ||||
| pythonVersion = "3.11" | |||||
| pythonVersion = "3.13" | |||||
| venvPath = "." | venvPath = "." | ||||
| venv = "venv" | venv = "venv" | ||||
| [tool.ruff] | [tool.ruff] | ||||
| target-version = "py311" | |||||
| target-version = "py313" | |||||
| [tool.ruff.lint] | [tool.ruff.lint] | ||||
| select = ["E4", "E7", "E9", "F", "I", "UP"] | select = ["E4", "E7", "E9", "F", "I", "UP"] | ||||
| @@ -11,7 +11,6 @@ import datetime | |||||
| import os | import os | ||||
| import sqlite3 | import sqlite3 | ||||
| import urllib.parse | import urllib.parse | ||||
| from typing import TypeVar | |||||
| import pymysql | import pymysql | ||||
| from flask import g, request | from flask import g, request | ||||
| @@ -20,8 +19,6 @@ from . import app | |||||
| from .cache import cache | from .cache import cache | ||||
| from .query import CheckQuery | from .query import CheckQuery | ||||
| T = TypeVar("T") | |||||
| def get_sql_error() -> type[Exception]: | def get_sql_error() -> type[Exception]: | ||||
| match cache.engine.dialect.name: | match cache.engine.dialect.name: | ||||
| @@ -33,7 +30,7 @@ def get_sql_error() -> type[Exception]: | |||||
| raise ValueError(f"Unknown engine: {dialect}") | raise ValueError(f"Unknown engine: {dialect}") | ||||
| def sql_dialect(mysql: T, sqlite: T) -> T: | |||||
| def sql_dialect[T](mysql: T, sqlite: T) -> T: | |||||
| match cache.engine.dialect.name: | match cache.engine.dialect.name: | ||||
| case "mysql": | case "mysql": | ||||
| return mysql | return mysql | ||||