forked from ibis-project/ibis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
85 lines (68 loc) · 2.31 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# list justfile recipes
default:
just --list
# clean untracked files
clean:
git clean -fdx -e 'ci/ibis-testing-data'
# show all backends
@list-backends:
yj -tj < pyproject.toml | \
jq -rcM '.tool.poetry.plugins["ibis.backends"] | keys[]' | grep -v '^spark' | sort
# format code
fmt:
absolufy-imports ibis/**/*.py
black .
isort .
pyupgrade --py38-plus ibis/**/*.py
# run all non-backend tests; additional arguments are forwarded to pytest
check *args:
pytest -m core {{ args }}
# run pytest for ci; additional arguments are forwarded to pytest
ci-check *args:
poetry run pytest --junitxml=junit.xml --cov=ibis --cov-report=xml:coverage.xml {{ args }}
# lint code
lint:
black -q . --check
isort -q . --check
flake8 .
# type check code using mypy
typecheck:
mypy .
# run the test suite for one or more backends
test +backends:
#!/usr/bin/env bash
set -euo pipefail
pytest_args=("-m" "$(sed 's/ / or /g' <<< '{{ backends }}')")
if ! [[ "{{ backends }}" =~ impala|pyspark ]]; then
pytest_args+=("-n" "auto" "-q" "--dist" "loadgroup")
fi
pytest "${pytest_args[@]}"
# download testing data
download-data owner="ibis-project" repo="testing-data" rev="master":
#!/usr/bin/env bash
outdir="{{ justfile_directory() }}/ci/ibis-testing-data"
rm -rf "$outdir"
url="https://github.com/{{ owner }}/{{ repo }}"
args=("$url")
if [ "{{ rev }}" = "master" ]; then
args+=("--depth" "1")
fi
args+=("$outdir")
git clone "${args[@]}"
# start backends using docker compose; no arguments starts all backends
up *backends:
docker compose up --wait {{ backends }}
# stop and remove containers; clean up networks and volumes
down:
docker compose down --volumes --remove-orphans
# run the benchmark suite
bench +args='ibis/tests/benchmarks':
pytest --benchmark-only --benchmark-autosave {{ args }}
# check for invalid links in a locally built version of the docs
checklinks *args:
#!/usr/bin/env bash
mapfile -t files < <(find site -name '*.html' \
-and \( -not \( -wholename 'site/SUMMARY/index.html' \
-or -wholename 'site/user_guide/design/index.html' \
-or -wholename 'site/overrides/main.html' \) \))
lychee "${files[@]}" --base site --require-https {{ args }}