Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 26, 2023
1 parent 4a880c3 commit 80517ed
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
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

0 comments on commit 80517ed

Please sign in to comment.