Skip to content

Commit

Permalink
Rename arguments to task clean to be in line with help dict.
Browse files Browse the repository at this point in the history
  • Loading branch information
tetov committed Jan 4, 2021
1 parent fd09b50 commit fb10b5d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ def help(ctx):
"builds": "True to clean up build/packaging artifacts, otherwise False.",
}
)
def clean(ctx, clean_docs=True, clean_bytecode=True, clean_builds=True):
def clean(ctx, docs=True, bytecode=True, builds=True):
"""Clean the local copy from compiled artifacts."""
with chdir(BASE_FOLDER):
if clean_builds:
if builds:
ctx.run("python setup.py clean")

if clean_bytecode:
if bytecode:
for root, dirs, files in os.walk(BASE_FOLDER):
for f in files:
if f.endswith(".pyc"):
Expand All @@ -78,16 +78,16 @@ def clean(ctx, clean_docs=True, clean_bytecode=True, clean_builds=True):

folders = []

if clean_docs:
if docs:
folders.append(BASE_FOLDER / "docs/reference")

folders.append(OUT_DIR)

if clean_bytecode:
if bytecode:
for t in ("src", "tests"):
folders += BASE_FOLDER.joinpath(t).glob("**/__pycache__")

if clean_builds:
if builds:
folders.append(BASE_FOLDER / "src/rapid_clay_formations_fab.egg-info/")

for folder in folders:
Expand Down Expand Up @@ -133,8 +133,9 @@ def check(ctx):

@task(
help={
"checks": "True to run all checks before testing, otherwise False.",
"verbose": "Run pytest with -vv level verbosity.",
"checks": "True to run all checks before testing, otherwise False.",
"doctest": "Run doctests as well.",
}
)
def test(ctx, checks=False, doctest=False, verbose=True):
Expand Down

0 comments on commit fb10b5d

Please sign in to comment.