mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-01-26 11:19:53 +00:00
stype: fix ruff UP007 rule, typings
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user