diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 514bb9b..f4320c5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ exclude: "(.idea|node_modules|.tox)" repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.3.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -16,16 +16,16 @@ repos: - id: fix-encoding-pragma args: - --remove - - repo: https://github.com/timothycrosley/isort - rev: "5.6.4" + - repo: https://github.com/PyCQA/isort + rev: "5.13.2" hooks: - id: isort - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 23.12.1 hooks: - id: black - - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.4 + - repo: https://github.com/PyCQA/flake8 + rev: 7.0.0 hooks: - id: flake8 additional_dependencies: @@ -40,14 +40,14 @@ repos: - flake8-tidy-imports - pep8-naming - repo: https://github.com/econchick/interrogate - rev: 1.3.2 + rev: 1.5.0 hooks: - id: interrogate args: - "-cpyproject.toml" - "--quiet" - repo: https://github.com/asottile/pyupgrade - rev: v2.7.4 + rev: v3.15.0 hooks: - id: pyupgrade args: diff --git a/tasks.py b/tasks.py index 82261dd..753283c 100644 --- a/tasks.py +++ b/tasks.py @@ -13,7 +13,7 @@ @task def clean(c): - """ Remove artifacts and binary files. """ + """Remove artifacts and binary files.""" c.run("python setup.py clean --all") patterns = ["build", "dist"] patterns.extend(glob("*.egg*")) @@ -25,19 +25,19 @@ def clean(c): @task def lint(c): - """ Run linting tox environments. """ + """Run linting tox environments.""" c.run("tox -epep8,isort,black,pypi-description") @task # NOQA def format(c): # NOQA - """ Run code formatting tasks. """ + """Run code formatting tasks.""" c.run("tox -eblacken,isort_format") @task def towncrier_check(c): # NOQA - """ Check towncrier files. """ + """Check towncrier files.""" output = io.StringIO() c.run("git branch --contains HEAD", out_stream=output) skipped_branch_prefix = ["pull/", "develop", "master", "HEAD"] @@ -90,19 +90,19 @@ def towncrier_check(c): # NOQA @task def test(c): - """ Run test in local environment. """ + """Run test in local environment.""" c.run("python setup.py test") @task def test_all(c): - """ Run all tox environments. """ + """Run all tox environments.""" c.run("tox") @task def coverage(c): - """ Run test with coverage in local environment. """ + """Run test with coverage in local environment.""" c.run("coverage erase") c.run("run setup.py test") c.run("report -m") @@ -110,19 +110,19 @@ def coverage(c): @task def tag_release(c, level): - """ Tag release version. """ + """Tag release version.""" c.run("bumpversion --list %s --no-tag" % level) @task def tag_dev(c, level="patch"): - """ Tag development version. """ + """Tag development version.""" c.run("bumpversion --list %s --message='Bump develop version [ci skip]' --no-tag" % level) @task(pre=[clean]) def docbuild(c): - """ Build documentation. """ + """Build documentation.""" os.chdir("docs") build_dir = os.environ.get("BUILD_DIR", "_build/html") c.run("python -msphinx -W -b html -d _build/doctrees . %s" % build_dir) @@ -130,7 +130,7 @@ def docbuild(c): @task(docbuild) def docserve(c): - """ Serve docs at http://localhost:$DOCS_PORT/ (default port is 8000). """ + """Serve docs at http://localhost:$DOCS_PORT/ (default port is 8000).""" from livereload import Server server = Server() diff --git a/tests/base.py b/tests/base.py index 96a773a..7ca7aec 100644 --- a/tests/base.py +++ b/tests/base.py @@ -6,7 +6,7 @@ import unittest from copy import copy -from six import StringIO +from io import StringIO SYSTEM_ACTIVATE = os.path.join(os.path.dirname(sys.executable), "activate_this.py") diff --git a/tests/config.py b/tests/config.py index 6a15294..2b76d71 100644 --- a/tests/config.py +++ b/tests/config.py @@ -5,7 +5,7 @@ from argparse import Namespace from unittest.mock import patch -from six import StringIO +from io import StringIO from tzlocal import get_localzone from djangocms_installer import config diff --git a/tests/main.py b/tests/main.py index c197c78..efba3d8 100644 --- a/tests/main.py +++ b/tests/main.py @@ -148,7 +148,7 @@ def test_base_invocation(self): out = subprocess.check_output( ["sqlite3", "project.db", 'SELECT COUNT(*) FROM auth_user WHERE username="admin"'] ) - self.assertEqual(bytes(out), bytes(b"1\n")) + self.assertEqual(bytes(out), b"1\n") os.chdir(original_dir) rmtree(base_dir)