| 1 | #!/bin/bash |
| 2 | set -eu |
| 3 | |
| 4 | cd "$(dirname "$0")" |
| 5 | cd .. # git root |
| 6 | |
| 7 | if ! command -v sudo; then |
| 8 | # CI or Docker sometimes doesn't have it, so useful to have a dummy |
| 9 | function sudo { |
| 10 | "$@" |
| 11 | } |
| 12 | fi |
| 13 | |
| 14 | # --parallel-live to show outputs while it's running |
| 15 | tox_cmd='run-parallel --parallel-live' |
| 16 | if [ -n "${CI-}" ]; then |
| 17 | # install OS specific stuff here |
| 18 | case "$OSTYPE" in |
| 19 | darwin*) |
| 20 | # macos |
| 21 | : |
| 22 | ;; |
| 23 | cygwin* | msys* | win*) |
| 24 | # windows |
| 25 | # ugh. parallel stuff seems super flaky under windows, some random failures, "file used by other process" and crap like that |
| 26 | tox_cmd='run' |
| 27 | ;; |
| 28 | *) |
| 29 | # must be linux? |
| 30 | : |
| 31 | ;; |
| 32 | esac |
| 33 | fi |
| 34 | |
| 35 | # NOTE: expects uv installed |
| 36 | uv tool run --with tox-uv tox $tox_cmd "$@" |