diff options
-rw-r--r-- | pyproject.toml | 6 | ||||
-rw-r--r-- | scripts/create_setup.py (renamed from scripts/poe-tasks/create_setup.py) | 0 | ||||
-rwxr-xr-x | scripts/poe-tasks/format | 13 | ||||
-rwxr-xr-x | scripts/poe-tasks/gen-setuppy | 8 | ||||
-rwxr-xr-x | scripts/poe-tasks/test | 8 |
5 files changed, 32 insertions, 3 deletions
diff --git a/pyproject.toml b/pyproject.toml index c241727a..81b7a960 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,13 +74,13 @@ configure = { cmd = "scripts/poe-tasks/configure", help = "(Re)configure Meson b run = { cmd = "scripts/poe-tasks/run", help = "Run Knot Resolver" } run-debug = { cmd = "scripts/poe-tasks/run-debug", help = "Debug Knot Resolver with debugpy" } docs = { cmd = "scripts/poe-tasks/docs", help = "Create Knot Resolver HTML documentation" } -test = { shell = "env PYTHONPATH=. pytest --junitxml=unit.junit.xml --cov=manager/knot_resolver_manager --show-capture=all tests/manager", help = "Run unit tests" } +test = { cmd = "scripts/poe-tasks/test", help = "Run pytest unit tests" } check = { cmd = "scripts/poe-tasks/check", help = "Check that all dependencies are installed and run static code analysis" } examples = { cmd = "scripts/poe-tasks/examples", help = "Validate all configuration examples using 'kresctl validate' utility" } man = {cmd = "scripts/poe-tasks/man", help = "Display Knot Resolver manpage from sources" } +gen-setuppy = { cmd = "scripts/poe-tasks/gen-setuppy", help = "Generate 'setup.py' file for backwards compatibility" } +format = { cmd = "scripts/poe-tasks/format", help = "Run code formatter" } # tasks runned directly -gen-setuppy = { shell = "python scripts/poe-tasks/create_setup.py > setup.py", help = "Generate 'setup.py' file for backwards compatibility" } -format = { shell = "black manager/knot_resolver_manager/ tests/manager scripts/create_setup.py manager/build_c_extensions.py; isort .", help = "Run code formatter" } fixdeps = { shell = "poetry install; npm install; npm update", help = "Install/update dependencies according to configuration files"} kresctl = { script = "knot_resolver_manager.cli.main:main", cwd="${POE_PWD}", help="Run kresctl utility" } kresctl-nocwd = { script = "knot_resolver_manager.cli.main:main", help="Run kresctl utility" } # Python <3.8 and poethepoet <0.22.0 compatibility (see also `./poe`) diff --git a/scripts/poe-tasks/create_setup.py b/scripts/create_setup.py index 087ce3b0..087ce3b0 100644 --- a/scripts/poe-tasks/create_setup.py +++ b/scripts/create_setup.py diff --git a/scripts/poe-tasks/format b/scripts/poe-tasks/format new file mode 100755 index 00000000..fa113f19 --- /dev/null +++ b/scripts/poe-tasks/format @@ -0,0 +1,13 @@ +#!/bin/bash + +# ensure consistent behaviour +src_dir="$(dirname "$(realpath "$0")")" +source $src_dir/_env.sh + +dirs="manager/knot_resolver_manager/ tests/manager scripts/create_setup.py build_c_extensions.py" + +# run black code formater +black $dirs + +# sort python imports +isort $dirs diff --git a/scripts/poe-tasks/gen-setuppy b/scripts/poe-tasks/gen-setuppy new file mode 100755 index 00000000..752beea1 --- /dev/null +++ b/scripts/poe-tasks/gen-setuppy @@ -0,0 +1,8 @@ +#!/bin/bash + +# ensure consistent behaviour +src_dir="$(dirname "$(realpath "$0")")" +source $src_dir/_env.sh + +# create setup.py +python scripts/create_setup.py > setup.py diff --git a/scripts/poe-tasks/test b/scripts/poe-tasks/test new file mode 100755 index 00000000..0f451b68 --- /dev/null +++ b/scripts/poe-tasks/test @@ -0,0 +1,8 @@ +#!/bin/bash + +# ensure consistent behaviour +src_dir="$(dirname "$(realpath "$0")")" +source $src_dir/_env.sh + +# run pytest +env PYTHONPATH=. pytest --junitxml=unit.junit.xml --cov=manager/knot_resolver_manager --show-capture=all tests/manager |