diff --git a/adetailer/args.py b/adetailer/args.py index 130bdea..b0f311e 100644 --- a/adetailer/args.py +++ b/adetailer/args.py @@ -5,7 +5,6 @@ from dataclasses import dataclass from functools import cached_property, partial from typing import Any, Literal, NamedTuple, Optional -import pydantic from pydantic import ( BaseModel, Extra, @@ -14,7 +13,6 @@ from pydantic import ( PositiveInt, confloat, conint, - constr, validator, ) @@ -34,11 +32,11 @@ class Arg(NamedTuple): class ArgsList(UserList): @cached_property - def attrs(self) -> tuple[str]: + def attrs(self) -> tuple[str, ...]: return tuple(attr for attr, _ in self) @cached_property - def names(self) -> tuple[str]: + def names(self) -> tuple[str, ...]: return tuple(name for _, name in self) diff --git a/adetailer/common.py b/adetailer/common.py index 9b69782..7d0460d 100644 --- a/adetailer/common.py +++ b/adetailer/common.py @@ -3,7 +3,7 @@ from __future__ import annotations from collections import OrderedDict from dataclasses import dataclass, field from pathlib import Path -from typing import Optional, Union +from typing import Optional from huggingface_hub import hf_hub_download from PIL import Image, ImageDraw diff --git a/pyproject.toml b/pyproject.toml index c900464..90ca5dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,10 @@ select = [ "UP", "W", ] -ignore = ["B008", "B905", "E501", "F401", "UP007"] +ignore = ["B008", "B905", "E501", "F401"] [tool.ruff.lint.isort] known-first-party = ["launch", "modules"] + +[tool.ruff.lint.pyupgrade] +keep-runtime-typing = true