diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d79957ab..58cfe63b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: "v4.3.0" + rev: "v4.5.0" hooks: - id: check-merge-conflict - id: end-of-file-fixer @@ -24,34 +24,34 @@ repos: - id: detect-private-key exclude: ^examples|(?:tests/ssl)/ - repo: https://github.com/hadialqattan/pycln - rev: v1.3.5 + rev: v2.4.0 hooks: - id: pycln args: ["--all"] - repo: https://github.com/asottile/yesqa - rev: v1.3.0 + rev: v1.5.0 hooks: - id: yesqa - repo: https://github.com/pycqa/isort - rev: "5.12.0" + rev: "5.13.2" hooks: - id: isort args: ["--profile", "black"] - repo: https://github.com/psf/black - rev: "22.6.0" + rev: "24.1.1" hooks: - id: black - repo: https://github.com/asottile/pyupgrade - rev: "v2.34.0" + rev: "v3.15.0" hooks: - id: pyupgrade args: ["--py37-plus", "--keep-mock"] - - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: "v1.6.0" + - repo: https://github.com/hhatto/autopep8 + rev: "v2.0.4" hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 - rev: "4.0.1" + rev: "7.0.0" hooks: - id: flake8 exclude: "^docs/" @@ -61,6 +61,6 @@ repos: - id: rst-linter files: ^[^/]+[.]rst$ - repo: https://github.com/adrienverge/yamllint - rev: "v1.26.3" + rev: "v1.33.0" hooks: - id: yamllint diff --git a/dbbackup/db/base.py b/dbbackup/db/base.py index e67d3c44..5f28e66e 100644 --- a/dbbackup/db/base.py +++ b/dbbackup/db/base.py @@ -1,6 +1,7 @@ """ Base database connectors """ + import logging import os import shlex diff --git a/dbbackup/management/commands/_base.py b/dbbackup/management/commands/_base.py index 48b88578..9149742b 100644 --- a/dbbackup/management/commands/_base.py +++ b/dbbackup/management/commands/_base.py @@ -1,6 +1,7 @@ """ Abstract Command. """ + import logging import sys from optparse import make_option as optparse_make_option diff --git a/dbbackup/management/commands/mediarestore.py b/dbbackup/management/commands/mediarestore.py index 3e135ace..d353be6c 100644 --- a/dbbackup/management/commands/mediarestore.py +++ b/dbbackup/management/commands/mediarestore.py @@ -1,6 +1,7 @@ """ Restore media files. """ + import tarfile from django.core.files.storage import get_storage_class diff --git a/dbbackup/storage.py b/dbbackup/storage.py index 24fa9ab8..52c46540 100644 --- a/dbbackup/storage.py +++ b/dbbackup/storage.py @@ -1,6 +1,7 @@ """ Utils for handle files. """ + import logging from django.core.exceptions import ImproperlyConfigured diff --git a/dbbackup/tests/commands/test_base.py b/dbbackup/tests/commands/test_base.py index f1fd1490..322564ba 100644 --- a/dbbackup/tests/commands/test_base.py +++ b/dbbackup/tests/commands/test_base.py @@ -1,6 +1,7 @@ """ Tests for base command class. """ + import logging import os from io import BytesIO diff --git a/dbbackup/tests/commands/test_dbbackup.py b/dbbackup/tests/commands/test_dbbackup.py index c18fec6e..11fbaedf 100644 --- a/dbbackup/tests/commands/test_dbbackup.py +++ b/dbbackup/tests/commands/test_dbbackup.py @@ -1,6 +1,7 @@ """ Tests for dbbackup command. """ + import os from django.test import TestCase diff --git a/dbbackup/tests/commands/test_dbrestore.py b/dbbackup/tests/commands/test_dbrestore.py index ec0a3d65..7c115c7d 100644 --- a/dbbackup/tests/commands/test_dbrestore.py +++ b/dbbackup/tests/commands/test_dbrestore.py @@ -1,6 +1,7 @@ """ Tests for dbrestore command. """ + from shutil import copyfileobj from tempfile import mktemp diff --git a/dbbackup/tests/settings.py b/dbbackup/tests/settings.py index fd596801..e4870263 100644 --- a/dbbackup/tests/settings.py +++ b/dbbackup/tests/settings.py @@ -1,6 +1,7 @@ """ Configuration and launcher for dbbackup tests. """ + import os import sys import tempfile diff --git a/dbbackup/utils.py b/dbbackup/utils.py index e7cf3109..ed4b4520 100644 --- a/dbbackup/utils.py +++ b/dbbackup/utils.py @@ -12,6 +12,7 @@ from datetime import datetime from functools import wraps from getpass import getpass +from shlex import quote from shutil import copyfileobj from django.core.mail import EmailMultiAlternatives @@ -19,11 +20,6 @@ from django.http import HttpRequest from django.utils import timezone -try: - from pipes import quote -except ImportError: - from shlex import quote - from . import settings FAKE_HTTP_REQUEST = HttpRequest()