-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile
More file actions
executable file
·93 lines (76 loc) · 2.19 KB
/
Taskfile
File metadata and controls
executable file
·93 lines (76 loc) · 2.19 KB
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
#!/bin/bash
# Copyright 2026 casaGeo Data + Services GmbH <info@casageo.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# SC2317: Command appears to be unreachable.
# SC2329: This function is never invoked.
# shellcheck disable=SC2317,SC2329
set -Ceufo pipefail
##############
# Main Tasks #
##############
run-checks() {
uv run ruff check
uv run ruff format --check
uv run mypy -- casageo tests
}
run-tests() {
run-smoke-tests
run-unit-tests
}
run-smoke-tests() {
uv run tests/smoke_test.py
}
run-unit-tests() {
uv run python -m unittest discover --start-directory='tests'
}
build() {
uv build
}
build-docs() {
sphinx-make html
}
#######################
# Supplementary Tasks #
#######################
sphinx-make() {
make -C docs SPHINXBUILD='uv run sphinx-build' "$@"
}
generate-fixtures() {
uv run tests/generate_fixtures.py
}
test-artifact() {
local artifact=$1
uv run --isolated --no-project --with="${artifact:?}" tests/smoke_test.py
}
extract-changelog-for-version() {
local version=$1 pattern
pattern=$(printf %s\\n "${version#v}" | sed 's/[][^$.*/\\]/\\&/g')
sed '/^##\s*\['"$pattern"'\]/!d;:x;n;/^##[^#]/Q;/^---/Q;bx' CHANGELOG.md
}
generate-release-information() {
local version infofile
version=$(uv version --short)
infofile="dist/RELEASE-${version}.md"
mkdir -p -- "${infofile%/*}"
extract-changelog-for-version "$version" >| "$infofile"
if ! [[ -s "$infofile" ]] && ! [[ "$version" == *.dev* ]]; then
[[ -f "$infofile" ]] && rm -- "$infofile"
printf >&2 %s\\n "ERROR: No entry for version $version in CHANGELOG.md"
return 1
fi
}
while [[ ${1-} == +([[:word:]])=* ]]; do declare -- "$1"; shift; done
time { set -x; "$@"; }; exit;