dj-zarr-codecs 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dj_zarr_codecs-0.1.0/.git_archival.txt +3 -0
- dj_zarr_codecs-0.1.0/.gitattributes +1 -0
- dj_zarr_codecs-0.1.0/.github/CONTRIBUTING.md +124 -0
- dj_zarr_codecs-0.1.0/.github/dependabot.yml +21 -0
- dj_zarr_codecs-0.1.0/.github/release.yml +5 -0
- dj_zarr_codecs-0.1.0/.github/scripts/check_release_tag.sh +49 -0
- dj_zarr_codecs-0.1.0/.github/workflows/cd.yml +141 -0
- dj_zarr_codecs-0.1.0/.github/workflows/ci.yml +92 -0
- dj_zarr_codecs-0.1.0/.gitignore +141 -0
- dj_zarr_codecs-0.1.0/.pre-commit-config.yaml +95 -0
- dj_zarr_codecs-0.1.0/.python-version +1 -0
- dj_zarr_codecs-0.1.0/LICENSE +191 -0
- dj_zarr_codecs-0.1.0/PKG-INFO +195 -0
- dj_zarr_codecs-0.1.0/README.md +165 -0
- dj_zarr_codecs-0.1.0/docs/api.md +6 -0
- dj_zarr_codecs-0.1.0/docs/index.md +125 -0
- dj_zarr_codecs-0.1.0/mkdocs.yml +52 -0
- dj_zarr_codecs-0.1.0/noxfile.py +85 -0
- dj_zarr_codecs-0.1.0/pyproject.toml +204 -0
- dj_zarr_codecs-0.1.0/src/dj_zarr_codecs/__init__.py +12 -0
- dj_zarr_codecs-0.1.0/src/dj_zarr_codecs/_version.py +24 -0
- dj_zarr_codecs-0.1.0/src/dj_zarr_codecs/codecs.py +232 -0
- dj_zarr_codecs-0.1.0/src/dj_zarr_codecs/py.typed +0 -0
- dj_zarr_codecs-0.1.0/tests/__init__.py +0 -0
- dj_zarr_codecs-0.1.0/tests/conftest.py +138 -0
- dj_zarr_codecs-0.1.0/tests/test_codec.py +102 -0
- dj_zarr_codecs-0.1.0/tests/test_package.py +9 -0
- dj_zarr_codecs-0.1.0/uv.lock +2017 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.git_archival.txt export-subst
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
See the [Scientific Python Developer Guide][spc-dev-intro] for a detailed
|
|
2
|
+
description of best practices for developing scientific packages.
|
|
3
|
+
|
|
4
|
+
[spc-dev-intro]: https://learn.scientific-python.org/development/
|
|
5
|
+
|
|
6
|
+
# Quick development
|
|
7
|
+
|
|
8
|
+
The fastest way to start with development is to use nox. If you don't have nox,
|
|
9
|
+
you can use `uvx nox` to run it without installing, or `uv tool install nox`. If
|
|
10
|
+
you don't have uv, you can
|
|
11
|
+
[install it a variety of ways](https://docs.astral.sh/uv/getting-started/installation/),
|
|
12
|
+
including with pip, pipx, brew, and just downloading the binary (single file).
|
|
13
|
+
|
|
14
|
+
To use, run `nox`. This will lint and test using every installed version of
|
|
15
|
+
Python on your system, skipping ones that are not installed. You can also run
|
|
16
|
+
specific jobs:
|
|
17
|
+
|
|
18
|
+
```console
|
|
19
|
+
$ nox -s lint # Lint only
|
|
20
|
+
$ nox -s tests # Python tests
|
|
21
|
+
$ nox -s docs # Build and serve the docs
|
|
22
|
+
$ nox -s build # Make an SDist and wheel
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Nox handles everything for you, including setting up an temporary virtual
|
|
26
|
+
environment for each run.
|
|
27
|
+
|
|
28
|
+
# Setting up a development environment manually
|
|
29
|
+
|
|
30
|
+
You can set up a development environment by running:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
uv sync
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
# Pre-commit
|
|
37
|
+
|
|
38
|
+
You should prepare pre-commit or prek, which will help you by checking that
|
|
39
|
+
commits pass required checks:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
uv tool install pre-commit # or brew install pre-commit on macOS
|
|
43
|
+
pre-commit install # Will install a pre-commit hook into the git repo
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
You can also/alternatively run `pre-commit run` (changes only) or
|
|
47
|
+
`pre-commit run --all-files` to check even without installing the hook.
|
|
48
|
+
|
|
49
|
+
# Testing
|
|
50
|
+
|
|
51
|
+
Use pytest to run the unit checks:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
uv run pytest
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
# Coverage
|
|
58
|
+
|
|
59
|
+
Use pytest-cov to generate coverage reports:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
uv run pytest --cov=dj-zarr-codecs
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
# Building docs
|
|
66
|
+
|
|
67
|
+
You can build and serve the docs using:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
nox -s docs
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
You can build the docs only with:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
nox -s docs --non-interactive
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
# Releasing
|
|
80
|
+
|
|
81
|
+
A release is an annotated tag `vX.Y.Z` on `main` whose message is the release
|
|
82
|
+
notes. There is no changelog file: `git show vX.Y.Z` prints a release's notes,
|
|
83
|
+
and its GitHub release shows the same text.
|
|
84
|
+
|
|
85
|
+
1. Collect the pull requests merged since the last release (for the first
|
|
86
|
+
release, leave out `--search`):
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
gh pr list --state merged --base main --search "merged:>YYYY-MM-DD" --json number,title
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
2. Write `notes.md`. The first line is one sentence that says what the release
|
|
93
|
+
is about. Then, after a blank line, the changes grouped by area, each naming
|
|
94
|
+
its pull request. Put anything users must act on first.
|
|
95
|
+
|
|
96
|
+
```markdown
|
|
97
|
+
Arrays are written to the store named by the inserting connection's config.
|
|
98
|
+
|
|
99
|
+
## Storage
|
|
100
|
+
|
|
101
|
+
- `<zarr@>` resolves its store through the calling connection (#123)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
3. Tag the release commit on `main` and push the tag:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
git tag -a vX.Y.Z --cleanup=verbatim -F notes.md && git push origin vX.Y.Z
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`--cleanup=verbatim` keeps lines that start with `#`, such as Markdown
|
|
111
|
+
headings, which git would otherwise drop as comments.
|
|
112
|
+
|
|
113
|
+
Pushing the tag runs the [CD workflow](workflows/cd.yml). It checks that the tag
|
|
114
|
+
is annotated and on `main`, and refuses a lightweight tag (one made without
|
|
115
|
+
`-a`); runs the CI workflow; publishes the package built at the tag through PyPI
|
|
116
|
+
trusted publishing; and creates the GitHub release, with the tag's message as
|
|
117
|
+
its notes and the wheel and sdist attached.
|
|
118
|
+
|
|
119
|
+
The version comes from the tag: hatch-vcs derives it at build time, so there is
|
|
120
|
+
no version number to edit, and the workflow checks that the built files carry
|
|
121
|
+
the tag's version. If a job fails after the tag is pushed, fix the cause and
|
|
122
|
+
re-run the failed jobs from the workflow run; a fix that needs a new commit is
|
|
123
|
+
released under the next version. Never move or delete a pushed tag: the version
|
|
124
|
+
on PyPI and the GitHub release are tied to it.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
# Maintain dependencies for GitHub Actions
|
|
4
|
+
- package-ecosystem: "github-actions"
|
|
5
|
+
directory: "/"
|
|
6
|
+
schedule:
|
|
7
|
+
interval: "weekly"
|
|
8
|
+
groups:
|
|
9
|
+
actions:
|
|
10
|
+
patterns:
|
|
11
|
+
- "*"
|
|
12
|
+
|
|
13
|
+
# Maintain Python dependencies and uv.lock
|
|
14
|
+
- package-ecosystem: "uv"
|
|
15
|
+
directory: "/"
|
|
16
|
+
schedule:
|
|
17
|
+
interval: "weekly"
|
|
18
|
+
groups:
|
|
19
|
+
python:
|
|
20
|
+
patterns:
|
|
21
|
+
- "*"
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Decide whether a release tag can be published.
|
|
3
|
+
#
|
|
4
|
+
# check_release_tag.sh <tag> [<branch>]
|
|
5
|
+
#
|
|
6
|
+
# Fails on a tag that is not vX.Y.Z, on a lightweight tag, and on a tag whose
|
|
7
|
+
# commit is not on <branch> (default: master). Succeeds without publishing on a
|
|
8
|
+
# tag whose message has a "Retroactive:" line: such tags record past releases.
|
|
9
|
+
# Writes publish=true or publish=false to $GITHUB_OUTPUT when it is set.
|
|
10
|
+
set -euo pipefail
|
|
11
|
+
|
|
12
|
+
tag="${1:?usage: check_release_tag.sh <tag> [<branch>]}"
|
|
13
|
+
branch="${2:-master}"
|
|
14
|
+
output="${GITHUB_OUTPUT:-/dev/null}"
|
|
15
|
+
|
|
16
|
+
fail() {
|
|
17
|
+
echo "::error::$1" >&2
|
|
18
|
+
shift
|
|
19
|
+
for line in "$@"; do echo "$line" >&2; done
|
|
20
|
+
exit 1
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
[[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] || fail "$tag is not a release tag (vX.Y.Z)."
|
|
24
|
+
|
|
25
|
+
# actions/checkout can store an annotated tag as a lightweight ref, so fetch the
|
|
26
|
+
# tag object itself, and the branch the tag must be on.
|
|
27
|
+
git fetch --quiet --force origin "refs/tags/$tag:refs/tags/$tag"
|
|
28
|
+
git fetch --quiet --no-tags origin "+refs/heads/$branch:refs/remotes/origin/$branch"
|
|
29
|
+
|
|
30
|
+
if [[ "$(git cat-file -t "refs/tags/$tag")" != "tag" ]]; then
|
|
31
|
+
fail "$tag is a lightweight tag. A release tag is annotated, with the release notes as its message:" \
|
|
32
|
+
" git tag -d $tag" \
|
|
33
|
+
" git tag -a $tag <commit> --cleanup=verbatim -F notes.md" \
|
|
34
|
+
" git push --force origin refs/tags/$tag"
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
commit="$(git rev-parse "refs/tags/$tag^{commit}")"
|
|
38
|
+
if ! git merge-base --is-ancestor "$commit" "refs/remotes/origin/$branch"; then
|
|
39
|
+
fail "$tag points to $commit, which is not on $branch."
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
if git for-each-ref "refs/tags/$tag" --format='%(contents)' | grep -q '^Retroactive:'; then
|
|
43
|
+
echo "::notice::$tag records a past release (its message has a Retroactive: line); nothing to publish."
|
|
44
|
+
echo "publish=false" >> "$output"
|
|
45
|
+
exit 0
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
echo "$tag is an annotated tag on $branch; publishing."
|
|
49
|
+
echo "publish=true" >> "$output"
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
name: CD
|
|
2
|
+
|
|
3
|
+
# Pull requests and pushes to main build the package. A release is an annotated
|
|
4
|
+
# tag vX.Y.Z on main whose message is the release notes: pushing it checks the
|
|
5
|
+
# tag, runs the CI workflow, publishes the package built at the tag (hatch-vcs
|
|
6
|
+
# takes the version from the tag), and creates the GitHub release with the
|
|
7
|
+
# tag's message as its notes.
|
|
8
|
+
#
|
|
9
|
+
# PyPI trusted publishing is bound to this file's name and to the pypi
|
|
10
|
+
# environment, so neither can be renamed without updating PyPI.
|
|
11
|
+
on:
|
|
12
|
+
workflow_dispatch:
|
|
13
|
+
pull_request:
|
|
14
|
+
push:
|
|
15
|
+
branches:
|
|
16
|
+
- main
|
|
17
|
+
tags:
|
|
18
|
+
- "v[0-9]+.[0-9]+.[0-9]+"
|
|
19
|
+
|
|
20
|
+
concurrency:
|
|
21
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
22
|
+
# A newer push replaces a build in progress; a release is never cancelled.
|
|
23
|
+
cancel-in-progress: ${{ github.ref_type != 'tag' }}
|
|
24
|
+
|
|
25
|
+
permissions:
|
|
26
|
+
contents: read
|
|
27
|
+
|
|
28
|
+
env:
|
|
29
|
+
# Many color libraries just need this to be set to any value, but at least
|
|
30
|
+
# one distinguishes color depth, where "3" -> "256-bit color".
|
|
31
|
+
FORCE_COLOR: 3
|
|
32
|
+
|
|
33
|
+
jobs:
|
|
34
|
+
dist:
|
|
35
|
+
name: Distribution build
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
40
|
+
with:
|
|
41
|
+
fetch-depth: 0
|
|
42
|
+
persist-credentials: false
|
|
43
|
+
|
|
44
|
+
# v3 ships Twine 7, which understands packaging metadata 2.5 — what
|
|
45
|
+
# hatchling emits for a PEP 639 SPDX license. v2 bundles Twine 6 and
|
|
46
|
+
# fails `twine check --strict`. v3 no longer force-tags majors, so this
|
|
47
|
+
# pins the full version deliberately.
|
|
48
|
+
- uses: hynek/build-and-inspect-python-package@67230f7b8410ae0052b39c1efc89d89fff43ff10 # v3.0.2
|
|
49
|
+
|
|
50
|
+
check:
|
|
51
|
+
name: Check the release tag
|
|
52
|
+
if: github.ref_type == 'tag'
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
outputs:
|
|
55
|
+
publish: ${{ steps.check.outputs.publish }}
|
|
56
|
+
|
|
57
|
+
steps:
|
|
58
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
59
|
+
with:
|
|
60
|
+
fetch-depth: 0
|
|
61
|
+
persist-credentials: false
|
|
62
|
+
|
|
63
|
+
- name: Check the tag
|
|
64
|
+
id: check
|
|
65
|
+
run: .github/scripts/check_release_tag.sh "$GITHUB_REF_NAME" main
|
|
66
|
+
|
|
67
|
+
ci:
|
|
68
|
+
name: CI
|
|
69
|
+
needs: [check]
|
|
70
|
+
if: needs.check.outputs.publish == 'true'
|
|
71
|
+
uses: ./.github/workflows/ci.yml
|
|
72
|
+
secrets:
|
|
73
|
+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
74
|
+
|
|
75
|
+
publish:
|
|
76
|
+
needs: [dist, check, ci]
|
|
77
|
+
name: Publish to PyPI
|
|
78
|
+
environment: pypi
|
|
79
|
+
permissions:
|
|
80
|
+
id-token: write
|
|
81
|
+
attestations: write
|
|
82
|
+
contents: read
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
if: github.ref_type == 'tag' && needs.check.outputs.publish == 'true'
|
|
85
|
+
env:
|
|
86
|
+
TAG: ${{ github.ref_name }}
|
|
87
|
+
|
|
88
|
+
steps:
|
|
89
|
+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
90
|
+
with:
|
|
91
|
+
name: Packages
|
|
92
|
+
path: dist
|
|
93
|
+
|
|
94
|
+
- name: Check the built version
|
|
95
|
+
run: |
|
|
96
|
+
version="${TAG#v}"
|
|
97
|
+
for file in dist/*; do
|
|
98
|
+
case "$(basename "$file")" in
|
|
99
|
+
"dj_zarr_codecs-$version-"*.whl | "dj_zarr_codecs-$version.tar.gz") ;;
|
|
100
|
+
*) echo "::error::$file does not carry version $version"; exit 1 ;;
|
|
101
|
+
esac
|
|
102
|
+
done
|
|
103
|
+
|
|
104
|
+
- name: Generate artifact attestation for sdist and wheel
|
|
105
|
+
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
|
|
106
|
+
with:
|
|
107
|
+
subject-path: "dist/*"
|
|
108
|
+
|
|
109
|
+
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
|
|
110
|
+
|
|
111
|
+
release:
|
|
112
|
+
needs: [publish]
|
|
113
|
+
name: Create the GitHub release
|
|
114
|
+
runs-on: ubuntu-latest
|
|
115
|
+
permissions:
|
|
116
|
+
contents: write
|
|
117
|
+
env:
|
|
118
|
+
TAG: ${{ github.ref_name }}
|
|
119
|
+
|
|
120
|
+
steps:
|
|
121
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
122
|
+
with:
|
|
123
|
+
fetch-depth: 0
|
|
124
|
+
persist-credentials: false
|
|
125
|
+
|
|
126
|
+
- name: Fetch the tag object
|
|
127
|
+
# actions/checkout can store an annotated tag as a lightweight ref.
|
|
128
|
+
run: git fetch --force origin "refs/tags/$TAG:refs/tags/$TAG"
|
|
129
|
+
|
|
130
|
+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
131
|
+
with:
|
|
132
|
+
name: Packages
|
|
133
|
+
path: dist
|
|
134
|
+
|
|
135
|
+
- name: Create the GitHub release
|
|
136
|
+
env:
|
|
137
|
+
GH_TOKEN: ${{ github.token }}
|
|
138
|
+
run: |
|
|
139
|
+
git for-each-ref "refs/tags/$TAG" --format='%(contents)' > "$RUNNER_TEMP/notes.md"
|
|
140
|
+
gh release create "$TAG" --verify-tag --title "dj-zarr-codecs ${TAG#v}" \
|
|
141
|
+
--notes-file "$RUNNER_TEMP/notes.md" dist/*
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
pull_request:
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- main
|
|
9
|
+
# The CD workflow runs this as the test gate of a release.
|
|
10
|
+
workflow_call:
|
|
11
|
+
secrets:
|
|
12
|
+
CODECOV_TOKEN:
|
|
13
|
+
required: false
|
|
14
|
+
|
|
15
|
+
concurrency:
|
|
16
|
+
# "CI" rather than github.workflow, which in a run called from CD is "CD":
|
|
17
|
+
# sharing the caller's group is a deadlock, and GitHub cancels the run.
|
|
18
|
+
group: CI-${{ github.ref }}
|
|
19
|
+
cancel-in-progress: ${{ github.ref_type != 'tag' }}
|
|
20
|
+
|
|
21
|
+
permissions:
|
|
22
|
+
contents: read
|
|
23
|
+
|
|
24
|
+
env:
|
|
25
|
+
# Many color libraries just need this variable to be set to any value.
|
|
26
|
+
# Set it to 3 to support 8-bit color graphics (256 colors per channel)
|
|
27
|
+
# for libraries that care about the value set.
|
|
28
|
+
FORCE_COLOR: 3
|
|
29
|
+
|
|
30
|
+
jobs:
|
|
31
|
+
pre-commit:
|
|
32
|
+
name: Format
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
36
|
+
with:
|
|
37
|
+
fetch-depth: 0
|
|
38
|
+
persist-credentials: false
|
|
39
|
+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
40
|
+
with:
|
|
41
|
+
# Not "3.x", which now resolves to 3.15: the pylint session installs
|
|
42
|
+
# datajoint, whose dependency deepdiff 9.1 needs cachebox 5, which has
|
|
43
|
+
# no Python 3.15 build. Return to "3.x" once datajoint 2.3.5 is on PyPI:
|
|
44
|
+
# it supports Python 3.15 and keeps deepdiff below 9 there.
|
|
45
|
+
python-version: "3.14"
|
|
46
|
+
|
|
47
|
+
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
48
|
+
|
|
49
|
+
- name: Generate version file
|
|
50
|
+
run: uvx hatch build --hooks-only
|
|
51
|
+
|
|
52
|
+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
|
|
53
|
+
with:
|
|
54
|
+
extra_args: --hook-stage manual --all-files
|
|
55
|
+
- name: Run Pylint
|
|
56
|
+
run: uvx nox -s pylint -- --output-format=github
|
|
57
|
+
|
|
58
|
+
checks:
|
|
59
|
+
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
|
|
60
|
+
runs-on: ${{ matrix.runs-on }}
|
|
61
|
+
needs: [pre-commit]
|
|
62
|
+
strategy:
|
|
63
|
+
fail-fast: false
|
|
64
|
+
matrix:
|
|
65
|
+
python-version: ["3.11", "3.14"]
|
|
66
|
+
runs-on: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel]
|
|
67
|
+
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
70
|
+
with:
|
|
71
|
+
fetch-depth: 0
|
|
72
|
+
persist-credentials: false
|
|
73
|
+
|
|
74
|
+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
75
|
+
with:
|
|
76
|
+
python-version: ${{ matrix.python-version }}
|
|
77
|
+
allow-prereleases: true
|
|
78
|
+
|
|
79
|
+
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
80
|
+
|
|
81
|
+
- name: Install package
|
|
82
|
+
run: uv sync
|
|
83
|
+
|
|
84
|
+
- name: Test package
|
|
85
|
+
run: >-
|
|
86
|
+
uv run pytest -ra --cov --cov-report=xml --cov-report=term
|
|
87
|
+
--durations=20
|
|
88
|
+
|
|
89
|
+
- name: Upload coverage report
|
|
90
|
+
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
|
|
91
|
+
with:
|
|
92
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
*.manifest
|
|
31
|
+
*.spec
|
|
32
|
+
|
|
33
|
+
# Installer logs
|
|
34
|
+
pip-log.txt
|
|
35
|
+
pip-delete-this-directory.txt
|
|
36
|
+
|
|
37
|
+
# Unit test / coverage reports
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
.nox/
|
|
41
|
+
.coverage
|
|
42
|
+
.coverage.*
|
|
43
|
+
.cache
|
|
44
|
+
nosetests.xml
|
|
45
|
+
coverage.xml
|
|
46
|
+
*.cover
|
|
47
|
+
*.py,cover
|
|
48
|
+
.hypothesis/
|
|
49
|
+
.pytest_cache/
|
|
50
|
+
|
|
51
|
+
# Translations
|
|
52
|
+
*.mo
|
|
53
|
+
*.pot
|
|
54
|
+
|
|
55
|
+
# Django stuff:
|
|
56
|
+
*.log
|
|
57
|
+
local_settings.py
|
|
58
|
+
db.sqlite3
|
|
59
|
+
db.sqlite3-journal
|
|
60
|
+
|
|
61
|
+
# Flask stuff:
|
|
62
|
+
instance/
|
|
63
|
+
.webassets-cache
|
|
64
|
+
|
|
65
|
+
# Scrapy stuff:
|
|
66
|
+
.scrapy
|
|
67
|
+
|
|
68
|
+
# Sphinx documentation
|
|
69
|
+
docs/_build/
|
|
70
|
+
|
|
71
|
+
# PyBuilder
|
|
72
|
+
.pybuilder/
|
|
73
|
+
target/
|
|
74
|
+
|
|
75
|
+
# Jupyter Notebook
|
|
76
|
+
.ipynb_checkpoints
|
|
77
|
+
|
|
78
|
+
# IPython
|
|
79
|
+
profile_default/
|
|
80
|
+
ipython_config.py
|
|
81
|
+
|
|
82
|
+
# pipenv
|
|
83
|
+
Pipfile.lock
|
|
84
|
+
|
|
85
|
+
# PEP 582
|
|
86
|
+
__pypackages__/
|
|
87
|
+
|
|
88
|
+
# Celery stuff
|
|
89
|
+
celerybeat-schedule
|
|
90
|
+
celerybeat.pid
|
|
91
|
+
|
|
92
|
+
# SageMath parsed files
|
|
93
|
+
*.sage.py
|
|
94
|
+
|
|
95
|
+
# Environments
|
|
96
|
+
.env
|
|
97
|
+
.venv
|
|
98
|
+
env/
|
|
99
|
+
venv/
|
|
100
|
+
ENV/
|
|
101
|
+
env.bak/
|
|
102
|
+
venv.bak/
|
|
103
|
+
|
|
104
|
+
# Spyder project settings
|
|
105
|
+
.spyderproject
|
|
106
|
+
.spyproject
|
|
107
|
+
|
|
108
|
+
# Rope project settings
|
|
109
|
+
.ropeproject
|
|
110
|
+
|
|
111
|
+
# mkdocs documentation
|
|
112
|
+
/site
|
|
113
|
+
|
|
114
|
+
# mypy
|
|
115
|
+
.mypy_cache/
|
|
116
|
+
.dmypy.json
|
|
117
|
+
dmypy.json
|
|
118
|
+
|
|
119
|
+
# Pyre type checker
|
|
120
|
+
.pyre/
|
|
121
|
+
|
|
122
|
+
# pytype static type analyzer
|
|
123
|
+
.pytype/
|
|
124
|
+
|
|
125
|
+
# Cython debug symbols
|
|
126
|
+
cython_debug/
|
|
127
|
+
|
|
128
|
+
# Version file (auto-generated by hatch-vcs)
|
|
129
|
+
src/**/_version.py
|
|
130
|
+
|
|
131
|
+
# IDE
|
|
132
|
+
.idea/
|
|
133
|
+
.vscode/
|
|
134
|
+
*.swp
|
|
135
|
+
*.swo
|
|
136
|
+
*~
|
|
137
|
+
|
|
138
|
+
# OS
|
|
139
|
+
.DS_Store
|
|
140
|
+
Thumbs.db
|
|
141
|
+
site/
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
ci:
|
|
2
|
+
autoupdate_commit_msg: "chore(deps): update pre-commit hooks"
|
|
3
|
+
autofix_commit_msg: "style: pre-commit fixes"
|
|
4
|
+
autoupdate_schedule: "monthly"
|
|
5
|
+
|
|
6
|
+
exclude: ^.cruft.json|.copier-answers.yml$
|
|
7
|
+
|
|
8
|
+
repos:
|
|
9
|
+
- repo: https://github.com/adamchainz/blacken-docs
|
|
10
|
+
rev: "1.20.0"
|
|
11
|
+
hooks:
|
|
12
|
+
- id: blacken-docs
|
|
13
|
+
additional_dependencies: [black==25.*]
|
|
14
|
+
|
|
15
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
16
|
+
rev: "v6.0.0"
|
|
17
|
+
hooks:
|
|
18
|
+
- id: check-added-large-files
|
|
19
|
+
- id: check-case-conflict
|
|
20
|
+
- id: check-merge-conflict
|
|
21
|
+
- id: check-symlinks
|
|
22
|
+
- id: check-yaml
|
|
23
|
+
- id: debug-statements
|
|
24
|
+
- id: end-of-file-fixer
|
|
25
|
+
- id: mixed-line-ending
|
|
26
|
+
- id: name-tests-test
|
|
27
|
+
args: ["--pytest-test-first"]
|
|
28
|
+
- id: requirements-txt-fixer
|
|
29
|
+
- id: trailing-whitespace
|
|
30
|
+
|
|
31
|
+
- repo: https://github.com/pre-commit/pygrep-hooks
|
|
32
|
+
rev: "v1.10.0"
|
|
33
|
+
hooks:
|
|
34
|
+
- id: rst-backticks
|
|
35
|
+
- id: rst-directive-colons
|
|
36
|
+
- id: rst-inline-touching-normal
|
|
37
|
+
|
|
38
|
+
- repo: https://github.com/rbubley/mirrors-prettier
|
|
39
|
+
rev: "v3.7.4"
|
|
40
|
+
hooks:
|
|
41
|
+
- id: prettier
|
|
42
|
+
types_or: [yaml, markdown, html, css, scss, javascript, json]
|
|
43
|
+
args: [--prose-wrap=always]
|
|
44
|
+
|
|
45
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
46
|
+
rev: "v0.14.11"
|
|
47
|
+
hooks:
|
|
48
|
+
- id: ruff-check
|
|
49
|
+
args: ["--fix", "--show-fixes"]
|
|
50
|
+
- id: ruff-format
|
|
51
|
+
|
|
52
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
53
|
+
rev: "v1.19.1"
|
|
54
|
+
hooks:
|
|
55
|
+
- id: mypy
|
|
56
|
+
files: src|tests|noxfile.py
|
|
57
|
+
args: []
|
|
58
|
+
additional_dependencies:
|
|
59
|
+
- nox
|
|
60
|
+
- pytest
|
|
61
|
+
- numpy
|
|
62
|
+
- zarr
|
|
63
|
+
|
|
64
|
+
- repo: https://github.com/codespell-project/codespell
|
|
65
|
+
rev: "v2.4.1"
|
|
66
|
+
hooks:
|
|
67
|
+
- id: codespell
|
|
68
|
+
additional_dependencies:
|
|
69
|
+
- tomli; python_version<'3.11'
|
|
70
|
+
|
|
71
|
+
- repo: https://github.com/shellcheck-py/shellcheck-py
|
|
72
|
+
rev: "v0.11.0.1"
|
|
73
|
+
hooks:
|
|
74
|
+
- id: shellcheck
|
|
75
|
+
|
|
76
|
+
- repo: local
|
|
77
|
+
hooks:
|
|
78
|
+
- id: disallow-caps
|
|
79
|
+
name: Disallow improper capitalization
|
|
80
|
+
language: pygrep
|
|
81
|
+
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
|
|
82
|
+
exclude: .pre-commit-config.yaml
|
|
83
|
+
|
|
84
|
+
- repo: https://github.com/abravalheri/validate-pyproject
|
|
85
|
+
rev: "v0.24.1"
|
|
86
|
+
hooks:
|
|
87
|
+
- id: validate-pyproject
|
|
88
|
+
additional_dependencies: ["validate-pyproject-schema-store[all]"]
|
|
89
|
+
|
|
90
|
+
- repo: https://github.com/python-jsonschema/check-jsonschema
|
|
91
|
+
rev: "0.36.0"
|
|
92
|
+
hooks:
|
|
93
|
+
- id: check-dependabot
|
|
94
|
+
- id: check-github-workflows
|
|
95
|
+
- id: check-readthedocs
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|