diff --git a/example_app/strings_demo.py b/example_app/strings_demo.py index 0738a6c8..df781a25 100644 --- a/example_app/strings_demo.py +++ b/example_app/strings_demo.py @@ -1,4 +1,5 @@ """Strings and strings related fields demo model.""" + import re from example_app.models import db diff --git a/example_app/views.py b/example_app/views.py index a4c871e8..802044d8 100644 --- a/example_app/views.py +++ b/example_app/views.py @@ -1,4 +1,5 @@ """Demo views for example application.""" + from faker import Faker from flask import render_template, request from mongoengine.context_managers import switch_db diff --git a/flask_mongoengine/connection.py b/flask_mongoengine/connection.py index 824d250a..09e96eb0 100644 --- a/flask_mongoengine/connection.py +++ b/flask_mongoengine/connection.py @@ -1,4 +1,5 @@ """Module responsible for connection setup.""" + import warnings from typing import List diff --git a/flask_mongoengine/db_fields.py b/flask_mongoengine/db_fields.py index fa7f9fb6..fff3f9ce 100644 --- a/flask_mongoengine/db_fields.py +++ b/flask_mongoengine/db_fields.py @@ -1,4 +1,5 @@ """Responsible for mongoengine fields extension, if WTFForms integration used.""" + __all__ = [ "WtfFieldMixin", "BinaryField", diff --git a/flask_mongoengine/decorators.py b/flask_mongoengine/decorators.py index 9dfbc040..cc235f97 100644 --- a/flask_mongoengine/decorators.py +++ b/flask_mongoengine/decorators.py @@ -1,4 +1,5 @@ """Collection of project wide decorators.""" + import functools import logging import warnings diff --git a/flask_mongoengine/documents.py b/flask_mongoengine/documents.py index 251ee5aa..a124e5dd 100644 --- a/flask_mongoengine/documents.py +++ b/flask_mongoengine/documents.py @@ -1,4 +1,5 @@ """Extended version of :mod:`mongoengine.document`.""" + import logging from typing import Dict, List, Optional, Type, Union diff --git a/flask_mongoengine/json.py b/flask_mongoengine/json.py index 514bac6b..6562849f 100644 --- a/flask_mongoengine/json.py +++ b/flask_mongoengine/json.py @@ -1,4 +1,5 @@ """Flask application JSON extension functions.""" + from functools import lru_cache from bson import DBRef, ObjectId, json_util diff --git a/flask_mongoengine/panels.py b/flask_mongoengine/panels.py index 51342e83..0e29c0a4 100644 --- a/flask_mongoengine/panels.py +++ b/flask_mongoengine/panels.py @@ -1,4 +1,5 @@ """Debug panel views and logic and related mongoDb event listeners.""" + __all__ = ["mongo_command_logger", "MongoDebugPanel"] import logging import sys diff --git a/flask_mongoengine/wtf/__init__.py b/flask_mongoengine/wtf/__init__.py index f38ce914..45aa4b1c 100644 --- a/flask_mongoengine/wtf/__init__.py +++ b/flask_mongoengine/wtf/__init__.py @@ -1,2 +1,3 @@ """WTFForms integration module init file.""" + from flask_mongoengine.wtf.orm import model_fields, model_form # noqa diff --git a/flask_mongoengine/wtf/fields.py b/flask_mongoengine/wtf/fields.py index 03d50efc..3a5af6f8 100644 --- a/flask_mongoengine/wtf/fields.py +++ b/flask_mongoengine/wtf/fields.py @@ -1,6 +1,7 @@ """ Useful form fields for use with the mongoengine. """ + __all__ = [ "ModelSelectField", "QuerySetSelectField", diff --git a/flask_mongoengine/wtf/orm.py b/flask_mongoengine/wtf/orm.py index 8380e589..67b60961 100644 --- a/flask_mongoengine/wtf/orm.py +++ b/flask_mongoengine/wtf/orm.py @@ -1,6 +1,7 @@ """ Tools for generating forms based on mongoengine Document schemas. """ + import decimal from collections import OrderedDict from typing import List, Optional, Type diff --git a/noxfile.py b/noxfile.py index d034cb28..ab1498b0 100644 --- a/noxfile.py +++ b/noxfile.py @@ -2,6 +2,7 @@ Nox is Tox tool replacement. """ + import shutil from pathlib import Path diff --git a/pyproject.toml b/pyproject.toml index 9f9a77c9..17f03909 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,7 @@ wtf = ["WTForms[email]>=3.0.0", ] toolbar = ["Flask-DebugToolbar>=0.11.0"] dev = [ - "black==22.6.0", + "black==24.4.2", "pre-commit", "pytest", "pytest-cov", diff --git a/setup.py b/setup.py index e886cefe..7e3faf94 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ """Setup file for backward compatibility with setuptools, not supported PEP 660.""" + from setuptools import setup setup() diff --git a/tests/test_base.py b/tests/test_base.py index 816e43a7..df876440 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -1,4 +1,5 @@ """Tests for base MongoEngine class.""" + import pytest from flask_mongoengine import MongoEngine diff --git a/tests/test_db_fields.py b/tests/test_db_fields.py index 97689e41..2b90be3c 100644 --- a/tests/test_db_fields.py +++ b/tests/test_db_fields.py @@ -1,4 +1,5 @@ """Tests for db_fields overwrite and WTForms integration.""" + import re from enum import Enum from unittest.mock import Mock diff --git a/tests/test_db_fields_import_protection.py b/tests/test_db_fields_import_protection.py index 2ceae717..3314a1fc 100644 --- a/tests/test_db_fields_import_protection.py +++ b/tests/test_db_fields_import_protection.py @@ -1,4 +1,5 @@ """Testing independency from WTForms.""" + import pytest try: diff --git a/tests/test_debug_panel.py b/tests/test_debug_panel.py index 49d7253e..4d292cdd 100644 --- a/tests/test_debug_panel.py +++ b/tests/test_debug_panel.py @@ -3,6 +3,7 @@ - Independent of global configuration by design. """ + import contextlib import flask diff --git a/tests/test_decorators.py b/tests/test_decorators.py index 19b0930d..3e126ef2 100644 --- a/tests/test_decorators.py +++ b/tests/test_decorators.py @@ -1,4 +1,5 @@ """Tests for project wide decorators.""" + from flask_mongoengine.decorators import orm_deprecated diff --git a/tests/test_forms_v2.py b/tests/test_forms_v2.py index 3deb5532..1884139b 100644 --- a/tests/test_forms_v2.py +++ b/tests/test_forms_v2.py @@ -1,4 +1,5 @@ """Integration tests for new WTForms generation in Flask-Mongoengine 2.0.""" + import json from enum import Enum diff --git a/tests/test_json.py b/tests/test_json.py index 188586d4..25538317 100644 --- a/tests/test_json.py +++ b/tests/test_json.py @@ -1,4 +1,5 @@ """Extension of app JSON capabilities.""" + import flask import pytest