From 6b3eceae9397444fbc66118f7602f9fcff5fd9a6 Mon Sep 17 00:00:00 2001 From: Ivan Schaller Date: Sun, 26 Jun 2022 15:10:36 +0200 Subject: [PATCH] move justfile and small changes --- contrib/README.md | 2 +- contrib/justfile => justfile | 43 ++++++++++++++++++++++++++++++++++++ tox.ini | 2 +- 3 files changed, 45 insertions(+), 2 deletions(-) rename contrib/justfile => justfile (66%) diff --git a/contrib/README.md b/contrib/README.md index 9d8c4ae..20296e1 100644 --- a/contrib/README.md +++ b/contrib/README.md @@ -11,6 +11,6 @@ python3 -m pip install -r contrib/requirements_dev.txt > you may need to install just first: [link](https://github.com/casey/just) ```sh -just contrib/ prepare_workspace +just prepare_workspace ``` diff --git a/contrib/justfile b/justfile similarity index 66% rename from contrib/justfile rename to justfile index feb6da3..549b9b7 100755 --- a/contrib/justfile +++ b/justfile @@ -8,7 +8,10 @@ set dotenv-load := true # aliases alias s := show_receipts +alias i := show_system_info alias p := prepare_workspace +alias t := tests +alias f := tests_full # variables export asdf_version := "v0.10.2" @@ -18,9 +21,12 @@ show_receipts: @just --list show_system_info: + @echo "==================================" @echo "os : {{os()}}" @echo "arch: {{arch()}}" @echo "home: ${HOME}" + @echo "project dir: {{justfile_directory()}}" + @echo "==================================" check_asdf: @if ! asdf --version; then \ @@ -60,6 +66,27 @@ create_venv: @python3 -m pip install --upgrade pip setuptools wheel @python3 -m venv venv +test_shfmt: + @find . -type f \( -name "**.sh" -and -not -path "./venv/*" -and -not -path "./.tox/*" \) -exec shfmt -d -i 4 -bn -ci -sr "{}" \+; + +test_black: + @python3 -m black --check --diff . + +test_isort: + @python3 -m isort --check-only --diff . + +test_mypy: + @python3 -m mypy --install-types --non-interactive mangadlp/ + +test_pytest: + @python3 -m pytest -x + +test_tox: + @python3 -m tox + +test_tox_coverage: + @python3 -m tox -e coverage + # install dependecies and set everything up prepare_workspace: just show_system_info @@ -67,3 +94,19 @@ prepare_workspace: just setup_asdf just create_venv +tests: + just show_system_info + just test_shfmt + just test_black + just test_isort + just test_mypy + just test_pytest + +tets_full: + just show_system_info + just test_shfmt + just test_black + just test_isort + just test_mypy + just test_tox + just test_tox_coverage diff --git a/tox.ini b/tox.ini index e4bb198..e7ebbfa 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ deps = -rcontrib/requirements_dev.txt commands = - pytest -x --basetemp="{envtmpdir}" {posargs} + pytest --verbose --exitfirst --basetemp="{envtmpdir}" {posargs} [testenv:coverage] deps =