Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/copier/.copier-answers.python.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is @generated by <https://github.com/liblaf/copier-python>.
# DO NOT EDIT!
# prettier-ignore
_commit: 5602f9a
_commit: v0.1.10
_src_path: gh:liblaf/copier-python
answers_file_shared: .config/copier/.copier-answers.shared.yaml
namespace: liblaf
Expand Down
2 changes: 1 addition & 1 deletion .config/copier/.copier-answers.release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is @generated by <https://github.com/liblaf/copier-release>.
# DO NOT EDIT!
# prettier-ignore
_commit: 55dfc73
_commit: v0.1.3
_src_path: gh:liblaf/copier-release
release_type: python
2 changes: 1 addition & 1 deletion .config/copier/.copier-answers.shared.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is @generated by <https://github.com/liblaf/copier-shared>.
# DO NOT EDIT!
# prettier-ignore
_commit: 610df18
_commit: v0.1.4
_src_path: gh:liblaf/copier-shared
author_email: [email protected]
author_name: liblaf
Expand Down
3 changes: 0 additions & 3 deletions .config/copier/mise-tasks/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@ set -o errexit
set -o nounset
set -o pipefail

# ref: <https://github.com/scientific-python/lazy-loader#early-failure>
export EAGER_IMPORT=1

pytest -m 'benchmark' --numprocesses 0 --codspeed --codspeed-warmup-time='0.2' "$@"
6 changes: 3 additions & 3 deletions .config/copier/mise-tasks/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if [[ -f 'pixi.lock' ]]; then
fi

if [[ -f 'uv.lock' ]]; then
uv='uv'
if has uv-wrapper.sh; then uv='uv-wrapper.sh'; fi
"$uv" sync --all-extras --all-groups "$@"
uv_sync=(uv sync)
if has uv-sync.sh; then uv_sync=(uv-sync.sh); fi
"${uv_sync[@]}" "$@"
fi
4 changes: 4 additions & 0 deletions .config/copier/mise-tasks/lint/_default
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
# This file is @generated by <https://github.com/liblaf/copier-python>.
# DO NOT EDIT!
# [MISE] depends=["lint:python", "lint:toml"]
17 changes: 6 additions & 11 deletions .config/copier/mise-tasks/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,12 @@ set -o errexit
set -o nounset
set -o pipefail

function is-in-ci() {
if [[ -z ${CI:-} ]]; then
function in-ci() {
if [[ -n ${CI:-} ]]; then
return 0
else
return 1
fi
case "${CI,,}" in
1 | on | true | y | yes) return 0 ;;
0 | off | false | n | no | "") return 1 ;;
*)
echo "Invalid boolean: $CI." >&2
exit 1
;;
esac
}

