chore(deps): update dependency ruff to ^0.1.0 (#2944)

* chore(deps): update dependency ruff to ^0.1.0

* fix breaking cfg change

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
renovate[bot] 2024-01-11 00:53:54 +00:00 committed by GitHub
parent 1d7fc0a945
commit ce929f2833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 28 additions and 29 deletions

View File

@ -53,7 +53,7 @@ class RepositoryRecipes(RepositoryGeneric[Recipe, RecipeModel]):
stmt = ( stmt = (
select(self.model) select(self.model)
.join(RecipeSettings) .join(RecipeSettings)
.filter(RecipeSettings.public == True) # noqa: 711 .filter(RecipeSettings.public == True) # noqa: E712
.order_by(order_attr.desc()) .order_by(order_attr.desc())
.offset(start) .offset(start)
.limit(limit) .limit(limit)
@ -63,7 +63,7 @@ class RepositoryRecipes(RepositoryGeneric[Recipe, RecipeModel]):
stmt = ( stmt = (
select(self.model) select(self.model)
.join(RecipeSettings) .join(RecipeSettings)
.filter(RecipeSettings.public == True) # noqa: 711 .filter(RecipeSettings.public == True) # noqa: E712
.offset(start) .offset(start)
.limit(limit) .limit(limit)
) )

View File

@ -34,7 +34,7 @@ class MealieCrudRoute(APIRoute):
with contextlib.suppress(JSONDecodeError): with contextlib.suppress(JSONDecodeError):
response = await original_route_handler(request) response = await original_route_handler(request)
response_body = json.loads(response.body) response_body = json.loads(response.body)
if type(response_body) == dict: if isinstance(response_body, dict):
if last_modified := response_body.get("updateAt"): if last_modified := response_body.get("updateAt"):
response.headers["last-modified"] = last_modified response.headers["last-modified"] = last_modified

View File

@ -39,7 +39,7 @@ class MealieAlphaMigrator(BaseMigrator):
with contextlib.suppress(KeyError): with contextlib.suppress(KeyError):
if "" in recipe["categories"]: if "" in recipe["categories"]:
recipe["categories"] = [cat for cat in recipe["categories"] if cat != ""] recipe["categories"] = [cat for cat in recipe["categories"] if cat != ""]
if type(recipe["extras"]) == list: if isinstance(recipe["extras"], list):
recipe["extras"] = {} recipe["extras"] = {}
recipe["comments"] = [] recipe["comments"] = []

View File

@ -23,8 +23,7 @@ def plantoeat_recipes(file: Path):
for name in Path(tmpdir).glob("**/[!.]*.csv"): for name in Path(tmpdir).glob("**/[!.]*.csv"):
with open(name, newline="") as csvfile: with open(name, newline="") as csvfile:
reader = csv.DictReader(csvfile) reader = csv.DictReader(csvfile)
for row in reader: yield from reader
yield row
def get_value_as_string_or_none(dictionary: dict, key: str): def get_value_as_string_or_none(dictionary: dict, key: str):

View File

@ -187,7 +187,7 @@ def import_data(lines):
token = unclump(token) token = unclump(token)
# turn B-NAME/123 back into "name" # turn B-NAME/123 back into "name"
tag, confidence = re.split(r"/", columns[-1], 1) tag, confidence = re.split(r"/", columns[-1], maxsplit=1)
tag = re.sub(r"^[BI]\-", "", tag).lower() # noqa: W605 - invalid dscape sequence tag = re.sub(r"^[BI]\-", "", tag).lower() # noqa: W605 - invalid dscape sequence
# ==================== # ====================

40
poetry.lock generated
View File

@ -2370,28 +2370,28 @@ pyasn1 = ">=0.1.3"
[[package]] [[package]]
name = "ruff" name = "ruff"
version = "0.0.265" version = "0.1.11"
description = "An extremely fast Python linter, written in Rust." description = "An extremely fast Python linter and code formatter, written in Rust."
optional = false optional = false
python-versions = ">=3.7" python-versions = ">=3.7"
files = [ files = [
{file = "ruff-0.0.265-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:30ddfe22de6ce4eb1260408f4480bbbce998f954dbf470228a21a9b2c45955e4"}, {file = "ruff-0.1.11-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:a7f772696b4cdc0a3b2e527fc3c7ccc41cdcb98f5c80fdd4f2b8c50eb1458196"},
{file = "ruff-0.0.265-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:a11bd0889e88d3342e7bc514554bb4461bf6cc30ec115821c2425cfaac0b1b6a"}, {file = "ruff-0.1.11-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:934832f6ed9b34a7d5feea58972635c2039c7a3b434fe5ba2ce015064cb6e955"},
{file = "ruff-0.0.265-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2a9b38bdb40a998cbc677db55b6225a6c4fadcf8819eb30695e1b8470942426b"}, {file = "ruff-0.1.11-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ea0d3e950e394c4b332bcdd112aa566010a9f9c95814844a7468325290aabfd9"},
{file = "ruff-0.0.265-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a8b44a245b60512403a6a03a5b5212da274d33862225c5eed3bcf12037eb19bb"}, {file = "ruff-0.1.11-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9bd4025b9c5b429a48280785a2b71d479798a69f5c2919e7d274c5f4b32c3607"},
{file = "ruff-0.0.265-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b279fa55ea175ef953208a6d8bfbcdcffac1c39b38cdb8c2bfafe9222add70bb"}, {file = "ruff-0.1.11-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1ad00662305dcb1e987f5ec214d31f7d6a062cae3e74c1cbccef15afd96611d"},
{file = "ruff-0.0.265-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:5028950f7af9b119d43d91b215d5044976e43b96a0d1458d193ef0dd3c587bf8"}, {file = "ruff-0.1.11-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:4b077ce83f47dd6bea1991af08b140e8b8339f0ba8cb9b7a484c30ebab18a23f"},
{file = "ruff-0.0.265-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4057eb539a1d88eb84e9f6a36e0a999e0f261ed850ae5d5817e68968e7b89ed9"}, {file = "ruff-0.1.11-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c4a88efecec23c37b11076fe676e15c6cdb1271a38f2b415e381e87fe4517f18"},
{file = "ruff-0.0.265-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d586e69ab5cbf521a1910b733412a5735936f6a610d805b89d35b6647e2a66aa"}, {file = "ruff-0.1.11-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5b25093dad3b055667730a9b491129c42d45e11cdb7043b702e97125bcec48a1"},
{file = "ruff-0.0.265-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa17b13cd3f29fc57d06bf34c31f21d043735cc9a681203d634549b0e41047d1"}, {file = "ruff-0.1.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:231d8fb11b2cc7c0366a326a66dafc6ad449d7fcdbc268497ee47e1334f66f77"},
{file = "ruff-0.0.265-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:9ac13b11d9ad3001de9d637974ec5402a67cefdf9fffc3929ab44c2fcbb850a1"}, {file = "ruff-0.1.11-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:09c415716884950080921dd6237767e52e227e397e2008e2bed410117679975b"},
{file = "ruff-0.0.265-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:62a9578b48cfd292c64ea3d28681dc16b1aa7445b7a7709a2884510fc0822118"}, {file = "ruff-0.1.11-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0f58948c6d212a6b8d41cd59e349751018797ce1727f961c2fa755ad6208ba45"},
{file = "ruff-0.0.265-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d0f9967f84da42d28e3d9d9354cc1575f96ed69e6e40a7d4b780a7a0418d9409"}, {file = "ruff-0.1.11-py3-none-musllinux_1_2_i686.whl", hash = "sha256:190a566c8f766c37074d99640cd9ca3da11d8deae2deae7c9505e68a4a30f740"},
{file = "ruff-0.0.265-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1d5a8de2fbaf91ea5699451a06f4074e7a312accfa774ad9327cde3e4fda2081"}, {file = "ruff-0.1.11-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:6464289bd67b2344d2a5d9158d5eb81025258f169e69a46b741b396ffb0cda95"},
{file = "ruff-0.0.265-py3-none-win32.whl", hash = "sha256:9e9db5ccb810742d621f93272e3cc23b5f277d8d00c4a79668835d26ccbe48dd"}, {file = "ruff-0.1.11-py3-none-win32.whl", hash = "sha256:9b8f397902f92bc2e70fb6bebfa2139008dc72ae5177e66c383fa5426cb0bf2c"},
{file = "ruff-0.0.265-py3-none-win_amd64.whl", hash = "sha256:f54facf286103006171a00ce20388d88ed1d6732db3b49c11feb9bf3d46f90e9"}, {file = "ruff-0.1.11-py3-none-win_amd64.whl", hash = "sha256:eb85ee287b11f901037a6683b2374bb0ec82928c5cbc984f575d0437979c521a"},
{file = "ruff-0.0.265-py3-none-win_arm64.whl", hash = "sha256:c78470656e33d32ddc54e8482b1b0fc6de58f1195586731e5ff1405d74421499"}, {file = "ruff-0.1.11-py3-none-win_arm64.whl", hash = "sha256:97ce4d752f964ba559c7023a86e5f8e97f026d511e48013987623915431c7ea9"},
{file = "ruff-0.0.265.tar.gz", hash = "sha256:53c17f0dab19ddc22b254b087d1381b601b155acfa8feed514f0d6a413d0ab3a"}, {file = "ruff-0.1.11.tar.gz", hash = "sha256:f9d4d88cb6eeb4dfe20f9f0519bd2eaba8119bde87c3d5065c541dbae2b5a2cb"},
] ]
[[package]] [[package]]
@ -2933,4 +2933,4 @@ pgsql = ["psycopg2-binary"]
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = "^3.10" python-versions = "^3.10"
content-hash = "59deb74794c951efd632d5db4b934e4aad665e7ea74ff8161bc3ca25a14b59b9" content-hash = "b7d5c58d572a0d86e4b4fe609eecd180a708fe82e4b5800856b89e71d8e34bbc"

View File

@ -57,7 +57,7 @@ pylint = "^3.0.0"
pytest = "^7.2.0" pytest = "^7.2.0"
pytest-asyncio = "^0.23.0" pytest-asyncio = "^0.23.0"
rich = "^13.5.2" rich = "^13.5.2"
ruff = "^0.0.265" ruff = "^0.1.0"
types-PyYAML = "^6.0.4" types-PyYAML = "^6.0.4"
types-python-dateutil = "^2.8.18" types-python-dateutil = "^2.8.18"
types-python-slugify = "^6.0.0" types-python-slugify = "^6.0.0"
@ -107,7 +107,7 @@ strict_optional = true
[tool.ruff] [tool.ruff]
line-length = 120 line-length = 120
format = "text" output-format = "text"
# Enable Pyflakes `E` and `F` codes by default. # Enable Pyflakes `E` and `F` codes by default.
ignore = ["F403", "TID252", "B008"] ignore = ["F403", "TID252", "B008"]