Skip to content

Commit d9e27fb

Browse files
authored
Update template to v0.8.0 (resolved) (#761)
1 parent e9b3122 commit d9e27fb

14 files changed

Lines changed: 275 additions & 323 deletions

File tree

.cruft.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"template": "https://github.com/scverse/cookiecutter-scverse",
3-
"commit": "6ff5b92b5d44ea6d8a88e47538475718d467db95",
4-
"checkout": "v0.7.0",
3+
"commit": "6518dfa1abde7379ea7255daf0ce09c23f2b4c94",
4+
"checkout": "v0.8.0",
55
"context": {
66
"cookiecutter": {
77
"project_name": "spatialdata-plot",
@@ -13,6 +13,7 @@
1313
"github_repo": "spatialdata-plot",
1414
"license": "BSD 3-Clause License",
1515
"ide_integration": false,
16+
"issue_categorization": "",
1617
"_copy_without_render": [
1718
".github/workflows/build.yaml",
1819
".github/workflows/test.yaml",
@@ -36,7 +37,7 @@
3637
"trim_blocks": true
3738
},
3839
"_template": "https://github.com/scverse/cookiecutter-scverse",
39-
"_commit": "6ff5b92b5d44ea6d8a88e47538475718d467db95"
40+
"_commit": "6518dfa1abde7379ea7255daf0ce09c23f2b4c94"
4041
}
4142
},
4243
"directory": null

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Bug report
22
description: Report something that is broken or incorrect
3-
type: Bug
3+
labels: bug
44
body:
55
- type: markdown
66
attributes:
@@ -27,7 +27,7 @@ body:
2727
Which version of packages.
2828
2929
Please install `session-info2`, run the following command in a notebook,
30-
click the "Copy as Markdown" button, then paste the results into the text box below.
30+
click the Copy as Markdown button, then paste the results into the text box below.
3131
3232
```python
3333
In[1]: import session_info2; session_info2.session_info(dependencies=True)
@@ -39,3 +39,55 @@ body:
3939
>>> import session_info2; print(session_info2.session_info(dependencies=True)._repr_mimebundle_()["text/markdown"])
4040
```
4141
render: python
42+
placeholder: |
43+
anndata 0.11.3
44+
---- ----
45+
charset-normalizer 3.4.1
46+
coverage 7.7.0
47+
psutil 7.0.0
48+
dask 2024.7.1
49+
jaraco.context 5.3.0
50+
numcodecs 0.15.1
51+
jaraco.functools 4.0.1
52+
Jinja2 3.1.6
53+
sphinxcontrib-jsmath 1.0.1
54+
sphinxcontrib-htmlhelp 2.1.0
55+
toolz 1.0.0
56+
session-info2 0.1.2
57+
PyYAML 6.0.2
58+
llvmlite 0.44.0
59+
scipy 1.15.2
60+
pandas 2.2.3
61+
sphinxcontrib-devhelp 2.0.0
62+
h5py 3.13.0
63+
tblib 3.0.0
64+
setuptools-scm 8.2.0
65+
more-itertools 10.3.0
66+
msgpack 1.1.0
67+
sparse 0.15.5
68+
wrapt 1.17.2
69+
jaraco.collections 5.1.0
70+
numba 0.61.0
71+
pyarrow 19.0.1
72+
pytz 2025.1
73+
MarkupSafe 3.0.2
74+
crc32c 2.7.1
75+
sphinxcontrib-qthelp 2.0.0
76+
sphinxcontrib-serializinghtml 2.0.0
77+
zarr 2.18.4
78+
asciitree 0.3.3
79+
six 1.17.0
80+
sphinxcontrib-applehelp 2.0.0
81+
numpy 2.1.3
82+
cloudpickle 3.1.1
83+
sphinxcontrib-bibtex 2.6.3
84+
natsort 8.4.0
85+
jaraco.text 3.12.1
86+
setuptools 76.1.0
87+
Deprecated 1.2.18
88+
packaging 24.2
89+
python-dateutil 2.9.0.post0
90+
---- ----
91+
Python 3.13.2 | packaged by conda-forge | (main, Feb 17 2025, 14:10:22) [GCC 13.3.0]
92+
OS Linux-6.11.0-109019-tuxedo-x86_64-with-glibc2.39
93+
Updated 2025-03-18 15:47

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ blank_issues_enabled: false
22
contact_links:
33
- name: Scverse Community Forum
44
url: https://discourse.scverse.org/
5-
about: If you have questions about "How to do X", please ask them here.
5+
about: If you have questions about How to do X, please ask them here.

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
cooldown:
8+
default-days: 7
9+
groups:
10+
actions-deps:
11+
patterns:
12+
- "*"

.github/workflows/build.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,20 @@ concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref }}
1111
cancel-in-progress: true
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
package:
1518
runs-on: ubuntu-latest
1619
steps:
17-
- uses: actions/checkout@v5
20+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
1821
with:
1922
filter: blob:none
2023
fetch-depth: 0
24+
persist-credentials: false
2125
- name: Install uv
22-
uses: astral-sh/setup-uv@v7
26+
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
2327
- name: Build package
2428
run: uv build
2529
- name: Check package
@@ -28,14 +32,15 @@ jobs:
2832
docs:
2933
runs-on: ubuntu-latest
3034
steps:
31-
- uses: actions/checkout@v5
35+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
3236
with:
3337
submodules: true
3438
fetch-depth: 0
39+
persist-credentials: false
3540
- name: Pull latest notebooks
3641
# Match RTD: render whatever is on notebooks-repo main, not the pinned SHA.
3742
run: git submodule update --init --remote --recursive
3843
- name: Install uv
39-
uses: astral-sh/setup-uv@v7
44+
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
4045
- name: Build docs
41-
run: uvx --with="virtualenv<21" hatch run docs:build
46+
run: uvx hatch run docs:build