function needs-gpu() {
Expand All @@ -37,12 +31,13 @@ else
numprocesses='auto'
fi

if is-in-ci; then
if in-ci; then
# ref: <https://docs.codecov.com/docs/test-analytics#1-output-a-junit-xml-file-in-your-ci>
pytest \
--junit-xml='junit.xml' --override-ini junit_family=legacy \
--cov --cov-branch \
--numprocesses "$numprocesses" \
--hypothesis-show-statistics \
"$@"
else
pytest --numprocesses "$numprocesses" "$@"
Expand Down
6 changes: 3 additions & 3 deletions .config/copier/mise-tasks/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [[ -f 'pixi.lock' ]]; then
fi

if [[ -f 'uv.lock' ]]; then
uv='uv'
if has uv-wrapper.sh; then uv='uv-wrapper.sh'; fi
"$uv" sync --upgrade "$@"
uv_sync=(uv sync)
if has uv-sync.sh; then uv_sync=(uv-sync.sh); fi
"${uv_sync[@]}" --upgrade "$@"
fi
19 changes: 11 additions & 8 deletions .config/copier/mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ edit_uri: blob/main/docs/

extra_css:
- https://cdn.jsdelivr.net/gh/liblaf/copier-python/docs/css/fonts.min.css
- https://cdn.jsdelivr.net/gh/liblaf/copier-python/docs/css/mkdocstrings/api-autonav.min.css
- https://cdn.jsdelivr.net/gh/liblaf/copier-python/docs/css/mkdocstrings/material.min.css
- https://cdn.jsdelivr.net/gh/liblaf/copier-python/docs/css/mkdocstrings/syntax-highlight-in-signatures.min.css

Expand Down Expand Up @@ -165,30 +164,33 @@ plugins:
# General
backlinks: tree
extensions:
# Official extensions
# Built-in
- dataclasses
- unpack_typeddict
# Official
- griffe_inherited_docstrings
- griffe_pydantic:
schema: true
- griffe_warnings_deprecated
# Third-party extensions
- docstring_inheritance.griffe
# - docstring_inheritance.griffe # crash
- griffe_fieldz:
include_inherited: true
# - griffe_generics # crash
# - griffe_inherited_method_crossrefs # does not work
find_stubs_package: true
show_inheritance_diagram: true
skip_local_inventory: true
# Headings
heading_level: 1
parameter_headings: true
show_root_heading: true
show_symbol_type_heading: true
show_symbol_type_toc: true
type_parameter_headings: true
# Members
inherited_members: true
filters:
- "!__all__"
- "!^_[^_]"
- "!^_$"
filters: public
summary: true
# Docstrings
docstring_style: google
Expand All @@ -201,9 +203,10 @@ plugins:
show_if_no_docstring: true
# Signatures
modernize_annotations: true
overloads_only: true
show_signature_annotations: true
show_signature_type_parameters: true
separate_signature: true
show_overloads: true
signature_crossrefs: true

# ---------------------------- External Plugins ---------------------------- #
Expand Down
8 changes: 3 additions & 5 deletions .config/direnv/10-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ if [[ -f 'pixi.lock' ]]; then
fi

if [[ -f 'uv.lock' ]]; then
uv='uv'
if has uv-wrapper.sh; then uv='uv-wrapper.sh'; fi
"$uv" sync --all-extras --all-groups
sed --in-place --regexp-extended \
's|\s*(include-system-site-packages)\s*=\s*.*\s*|\1 = true|' '.venv/pyvenv.cfg'
uv_sync=(uv sync)
if has uv-sync.sh; then uv_sync=(uv-sync.sh); fi
"${uv_sync[@]}"
# shellcheck disable=SC1091
source '.venv/bin/activate'
fi
Expand Down
3 changes: 2 additions & 1 deletion .config/linters/.ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ignore = [
"D107",
"E501",
"ERA001",
"EXE001",
"FIX002",
"INP001",
"PLC0415",
Expand All @@ -42,7 +43,7 @@ ignore = [
"TD002",
"TD003",
"TD004",
"TD005",
"TD005"
]
select = ["ALL"]

Expand Down
1 change: 0 additions & 1 deletion .config/release-please/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"section": "⏪️ Reverts"
}
],
"extra-label": "automerge",
"include-component-in-tag": false,
"always-update": true,
"initial-version": "0.1.0",
Expand Down
53 changes: 26 additions & 27 deletions .github/workflows/bench.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,56 @@ name: Bench

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
skip-duplicate:
name: Skip Duplicate
permissions:
actions: write
runs-on: ubuntu-latest
outputs:
should-skip: ${{ steps.skip-duplicate.outputs.should-skip }}
steps:
- id: skip-duplicate
name: Skip Duplicate
uses: liblaf/actions/skip-duplicate@dist
with:
cancel-others: true
env:
FORCE_COLOR: 1

collect:
name: Collect
needs:
- skip-duplicate
if: needs.skip-duplicate.outputs.should-skip != 'true'
jobs:
metadata:
name: Metadata
runs-on: ubuntu-latest
outputs:
has-benches: ${{ steps.collect.outputs.has-benches }}
python-versions: ${{ steps.inspect.outputs.supported_python_classifiers_json_array }}
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6
- id: inspect
name: Build and Inspect a Python Package
uses: hynek/build-and-inspect-python-package@v2
- name: Setup Python
uses: liblaf/actions/setup-python@dist
uses: liblaf/actions/setup-python@v1
- id: collect
name: Collect
run: |-
if pytest -m 'benchmark' --collect-only; then
echo 'has-benches=true' >> "$GITHUB_OUTPUT"
echo 'has-tests=true' >> "$GITHUB_OUTPUT"
else
echo 'has-benches=false' >> "$GITHUB_OUTPUT"
code="$?"
if (("$code" == 5)); then
echo 'has-tests=false' >> "$GITHUB_OUTPUT"
else
exit "$code"
fi
fi

# CodSpeedHQ does not support the same benchmark multiple times
# so we don't run on multiple python versions here.
bench:
name: Bench
needs:
- collect
if: needs.collect.outputs.has-benches == 'true'
- metadata
if: needs.metadata.outputs.has-benches == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: Setup Python
uses: liblaf/actions/setup-python@dist
uses: liblaf/actions/setup-python@v1
- name: Install Mise
uses: jdx/mise-action@v3
- name: Bench
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/build.yaml

This file was deleted.

Loading
Loading