Skip to content

Commit

Permalink
Rename invoke task "test" to "ci" and "unit" to "test".
Browse files Browse the repository at this point in the history
  • Loading branch information
dgilland committed Sep 23, 2022
1 parent 3b2a990 commit 422da18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ def lint(ctx):
linters = {"flake8": flake8, "pylint": pylint}
failures = []

print(f"Preparing to run linters: {', '.join(linters)}\n")

for name, linter in linters.items():
print(f"Running {name}")
try:
Expand All @@ -94,7 +96,7 @@ def lint(ctx):


@task(help={"args": "Override default pytest arguments"})
def unit(ctx, args=f"{TEST_TARGETS} --cov={PACKAGE_NAME} --flake8 --pylint"):
def test(ctx, args=f"{TEST_TARGETS} --cov={PACKAGE_NAME}"):
"""Run unit tests using pytest."""
tox_env_site_packages_dir = os.getenv("TOX_ENV_SITE_PACKAGES_DIR")
if tox_env_site_packages_dir:
Expand All @@ -106,7 +108,7 @@ def unit(ctx, args=f"{TEST_TARGETS} --cov={PACKAGE_NAME} --flake8 --pylint"):


@task
def test(ctx):
def ci(ctx):
"""Run linters and tests."""
print("Building package")
build(ctx)
Expand All @@ -118,7 +120,7 @@ def test(ctx):
lint(ctx)

print("Running unit tests")
unit(ctx, args=f"{TEST_TARGETS} --cov={PACKAGE_NAME}")
test(ctx)


@task
Expand All @@ -136,7 +138,7 @@ def docs(ctx, serve=False, bind="127.0.0.1", port=8000):
def build(ctx):
"""Build Python package."""
run("rm -rf dist build docs/_build")
run("python setup.py -q sdist bdist_wheel")
run("python -m build")


@task
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ python =
passenv = *
extras = dev
commands =
{posargs:inv test}
{posargs:inv ci}
setenv =
TOX_ENV_SITE_PACKAGES_DIR = {envsitepackagesdir}

0 comments on commit 422da18

Please sign in to comment.