From 8e0d5e15759a188278f5aa678d1f3c36012cde8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lafr=C3=A9choux?= Date: Tue, 5 Dec 2023 23:30:53 +0100 Subject: [PATCH 1/4] Bump pre-commit to 3.5 in tox.ini --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index bb8d330ab..4658dc621 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ extras = tests commands = pytest {posargs} [testenv:lint] -deps = pre-commit~=2.4 +deps = pre-commit~=3.5 skip_install = true commands = pre-commit run --all-files --show-diff-on-failure From e4558d9e3c47e8a9508d6658cb07408822a0c2a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lafr=C3=A9choux?= Date: Tue, 5 Dec 2023 23:37:08 +0100 Subject: [PATCH 2/4] Only keep pre-commit in lint dependencies --- setup.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.py b/setup.py index d92f7bb0b..80f375dd7 100644 --- a/setup.py +++ b/setup.py @@ -4,9 +4,6 @@ EXTRAS_REQUIRE = { "tests": ["pytest", "pytz", "simplejson"], "lint": [ - "mypy==1.7.1", - "flake8==6.1.0", - "flake8-bugbear==23.12.2", "pre-commit>=2.4,<4.0", ], "docs": [ From 0547a8af7923041c0b1648258bff32a263aa4373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lafr=C3=A9choux?= Date: Tue, 5 Dec 2023 23:39:39 +0100 Subject: [PATCH 3/4] Bump flake8-bugbear to 23.12.2 in pre-commit config --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 662fdda70..f66ec5715 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: rev: 6.1.0 hooks: - id: flake8 - additional_dependencies: [flake8-bugbear==22.12.6] + additional_dependencies: [flake8-bugbear==23.12.2] - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.7.1 hooks: From 24855ac0cffeb1b8560a1c068ad9bced51402b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lafr=C3=A9choux?= Date: Tue, 5 Dec 2023 23:55:26 +0100 Subject: [PATCH 4/4] Fix flake8 issues --- src/marshmallow/fields.py | 8 +++++--- src/marshmallow/schema.py | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/marshmallow/fields.py b/src/marshmallow/fields.py index 3e9a0f3bd..ce2ffb957 100644 --- a/src/marshmallow/fields.py +++ b/src/marshmallow/fields.py @@ -1142,7 +1142,8 @@ class Boolean(Field): "YES", "1", 1, - True, + # Equal to 1 + # True, } #: Default falsy values. falsy = { @@ -1161,8 +1162,9 @@ class Boolean(Field): "NO", "0", 0, - 0.0, - False, + # Equal to 0 + # 0.0, + # False, } #: Default error messages. diff --git a/src/marshmallow/schema.py b/src/marshmallow/schema.py index 6f15a0f3c..ca4eb082c 100644 --- a/src/marshmallow/schema.py +++ b/src/marshmallow/schema.py @@ -212,6 +212,7 @@ def __init__(self, meta, ordered: bool = False): warnings.warn( "The json_module class Meta option is deprecated. Use render_module instead.", RemovedInMarshmallow4Warning, + stacklevel=2, ) render_module = getattr(meta, "json_module", json) else: