mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-05-01 11:41:41 +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 functools import cached_property, partial
|
||||||
from typing import Any, Literal, NamedTuple, Optional
|
from typing import Any, Literal, NamedTuple, Optional
|
||||||
|
|
||||||
import pydantic
|
|
||||||
from pydantic import (
|
from pydantic import (
|
||||||
BaseModel,
|
BaseModel,
|
||||||
Extra,
|
Extra,
|
||||||
@@ -14,7 +13,6 @@ from pydantic import (
|
|||||||
PositiveInt,
|
PositiveInt,
|
||||||
confloat,
|
confloat,
|
||||||
conint,
|
conint,
|
||||||
constr,
|
|
||||||
validator,
|
validator,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -34,11 +32,11 @@ class Arg(NamedTuple):
|
|||||||
|
|
||||||
class ArgsList(UserList):
|
class ArgsList(UserList):
|
||||||
@cached_property
|
@cached_property
|
||||||
def attrs(self) -> tuple[str]:
|
def attrs(self) -> tuple[str, ...]:
|
||||||
return tuple(attr for attr, _ in self)
|
return tuple(attr for attr, _ in self)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def names(self) -> tuple[str]:
|
def names(self) -> tuple[str, ...]:
|
||||||
return tuple(name for _, name in self)
|
return tuple(name for _, name in self)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional, Union
|
from typing import Optional
|
||||||
|
|
||||||
from huggingface_hub import hf_hub_download
|
from huggingface_hub import hf_hub_download
|
||||||
from PIL import Image, ImageDraw
|
from PIL import Image, ImageDraw
|
||||||
|
|||||||
@@ -36,7 +36,10 @@ select = [
|
|||||||
"UP",
|
"UP",
|
||||||
"W",
|
"W",
|
||||||
]
|
]
|
||||||
ignore = ["B008", "B905", "E501", "F401", "UP007"]
|
ignore = ["B008", "B905", "E501", "F401"]
|
||||||
|
|
||||||
[tool.ruff.lint.isort]
|
[tool.ruff.lint.isort]
|
||||||
known-first-party = ["launch", "modules"]
|
known-first-party = ["launch", "modules"]
|
||||||
|
|
||||||
|
[tool.ruff.lint.pyupgrade]
|
||||||
|
keep-runtime-typing = true
|
||||||
|
|||||||
Reference in New Issue
Block a user