From 0bf6113a7eebdc0cc88a2c3f8627133ef0c97666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lafr=C3=A9choux?= Date: Mon, 12 Feb 2024 11:31:25 +0100 Subject: [PATCH] pre-commit autoupdate --- .pre-commit-config.yaml | 4 ++-- flask_smorest/arguments.py | 1 + flask_smorest/globals.py | 1 + flask_smorest/pagination.py | 9 ++++++--- flask_smorest/spec/__init__.py | 1 + flask_smorest/spec/field_converters.py | 1 + flask_smorest/spec/plugins.py | 1 + tests/test_api.py | 1 + tests/test_spec.py | 1 + 9 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2972029a..a4b361cc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black language_version: python3 @@ -13,7 +13,7 @@ repos: rev: 7.0.0 hooks: - id: flake8 - additional_dependencies: [flake8-bugbear==23.12.2 ] + additional_dependencies: [flake8-bugbear==24.2.6] - repo: https://github.com/asottile/blacken-docs rev: 1.16.0 hooks: diff --git a/flask_smorest/arguments.py b/flask_smorest/arguments.py index a387ae1b..b6cdaeed 100644 --- a/flask_smorest/arguments.py +++ b/flask_smorest/arguments.py @@ -1,4 +1,5 @@ """Arguments parsing""" + from collections import abc from copy import deepcopy from functools import wraps diff --git a/flask_smorest/globals.py b/flask_smorest/globals.py index a9cdc252..5eb07ea1 100644 --- a/flask_smorest/globals.py +++ b/flask_smorest/globals.py @@ -1,4 +1,5 @@ """Globals""" + from flask import current_app, request from werkzeug.local import LocalProxy diff --git a/flask_smorest/pagination.py b/flask_smorest/pagination.py index cca720e0..719bd7f9 100644 --- a/flask_smorest/pagination.py +++ b/flask_smorest/pagination.py @@ -8,6 +8,7 @@ - Post-pagination: the resource returns an iterator (typically a DB cursor) and a pager is provided to paginate the data and get the total number of items. """ + from copy import deepcopy from functools import wraps import http @@ -278,9 +279,11 @@ def _document_pagination_metadata(self, spec, resp_doc): """ resp_doc.setdefault("headers", {}).update( { - self.PAGINATION_HEADER_NAME: "PAGINATION" - if spec.openapi_version.major >= 3 - else PAGINATION_HEADER + self.PAGINATION_HEADER_NAME: ( + "PAGINATION" + if spec.openapi_version.major >= 3 + else PAGINATION_HEADER + ) } ) diff --git a/flask_smorest/spec/__init__.py b/flask_smorest/spec/__init__.py index fe77dca9..4cf624a1 100644 --- a/flask_smorest/spec/__init__.py +++ b/flask_smorest/spec/__init__.py @@ -1,4 +1,5 @@ """API specification using OpenAPI""" + import json import http diff --git a/flask_smorest/spec/field_converters.py b/flask_smorest/spec/field_converters.py index 0fc3f7e4..f7284455 100644 --- a/flask_smorest/spec/field_converters.py +++ b/flask_smorest/spec/field_converters.py @@ -1,4 +1,5 @@ """Custom field properties functions""" + from flask_smorest.fields import Upload diff --git a/flask_smorest/spec/plugins.py b/flask_smorest/spec/plugins.py index cbafe160..7bf86eb5 100644 --- a/flask_smorest/spec/plugins.py +++ b/flask_smorest/spec/plugins.py @@ -1,4 +1,5 @@ """apispec plugins""" + from collections.abc import Mapping import re diff --git a/tests/test_api.py b/tests/test_api.py index 7d84b275..2760bef8 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,4 +1,5 @@ """Test Api class""" + import pytest from flask import jsonify from flask.views import MethodView diff --git a/tests/test_spec.py b/tests/test_spec.py index ea0ceb44..7db3cc4b 100644 --- a/tests/test_spec.py +++ b/tests/test_spec.py @@ -1,4 +1,5 @@ """Test Api class""" + import json import http from unittest import mock