Skip to content

Commit

Permalink
Add pyclean task
Browse files Browse the repository at this point in the history
  • Loading branch information
icflournoy committed Apr 11, 2021
1 parent 22130b0 commit f0bbccb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ flake8 = "*"
pytest = "*"
coverage = "*"
pytest-cov = "*"
pyclean = "*"

[requires]
python_version = "3.8"
Expand Down
10 changes: 9 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def lint(c):
"""
print("Running flake8 linter")
c.run("flake8 bdio/ tasks.py", pty=True)
print()


@task
Expand All @@ -35,6 +36,7 @@ def format(c):
"""
print("Running black formatter")
c.run("black bdio/ tasks.py", pty=True)
print()


@task
Expand All @@ -47,11 +49,19 @@ def test(c, coverage=False):
c.run("pytest --cov=bdio", pty=True)
else:
c.run("pytest", pty=True)
print()


@task(pre=[format, lint, call(test, coverage=True)])
@task
def clean(c):
print("Running pyclean")
c.run("pyclean ./", pty=True)
print()


@task(pre=[format, lint, call(test, coverage=True)], post=[clean])
def build(c):
"""
Run all configured steps
"""
print("Build completed")
print("Build completed\n")

0 comments on commit f0bbccb

Please sign in to comment.