Skip to content

Commit 8944245

Browse files
authored
chore(copier): update from template
1 parent a84cfb5 commit 8944245

File tree

9 files changed

+78
-28
lines changed

9 files changed

+78
-28
lines changed

.config/copier/.copier-answers.python.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file is @generated by <https://github.com/liblaf/copier-python>.
22
# DO NOT EDIT!
33
# prettier-ignore
4-
_commit: 5f6ae09
4+
_commit: 39dd415
55
_src_path: gh:liblaf/copier-python
66
answers_file_shared: .config/copier/.copier-answers.shared.yaml
77
namespace: ''
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is @generated by <https://github.com/liblaf/copier-release>.
22
# DO NOT EDIT!
33
# prettier-ignore
4-
_commit: 364efd9
4+
_commit: '2553280'
55
_src_path: gh:liblaf/copier-release
66
release_type: python

.config/copier/.copier-answers.shared.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file is @generated by <https://github.com/liblaf/copier-shared>.
22
# DO NOT EDIT!
33
# prettier-ignore
4-
_commit: cfddac2
4+
_commit: 05b1a7c
55
_src_path: gh:liblaf/copier-shared
66
author_email: [email protected]
77
author_name: liblaf

.config/copier/mise-tasks/gen/init.sh

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,42 @@ set -o errexit
55
set -o nounset
66
set -o pipefail
77

8+
function get-docstring() {
9+
local file=$1
10+
docstring="$(sed '/"""$/q' "$file")"
11+
if diff --brief "$file" <(echo "$docstring") > /dev/null; then
12+
return
13+
else
14+
echo -n "$docstring"
15+
fi
16+
}
17+
818
function has() {
919
type "$@" &> /dev/null
1020
}
1121

1222
TEMPLATE="\
13-
# >>> tangerine-start: lazy-loader.py >>>
1423
import lazy_loader as lazy
1524
1625
__getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__)
17-
# <<< tangerine-end <<<
18-
"
26+
del lazy"
1927

2028
git_root=$(git rev-parse --show-toplevel)
2129
src_dir="$git_root/src"
2230
if [[ -d $src_dir ]]; then
2331
while IFS= read -d '' -r file; do
2432
file="${file/%'.pyi'/'.py'}"
25-
if has tangerine; then
26-
if [[ ! -f $file ]]; then
27-
tangerine <<< "$TEMPLATE" > "$file"
28-
else
29-
tangerine --in-place "$file"
30-
fi
33+
if [[ ! -f $file ]]; then
34+
echo "$TEMPLATE" > "$file"
3135
else
32-
if [[ ! -f $file ]]; then
33-
printf '%s' "$TEMPLATE" > "$file"
34-
else
35-
: # skip existing files
36-
fi
36+
docstring=$(get-docstring "$file")
37+
{
38+
if [[ -n $docstring ]]; then
39+
echo "$docstring"
40+
echo
41+
fi
42+
echo "$TEMPLATE"
43+
} > "$file"
3744
fi
3845
done < <(find "$src_dir" -name '__init__.pyi' -type f -print0)
3946
fi

.config/copier/mise-tasks/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function is-in-ci() {
2121

2222
function needs-gpu() {
2323
for pkg in jax torch warp; do
24-
if python -c "import $pkg"; then
24+
if python -c "import $pkg" &> /dev/null; then
2525
return 0
2626
fi
2727
done

.config/release-please/config.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
},
3535
{
3636
"type": "build",
37-
"section": "👷 Builds"
37+
"section": "🛠 Builds"
3838
},
3939
{
4040
"type": "ci",
41-
"section": "🔧 Continuous Integration"
41+
"section": "⚙️ Continuous Integration"
4242
},
4343
{
4444
"type": "chore",
@@ -50,7 +50,6 @@
5050
"section": "⏪️ Reverts"
5151
}
5252
],
53-
"skip-changelog": true,
5453
"extra-label": "automerge",
5554
"include-component-in-tag": false,
5655
"always-update": true,

.github/workflows/bench.yaml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,34 @@ jobs:
2323
with:
2424
cancel-others: true
2525

26-
bench:
27-
name: Bench
26+
collect:
27+
name: Collect
2828
needs:
2929
- skip-duplicate
3030
if: needs.skip-duplicate.outputs.should-skip != 'true'
3131
runs-on: ubuntu-latest
32+
outputs:
33+
has-benches: ${{ steps.collect.outputs.has-benches }}
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v5
37+
- name: Setup Python
38+
uses: liblaf/actions/setup-python@dist
39+
- id: collect
40+
name: Collect
41+
run: |-
42+
if pytest -m 'benchmark' --collect-only; then
43+
echo 'has-benches=true' >> "$GITHUB_OUTPUT"
44+
else
45+
echo 'has-benches=false' >> "$GITHUB_OUTPUT"
46+
fi
47+
48+
bench:
49+
name: Bench
50+
needs:
51+
- collect
52+
if: needs.collect.outputs.has-benches == 'true'
53+
runs-on: ubuntu-latest
3254
steps:
3355
- name: Checkout
3456
uses: actions/checkout@v5

.github/workflows/test.yaml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,33 @@ jobs:
2525
with:
2626
cancel-others: true
2727

28-
test:
29-
name: Test
28+
collect:
29+
name: Collect
3030
needs:
3131
- skip-duplicate
3232
if: needs.skip-duplicate.outputs.should-skip != 'true'
33+
runs-on: ubuntu-latest
34+
outputs:
35+
has-tests: ${{ steps.collect.outputs.has-tests }}
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v5
39+
- name: Setup Python
40+
uses: liblaf/actions/setup-python@dist
41+
- id: collect
42+
name: Collect
43+
run: |-
44+
if pytest --collect-only; then
45+
echo 'has-tests=true' >> "$GITHUB_OUTPUT"
46+
else
47+
echo 'has-tests=false' >> "$GITHUB_OUTPUT"
48+
fi
49+
50+
test:
51+
name: Test
52+
needs:
53+
- collect
54+
if: needs.collect.outputs.has-tests == 'true'
3355
permissions:
3456
id-token: write
3557
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ ci:
2222

2323
repos:
2424
- repo: https://github.com/astral-sh/ruff-pre-commit
25-
rev: v0.12.10
25+
rev: v0.12.12
2626
hooks:
2727
- id: ruff-check
2828
args:
2929
- --fix
3030
- id: ruff-format
3131
- repo: https://github.com/biomejs/pre-commit
32-
rev: v2.2.0
32+
rev: v2.2.3
3333
hooks:
3434
- id: biome-check
3535
exclude: \.jsonc?$
3636
- repo: https://github.com/iterative/dvc
37-
rev: 3.62.0
37+
rev: 3.63.0
3838
hooks:
3939
- id: dvc-post-checkout
4040
always_run: true

0 commit comments

Comments
 (0)