.github/workflows/release.yaml

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,30 @@ on:
44
release:
55
types: [published]
66

7-
concurrency:
8-
group: ${{ github.workflow }}-${{ github.ref }}
9-
cancel-in-progress: true
7+
# Use "trusted publishing", see https://docs.pypi.org/trusted-publishers/
8+
permissions: {}
109

1110
jobs:
12-
build:
11+
release:
12+
name: Upload release to PyPI
1313
runs-on: ubuntu-latest
14+
environment:
15+
name: pypi
16+
url: https://pypi.org/p/spatialdata_plot
17+
permissions:
18+
contents: read
19+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1420
steps:
15-
- uses: actions/checkout@v5
21+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
1622
with:
1723
filter: blob:none
1824
fetch-depth: 0
25+
persist-credentials: false
1926
- name: Install uv
20-
uses: astral-sh/setup-uv@v7
27+
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
28+
with:
29+
enable-cache: false
2130
- name: Build package
2231
run: uv build
23-
- name: Check package
24-
run: uvx twine check --strict dist/*
25-
- name: Upload build artifacts
26-
uses: actions/upload-artifact@v4
27-
with:
28-
name: dist
29-
path: dist/
30-
31-
publish:
32-
needs: build
33-
runs-on: ubuntu-latest
34-
permissions:
35-
id-token: write # for PyPI trusted publishing
36-
environment:
37-
name: pypi
38-
url: https://pypi.org/p/spatialdata-plot
39-
steps:
40-
- name: Download build artifacts
41-
uses: actions/download-artifact@v4
42-
with:
43-
name: dist
44-
path: dist/
45-
- name: Publish to PyPI
46-
uses: pypa/gh-action-pypi-publish@release/v1
32+
- name: Publish package distributions to PyPI
33+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0

.github/workflows/test.yaml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Test
33
on:
44
push:
55
branches: [main]
6-
tags: ["v*"]
76
pull_request:
87
branches: [main]
98
schedule:
@@ -13,23 +12,27 @@ concurrency:
1312
group: ${{ github.workflow }}-${{ github.ref }}
1413
cancel-in-progress: true
1514

16-
env:
17-
MPLBACKEND: agg
15+
permissions:
16+
contents: read
1817

1918
jobs:
20-
# Dynamically extract the test matrix from hatch so pyproject.toml is the single source of truth.
21-
# See [[tool.hatch.envs.hatch-test.matrix]] in pyproject.toml.
19+
# Get the test environment from hatch as defined in pyproject.toml.
20+
# This ensures that the pyproject.toml is the single point of truth for test definitions and the same tests are
21+
# run locally and on continuous integration.
22+
# Check [[tool.hatch.envs.hatch-test.matrix]] in pyproject.toml and https://hatch.pypa.io/latest/environment/ for
23+
# more details.
2224
get-environments:
23-
runs-on: ubuntu-latest
25+
runs-on: ubuntu-slim
2426
outputs:
2527
envs: ${{ steps.get-envs.outputs.envs }}
2628
steps:
27-
- uses: actions/checkout@v5
29+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2830
with:
2931
filter: blob:none
3032
fetch-depth: 0
33+
persist-credentials: false
3134
- name: Install uv
32-
uses: astral-sh/setup-uv@v7
35+
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
3336
- name: Get test environments
3437
id: get-envs
3538
run: |
@@ -44,10 +47,12 @@ jobs:
4447
)')
4548
echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT
4649
50+
# Run tests through hatch. Spawns a separate runner for each environment defined in the hatch matrix obtained above.
4751
test:
4852
needs: get-environments
4953
permissions:
5054
id-token: write # for codecov OIDC
55+
contents: read
5156

5257
strategy:
5358
fail-fast: false
@@ -57,23 +62,27 @@ jobs:
5762

5863
name: ${{ matrix.env.label }}
5964
runs-on: ${{ matrix.os }}
60-
continue-on-error: ${{ contains(matrix.env.name, 'pre') }}
65+
continue-on-error: ${{ contains(matrix.env.name, 'pre') }} # make "all-green" pass even if pre-release job fails
6166

6267
steps:
63-
- uses: actions/checkout@v5
68+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
6469
with:
6570
filter: blob:none
6671
fetch-depth: 0
72+
persist-credentials: false
6773
- name: Install uv
68-
uses: astral-sh/setup-uv@v7
74+
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
6975
with:
7076
python-version: ${{ matrix.env.python }}
7177
- name: Ensure figure directory exists
7278
run: mkdir -p tests/figures
7379
- name: Create hatch environment
7480
run: uvx hatch env create ${{ matrix.env.name }}
81+
- name: List all installed package versions
82+
run: uvx hatch run ${{ matrix.env.name }}:uv pip list
7583
- name: Run tests
7684
env:
85+
MPLBACKEND: agg
7786
DISPLAY: ":42"
7887
run: >-
7988
uvx hatch run ${{ matrix.env.name }}:${{
@@ -88,19 +97,19 @@ jobs:
8897
uvx hatch run ${{ matrix.env.name }}:cov-report
8998
- name: Archive visual test figures
9099
if: always()
91-
uses: actions/upload-artifact@v4
100+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
92101
with:
93102
name: visual_test_results_${{ matrix.env.name }}
94103
path: tests/figures/*
95104
- name: Upload coverage
96105
if: matrix.env.name == 'hatch-test.py3.14-stable'
97-
uses: codecov/codecov-action@v6
106+
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
98107
with:
99108
fail_ci_if_error: true
100109
use_oidc: true
101110

102-
# Single required check for branch protection.
103-
# See https://github.com/re-actors/alls-green#why
111+
# Check that all tests defined above pass. This makes it easy to set a single "required" test in branch
112+
# protection instead of having to update it frequently. See https://github.com/re-actors/alls-green#why.
104113
check:
105114
name: Tests pass in all hatch environments
106115
if: always()
@@ -109,6 +118,6 @@ jobs:
109118
- test
110119
runs-on: ubuntu-latest
111120
steps:
112-
- uses: re-actors/alls-green@release/v1
121+
- uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
113122
with:
114123
jobs: ${{ toJSON(needs) }}

.pre-commit-config.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ default_stages:
77
minimum_pre_commit_version: 2.16.0
88
repos:
99
- repo: https://github.com/biomejs/pre-commit
10-
rev: v2.4.14
10+
rev: v2.5.3
1111
hooks:
1212
- id: biome-format
13-
exclude: ^\.cruft\.json$ # inconsistent indentation with cruft
13+
exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually.
1414
- repo: https://github.com/tox-dev/pyproject-fmt
15-
rev: v2.21.1
15+
rev: v2.25.3
1616
hooks:
1717
- id: pyproject-fmt
1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: v0.15.12
19+
rev: v0.15.21
2020
hooks:
2121
- id: ruff-check
2222
types_or: [python, pyi, jupyter]
@@ -33,8 +33,16 @@ repos:
3333
args: [--fix=lf]
3434
- id: trailing-whitespace
3535
- id: check-case-conflict
36+
# Check that there are no merge conflicts (could be generated by template sync)
3637
- id: check-merge-conflict
3738
args: [--assume-in-merge]
39+
40+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
41+
rev: v1.24.1
42+
hooks:
43+
- id: zizmor
44+
args: [--no-progress, --fix]
45+
3846
- repo: https://github.com/pre-commit/mirrors-mypy
3947
rev: v1.20.2
4048
hooks:

0 commit comments

Comments
 (0)