Skip to content

Commit 95ed596

Browse files
timtreisclaude
andcommitted
Merge main into feature/outline_color_for_labels to resolve conflicts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 parents 9485058 + 2893343 commit 95ed596

File tree

59 files changed

+1418
-467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1418
-467
lines changed

.cruft.json

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"template": "https://github.com/scverse/cookiecutter-scverse",
3-
"commit": "87a407a65408d75a949c0b54b19fd287475a56f8",
4-
"checkout": "v0.4.0",
3+
"commit": "6ff5b92b5d44ea6d8a88e47538475718d467db95",
4+
"checkout": "v0.7.0",
55
"context": {
66
"cookiecutter": {
77
"project_name": "spatialdata-plot",
@@ -10,19 +10,33 @@
1010
"author_full_name": "scverse",
1111
"author_email": "scverse",
1212
"github_user": "scverse",
13-
"project_repo": "https://github.com/scverse/spatialdata-plot",
13+
"github_repo": "spatialdata-plot",
1414
"license": "BSD 3-Clause License",
15+
"ide_integration": false,
1516
"_copy_without_render": [
1617
".github/workflows/build.yaml",
1718
".github/workflows/test.yaml",
1819
"docs/_templates/autosummary/**.rst"
1920
],
21+
"_exclude_on_template_update": [
22+
"CHANGELOG.md",
23+
"LICENSE",
24+
"README.md",
25+
"docs/api.md",
26+
"docs/index.md",
27+
"docs/notebooks/example.ipynb",
28+
"docs/references.bib",
29+
"docs/references.md",
30+
"src/**",
31+
"tests/**"
32+
],
2033
"_render_devdocs": false,
2134
"_jinja2_env_vars": {
2235
"lstrip_blocks": true,
2336
"trim_blocks": true
2437
},
25-
"_template": "https://github.com/scverse/cookiecutter-scverse"
38+
"_template": "https://github.com/scverse/cookiecutter-scverse",
39+
"_commit": "6ff5b92b5d44ea6d8a88e47538475718d467db95"
2640
}
2741
},
2842
"directory": null

.editorconfig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ charset = utf-8
88
trim_trailing_whitespace = true
99
insert_final_newline = true
1010

11-
[*.{yml,yaml}]
12-
indent_size = 2
13-
14-
[.cruft.json]
11+
[{*.{yml,yaml,toml},.cruft.json}]
1512
indent_size = 2
1613

1714
[Makefile]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Bug report
2+
description: Report something that is broken or incorrect
3+
type: Bug
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)
9+
detailing how to provide the necessary information for us to reproduce your bug. In brief:
10+
* Please provide exact steps how to reproduce the bug in a clean Python environment.
11+
* In case it's not clear what's causing this bug, please provide the data or the data generation procedure.
12+
* Replicate problems on public datasets or share data subsets when full sharing isn't possible.
13+
14+
- type: textarea
15+
id: report
16+
attributes:
17+
label: Report
18+
description: A clear and concise description of what the bug is.
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
id: versions
24+
attributes:
25+
label: Versions
26+
description: |
27+
Which version of packages.
28+
29+
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.
31+
32+
```python
33+
In[1]: import session_info2; session_info2.session_info(dependencies=True)
34+
```
35+
36+
Alternatively, run this in a console:
37+
38+
```python
39+
>>> import session_info2; print(session_info2.session_info(dependencies=True)._repr_mimebundle_()["text/markdown"])
40+
```
41+
render: python

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Scverse Community Forum
4+
url: https://discourse.scverse.org/
5+
about: If you have questions about "How to do X", please ask them here.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Feature request
2+
description: Propose a new feature for spatialdata-plot
3+
type: Enhancement
4+
body:
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Description of feature
9+
description: Please describe your suggestion for a new feature. It might help to describe a problem or use case, plus any alternatives that you have considered.
10+
validations:
11+
required: true

