diff --git a/tasks.py b/tasks.py index 52257bc..071dff6 100644 --- a/tasks.py +++ b/tasks.py @@ -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: @@ -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: @@ -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) @@ -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 @@ -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 diff --git a/tox.ini b/tox.ini index 43d2093..e1db98f 100644 --- a/tox.ini +++ b/tox.ini @@ -14,6 +14,6 @@ python = passenv = * extras = dev commands = - {posargs:inv test} + {posargs:inv ci} setenv = TOX_ENV_SITE_PACKAGES_DIR = {envsitepackagesdir}