Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #394

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down
22 changes: 11 additions & 11 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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*"))
Expand All @@ -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"]
Expand Down Expand Up @@ -90,47 +90,47 @@ 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")


@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)


@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()
Expand Down
2 changes: 1 addition & 1 deletion tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion tests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading