From 4c6cb8ac474f12d5e7af1157e21d44e07adbee69 Mon Sep 17 00:00:00 2001 From: rfl-urbaniak Date: Mon, 9 Sep 2024 11:06:24 -0400 Subject: [PATCH] update scripts --- scripts/clean.sh | 21 +++++++++++++++------ scripts/lint.sh | 6 +++--- scripts/test_notebooks.sh | 2 +- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/scripts/clean.sh b/scripts/clean.sh index fe727a37..6918545f 100755 --- a/scripts/clean.sh +++ b/scripts/clean.sh @@ -1,13 +1,22 @@ #!/bin/bash set -euxo pipefail -# isort suspended till the CI-vs-local issue is resolved -# isort cities/ tests/ +# isort suspended as conflicting with black +# nbqa isort docs/guides/ + + +# this sometimes conflicts with black but does some +# preliminary import sorting +# and is then overriden by black +isort cities/ tests/ + +black ./cities/ ./tests/ ./docs/guides/ + +black docs/guides/ -black cities/ tests/ autoflake --remove-all-unused-imports --in-place --recursive ./cities ./tests -nbqa autoflake --remove-all-unused-imports --recursive --in-place docs/guides/ -# nbqa isort docs/guides/ -nbqa black docs/guides/ +nbqa autoflake --nbqa-shell --remove-all-unused-imports --recursive --in-place docs/guides/ + +#nbqa black docs/guides/ diff --git a/scripts/lint.sh b/scripts/lint.sh index 538aeeb1..5e5b9abe 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -3,10 +3,10 @@ set -euxo pipefail mypy --ignore-missing-imports cities/ #isort --check --diff cities/ tests/ -black --check cities/ tests/ +black --check cities/ tests/ docs/guides/ flake8 cities/ tests/ --ignore=E203,W503 --max-line-length=127 -nbqa autoflake -v --recursive --check docs/guides/ +nbqa autoflake --nbqa-shell -v --recursive --check docs/guides/ #nbqa isort --check docs/guides/ -nbqa black --check docs/guides/ + diff --git a/scripts/test_notebooks.sh b/scripts/test_notebooks.sh index b31a8820..f5defc99 100755 --- a/scripts/test_notebooks.sh +++ b/scripts/test_notebooks.sh @@ -1,5 +1,5 @@ #!/bin/bash -INCLUDED_NOTEBOOKS="docs/guides/ docs/testing_notebooks/" +INCLUDED_NOTEBOOKS="docs/guides/ " # docs/testing_notebooks/" will revert when the pyro-ppl 1.9 bug is fixed CI=1 pytest -v --nbval-lax --dist loadscope -n auto $INCLUDED_NOTEBOOKS