forked from ibis-project/ibis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
125 lines (100 loc) · 3.52 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# list justfile recipes
default:
just --list
# clean untracked files
clean:
git clean -fdx -e 'ci/ibis-testing-data'
# lock dependencies without updating existing versions
lock:
poetry lock --no-update
poetry export --extras all --with dev --with test --with docs --without-hashes --no-ansi > requirements-dev.txt
# show all backends
@list-backends:
yj -tj < pyproject.toml | \
jq -rcM '.tool.poetry.plugins["ibis.backends"] | keys[]' | grep -v '^spark' | sort
# format code
fmt:
black .
ruff --fix .
# 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
ruff .
# 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[@]}"
# run doctests
doctest *args:
#!/usr/bin/env bash
# TODO(cpcloud): why doesn't pytest --ignore-glob=test_*.py work?
pytest --doctest-modules {{ args }} $(
find \
ibis \
-wholename '*.py' \
-and -not -wholename '*test*.py' \
-and -not -wholename '*__init__*' \
-and -not -wholename '*gen_*.py' \
-and -not -wholename '*ibis/expr/selectors.py'
)
# 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[@]}"
if [ "{{ rev }}" != "master" ]; then
git -C "${outdir}" checkout "{{ rev }}"
fi
# start backends using docker compose; no arguments starts all backends
up *backends:
docker compose up --wait {{ backends }}
# stop and remove containers -> clean up dangling volumes -> start backends
reup *backends:
just down {{ backends }}
docker system prune --force --volumes
just up {{ backends }}
# stop and remove containers; clean up networks and volumes
down *backends:
#!/usr/bin/env bash
if [ -z "{{ backends }}" ]; then
docker compose down --volumes --remove-orphans
else
docker compose rm {{ backends }} --force --stop --volumes
fi
# run the benchmark suite
bench +args='ibis/tests/benchmarks':
pytest --benchmark-only --benchmark-enable --benchmark-autosave {{ args }}
# run benchmarks and compare with a previous run
benchcmp *args:
just bench {{ args }} --benchmark-compare
# check for invalid links in a locally built version of the docs
checklinks *args:
#!/usr/bin/env bash
lychee --base site $(find site -name '*.html') {{ args }}
# view the changelog for upcoming release (use --pretty to format with glow)
view-changelog flags="":
#!/usr/bin/env bash
npx -y -p conventional-changelog-cli \
-- conventional-changelog --config ./.conventionalcommits.js \
| ([ "{{ flags }}" = "--pretty" ] && glow -p - || cat -)
# run the decouple script to check for prohibited inter-module dependencies
decouple *args:
python ci/check_disallowed_imports.py {{ args }}