Skip to content

Commit f09eb3e

Browse files
committed
chore: update project tooling and configuration
- Add Mise tasks for common development operations (benchmarking, initialization, installation, linting, testing, upgrading) - Update GitHub workflows to use liblaf/actions instead of liblaf/actions-ts - Simplify .gitignore to focus on essential Python patterns - Adjust VSCode settings for better development experience - Update Ruff configuration and remove explicit target version - Add documentation navigation structure - Update project metadata and dependencies in pyproject.toml - Improve code formatting in package initialization These changes improve development workflow consistency and maintainability across the project.
1 parent 3bd1d83 commit f09eb3e

21 files changed

Lines changed: 150 additions & 272 deletions

File tree

template/.config/copier/mise/tasks/bench.sh renamed to template/.config/copier/mise-tasks/bench.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ set -o pipefail
88
# ref: <https://github.com/scientific-python/lazy-loader#early-failure>
99
export EAGER_IMPORT=1
1010

11-
pytest --codspeed "$@"
11+
pytest -m 'benchmark' --numprocesses 0 --codspeed --codspeed-warmup-time='0.2' "$@"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
# This file is @generated by <https://github.com/liblaf/copier-python>.
3+
# DO NOT EDIT!
4+
set -o errexit
5+
set -o nounset
6+
set -o pipefail
7+
8+
function has() {
9+
type "$@" &> /dev/null
10+
}
11+
12+
TEMPLATE="\
13+
# >>> tangerine-start: lazy-loader.py >>>
14+
import lazy_loader as lazy
15+
16+
__getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__)
17+
# <<< tangerine-end <<<
18+
"
19+
20+
git_root=$(git rev-parse --show-toplevel)
21+
src_dir="$git_root/src"
22+
if [[ -d $src_dir ]]; then
23+
while IFS= read -d '' -r file; do
24+
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
31+
else
32+
if [[ ! -f $file ]]; then
33+
printf '%s' "$TEMPLATE" > "$file"
34+
else
35+
: # skip existing files
36+
fi
37+
fi
38+
done < <(find "$src_dir" -name '__init__.pyi' -type f -print0)
39+
fi
File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
# This file is @generated by <https://github.com/liblaf/copier-python>.
3+
# DO NOT EDIT!
4+
# [MISE] depends=["lint:python", "lint:toml"]
5+
set -o errexit
6+
set -o nounset
7+
set -o pipefail
File renamed without changes.
File renamed without changes.

template/.config/copier/mise/tasks/test.sh renamed to template/.config/copier/mise-tasks/test.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ function is-true() {
2020
export EAGER_IMPORT=1
2121

2222
if is-true "${CI-}"; then
23-
pytest --junit-xml="junit.xml" --cov --cov-branch --numprocesses="auto" "$@"
23+
# ref: <https://docs.codecov.com/docs/test-analytics#1-output-a-junit-xml-file-in-your-ci>
24+
pytest \
25+
--junit-xml='junit.xml' --override-ini junit_family=legacy \
26+
--cov --cov-branch \
27+
--numprocesses 'auto' \
28+
"$@"
2429
else
25-
pytest --numprocesses="auto" "$@"
30+
pytest --numprocesses 'auto' "$@"
2631
fi

template/.config/copier/mise/tasks/upgrade.sh renamed to template/.config/copier/mise-tasks/upgrade.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
2-
#MISE depends_post=["lint"]
32
# This file is @generated by <https://github.com/liblaf/copier-python>.
43
# DO NOT EDIT!
4+
# [MISE] depends_post=["lint"]
55
set -o errexit
66
set -o nounset
77
set -o pipefail

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

Lines changed: 0 additions & 40 deletions
This file was deleted.

template/.config/linters/.ruff.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ builtins = ["ic"]
66
exclude = ["_version.py"]
77
fix = true
88
show-fixes = true
9-
target-version = "py312"
109

1110
[format]
1211
docstring-code-format = true

0 commit comments

Comments
 (0)