.github/workflows/build.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Check Build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
package:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v5
18+
with:
19+
filter: blob:none
20+
fetch-depth: 0
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v7
23+
- name: Build package
24+
run: uv build
25+
- name: Check package
26+
run: uvx twine check --strict dist/*.whl

.github/workflows/release.yaml

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

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
711
jobs:
8-
package_and_release:
12+
build:
913
runs-on: ubuntu-latest
10-
if: startsWith(github.ref, 'refs/tags/v')
1114
steps:
12-
- uses: actions/checkout@v3
13-
- name: Set up Python 3.12
14-
uses: actions/setup-python@v5
15+
- uses: actions/checkout@v5
1516
with:
16-
python-version: "3.12"
17-
cache: pip
18-
- name: Install build dependencies
19-
run: python -m pip install --upgrade pip wheel twine build
17+
filter: blob:none
18+
fetch-depth: 0
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v7
2021
- name: Build package
21-
run: python -m build
22+
run: uv build
2223
- name: Check package
23-
run: twine check --strict dist/*.whl
24-
- name: Install hatch
25-
run: pip install hatch
26-
- name: Build project for distribution
27-
run: hatch build
28-
- name: Publish a Python distribution to PyPI
29-
uses: pypa/gh-action-pypi-publish@release/v1
24+
run: uvx twine check --strict dist/*
25+
- name: Upload build artifacts
26+
uses: actions/upload-artifact@v4
3027
with:
31-
password: ${{ secrets.PYPI_API_TOKEN }}
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

.github/workflows/test.yaml

Lines changed: 88 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,112 @@ name: Test
33
on:
44
push:
55
branches: [main]
6-
tags: ["v*"] # Push events to matching v*, i.e. v1.0, v20.15.10
6+
tags: ["v*"]
77
pull_request:
8-
branches: ["*"]
8+
branches: [main]
9+
schedule:
10+
- cron: "0 5 1,15 * *"
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
env:
17+
MPLBACKEND: agg
918

1019
jobs:
11-
test:
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.
22+
get-environments:
1223
runs-on: ubuntu-latest
24+
outputs:
25+
envs: ${{ steps.get-envs.outputs.envs }}
26+
steps:
27+
- uses: actions/checkout@v5
28+
with:
29+
filter: blob:none
30+
fetch-depth: 0
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v7
33+
- name: Get test environments
34+
id: get-envs
35+
run: |
36+
ENVS_JSON=$(uvx hatch env show --json | jq -c 'to_entries
37+
| map(
38+
select(.key | startswith("hatch-test"))
39+
| {
40+
name: .key,
41+
label: (if (.key | contains("pre")) then .key + " (PRE-RELEASE DEPENDENCIES)" else .key end),
42+
python: .value.python
43+
}
44+
)')
45+
echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT
46+
47+
test:
48+
needs: get-environments
49+
permissions:
50+
id-token: write # for codecov OIDC
51+
1352
strategy:
1453
fail-fast: false
1554
matrix:
16-
env: ["dev-py311", "dev-py313"]
55+
os: [ubuntu-latest]
56+
env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
1757

18-
# Configure pytest-xdist
19-
env:
20-
OMP_NUM_THREADS: "1"
21-
OPENBLAS_NUM_THREADS: "1"
22-
MKL_NUM_THREADS: "1"
23-
NUMEXPR_MAX_THREADS: "1"
24-
MPLBACKEND: "agg"
25-
DISPLAY: ":42"
26-
PYTEST_ADDOPTS: "-n auto --dist=load --durations=10"
58+
name: ${{ matrix.env.label }}
59+
runs-on: ${{ matrix.os }}
60+
continue-on-error: ${{ contains(matrix.env.name, 'pre') }}
2761

2862
steps:
29-
- uses: actions/checkout@v4
30-
31-
# Cache rattler's shared package cache (speeds up downloads)
32-
- name: Restore rattler cache
33-
uses: actions/cache@v4
63+
- uses: actions/checkout@v5
3464
with:
35-
path: ~/.cache/rattler
36-
key: rattler-${{ runner.os }}-${{ matrix.env }}-${{ hashFiles('pyproject.toml') }}
37-
restore-keys: |
38-
rattler-${{ runner.os }}-${{ matrix.env }}-
39-
rattler-${{ runner.os }}-
40-
41-
# Install pixi and the requested environment
42-
- uses: prefix-dev/setup-pixi@v0.9.0
65+
filter: blob:none
66+
fetch-depth: 0
67+
- name: Install uv
68+
uses: astral-sh/setup-uv@v7
4369
with:
44-
environments: ${{ matrix.env }}
45-
# We're not comitting the pixi-lock file
46-
locked: false
47-
cache: false
48-
activate-environment: ${{ matrix.env }}
49-
50-
- name: Show versions
51-
run: |
52-
python --version
53-
pixi --version
54-
70+
python-version: ${{ matrix.env.python }}
71+
- name: Ensure figure directory exists
72+
run: mkdir -p tests/figures
73+
- name: Create hatch environment
74+
run: uvx hatch env create ${{ matrix.env.name }}
5575
- name: Run tests
5676
env:
57-
MPLBACKEND: agg
5877
DISPLAY: ":42"
78+
run: >-
79+
uvx hatch run ${{ matrix.env.name }}:${{
80+
matrix.env.name == 'hatch-test.py3.14-stable' && 'run-cov' || 'run'
81+
}} -v --color=yes ${{
82+
matrix.env.name == 'hatch-test.py3.14-stable' && ' ' || '-n auto'
83+
}}
84+
- name: Generate coverage report
85+
if: matrix.env.name == 'hatch-test.py3.14-stable'
5986
run: |
60-
pytest -v --cov --color=yes --cov-report=xml
61-
62-
- name: Archive figures generated during testing
87+
test -f .coverage || uvx hatch run ${{ matrix.env.name }}:cov-combine
88+
uvx hatch run ${{ matrix.env.name }}:cov-report
89+
- name: Archive visual test figures
6390
if: always()
6491
uses: actions/upload-artifact@v4
6592
with:
66-
name: visual_test_results_${{ matrix.env }}
67-
path: /home/runner/work/spatialdata-plot/spatialdata-plot/tests/figures/*
93+
name: visual_test_results_${{ matrix.env.name }}
94+
path: tests/figures/*
95+
- name: Upload coverage
96+
if: matrix.env.name == 'hatch-test.py3.14-stable'
97+
uses: codecov/codecov-action@v5
98+
with:
99+
fail_ci_if_error: true
100+
use_oidc: true
68101

69-
- name: Upload coverage to Codecov
70-
uses: codecov/codecov-action@v4
102+
# Single required check for branch protection.
103+
# See https://github.com/re-actors/alls-green#why
104+
check:
105+
name: Tests pass in all hatch environments
106+
if: always()
107+
needs:
108+
- get-environments
109+
- test
110+
runs-on: ubuntu-latest
111+
steps:
112+
- uses: re-actors/alls-green@release/v1
71113
with:
72-
name: coverage
73-
verbose: true
74-
env:
75-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
114+
jobs: ${{ toJSON(needs) }}

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ buck-out/
66
# Compiled files
77
.venv/
88
__pycache__/
9-
.mypy_cache/
10-
.ruff_cache/
9+
.*cache/
1110
/node_modules
1211

1312
# Distribution / packaging
@@ -16,7 +15,6 @@ __pycache__/
1615
/*.egg-info/
1716

1817
# Tests and coverage
19-
/.pytest_cache/
2018
/.cache/
2119
/data/
2220
*failed-diff.png
@@ -31,7 +29,6 @@ __pycache__/
3129

3230
format.sh
3331

34-
3532
# test
3633
tests/figures/
3734

0 commit comments

Comments
 (0)