scripts: add my standard test runner; switch to ty for type checking
- ID
64a0035- date
2026-05-17 15:31:42+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
7ad3f52- message
scripts: add my standard test runner; switch to ty for type checking- changed files
3 files, 49 additions, 29 deletions
Changed files
dev_requirements.in (21) → dev_requirements.in (24)
diff --git a/dev_requirements.in b/dev_requirements.in
index 87ea621..da9db9c 100644
--- a/dev_requirements.in
+++ b/dev_requirements.in
@@ -1,3 +1,4 @@
-mypy
-pytest-cov
+coverage
+pytest
ruff
+ty
dev_requirements.txt (703) → dev_requirements.txt (526)
diff --git a/dev_requirements.txt b/dev_requirements.txt
index debe8a2..3fe68f0 100644
--- a/dev_requirements.txt
+++ b/dev_requirements.txt
@@ -1,33 +1,18 @@
# This file was autogenerated by uv via the following command:
-# uv pip compile dev_requirements.in --output-file dev_requirements.txt
-coverage[toml]==7.10.6
- # via pytest-cov
-exceptiongroup==1.2.2
+# uv pip compile dev_requirements.in --output-file=dev_requirements.txt --exclude-newer=P7D --exclude-newer-package alexwlchan-chives=false
+coverage==7.13.5
+ # via -r dev_requirements.in
+iniconfig==2.3.0
# via pytest
-iniconfig==2.1.0
+packaging==26.2
# via pytest
-mypy==1.18.2
- # via -r dev_requirements.in
-mypy-extensions==1.0.0
- # via mypy
-packaging==24.2
+pluggy==1.6.0
# via pytest
-pathspec==0.12.1
- # via mypy
-pluggy==1.5.0
- # via
- # pytest
- # pytest-cov
-pytest==8.3.5
- # via pytest-cov
-pytest-cov==7.0.0
+pygments==2.20.0
+ # via pytest
+pytest==9.0.3
+ # via -r dev_requirements.in
+ruff==0.15.12
# via -r dev_requirements.in
-ruff==0.13.2
+ty==0.0.34
# via -r dev_requirements.in
-tomli==2.2.1
- # via
- # coverage
- # mypy
- # pytest
-typing-extensions==4.13.0
- # via mypy
scripts/run_concurrently_tests.sh (0) → scripts/run_concurrently_tests.sh (666)
diff --git a/scripts/run_concurrently_tests.sh b/scripts/run_concurrently_tests.sh
new file mode 100755
index 0000000..c3a6980
--- /dev/null
+++ b/scripts/run_concurrently_tests.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+
+set -o errexit
+set -o nounset
+
+# Print a command in blue, then run the command
+run_command() {
+ echo ""
+ echo -e "\033[34m-> $@\033[0m"
+ bash -c "$@"
+}
+
+report_coverage() {
+ echo ""
+ echo -e "\033[34m-> python3 -m coverage report\033[0m"
+ if [[ $(python3 -m coverage report --format=total) = "100" ]]
+ then
+ echo "100% coverage!"
+ else
+ python3 -m coverage
+ fi
+}
+
+run_command 'ruff format'
+
+if [[ "${CI:-}" == "true" ]]
+then
+ run_command 'git diff --exit-code'
+fi
+
+run_command 'ruff check'
+run_command 'ty check .'
+run_command "python3 -m coverage run -m pytest -q test_concurrently.py"
+report_coverage