Skip to content

Commit 364461c

Browse files
committed
Merge remote-tracking branch 'upstream/main' into tox-ini-to-pyproject
2 parents 6148665 + 6ef1fdb commit 364461c

7 files changed

Lines changed: 76 additions & 54 deletions

File tree

.github/workflows/docs.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
name: Build & Upload Artifact
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v6
21+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2222
with:
2323
persist-credentials: false
2424

25-
- uses: actions/setup-python@v6
25+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2626
with:
2727
python-version: "3.13"
2828

@@ -41,7 +41,7 @@ jobs:
4141
working-directory: ./docs
4242

4343
- name: Upload artifact
44-
uses: actions/upload-artifact@v6
44+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
4545
with:
4646
name: docs
4747
path: docs/_build
@@ -52,15 +52,15 @@ jobs:
5252
needs: build-docs
5353
if: contains(github.ref, 'tags')
5454
steps:
55-
- uses: actions/checkout@v6
55+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5656
with:
5757
persist-credentials: false
58-
- uses: actions/download-artifact@v7.0.0
58+
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
5959
with:
6060
name: docs
6161

6262
- name: Push to GitHub pages
63-
uses: JamesIves/github-pages-deploy-action@9d877eea73427180ae43cf98e8914934fe157a1a # v4
63+
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
6464
with:
6565
folder: html
6666
ssh-key: ${{ secrets.DEPLOY_KEY }}

.github/workflows/publish.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build distribution 📦
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
12+
with:
13+
persist-credentials: false
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
17+
with:
18+
python-version: "3.x"
19+
20+
- name: Install pypa/build
21+
run: >-
22+
python3 -m
23+
pip install
24+
build
25+
--user
26+
27+
- name: Build a binary wheel and a source tarball
28+
run: python3 -m build
29+
30+
- name: Store the distribution packages
31+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
32+
with:
33+
name: python-package-distributions
34+
path: dist/
35+
36+
publish-to-pypi:
37+
name: >-
38+
Publish Python 🐍 distribution 📦 to PyPI
39+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
40+
needs:
41+
- build
42+
runs-on: ubuntu-latest
43+
environment:
44+
name: pypi
45+
url: https://pypi.org/p/napari-matplotlib # Replace <package-name> with your PyPI project name
46+
permissions:
47+
id-token: write # IMPORTANT: mandatory for trusted publishing
48+
49+
steps:
50+
- name: Download all the dists
51+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
52+
with:
53+
name: python-package-distributions
54+
path: dist/
55+
- name: Publish distribution 📦 to PyPI
56+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
name: precommit
2424
runs-on: ubuntu-latest
2525
steps:
26-
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
26+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2727
with:
2828
fetch-depth: 0
29-
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
29+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
3030
with:
3131
python-version: "3.x"
3232
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
@@ -42,12 +42,12 @@ jobs:
4242
python-version: ["3.11", "3.12", "3.13"]
4343

4444
steps:
45-
- uses: actions/checkout@v6
45+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4646
with:
4747
persist-credentials: false
4848

4949
- name: Set up Python ${{ matrix.python-version }}
50-
uses: actions/setup-python@v6
50+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
5151
with:
5252
python-version: ${{ matrix.python-version }}
5353

@@ -71,7 +71,7 @@ jobs:
7171
run: python -m tox
7272

7373
- name: Upload pytest test results
74-
uses: actions/upload-artifact@v6
74+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
7575
with:
7676
name: pytest-results-${{ matrix.platform }} py${{ matrix.python-version }}
7777
path: reports/
@@ -86,34 +86,3 @@ jobs:
8686
with:
8787
token: ${{ secrets.CODECOV_TOKEN }}
8888
fail_ci_if_error: false
89-
90-
deploy:
91-
# this will run when you have tagged a commit, starting with "v*"
92-
# and requires that you have put your twine API key in your
93-
# github secrets (see readme for details)
94-
needs: [test]
95-
runs-on: ubuntu-latest
96-
if: contains(github.ref, 'tags')
97-
environment: pypi-deploy
98-
permissions:
99-
id-token: write
100-
steps:
101-
- uses: actions/checkout@v6
102-
with:
103-
persist-credentials: false
104-
- name: Set up Python
105-
uses: actions/setup-python@v6
106-
with:
107-
python-version: "3.x"
108-
- name: Install build
109-
run: |
110-
python -m pip install --upgrade pip
111-
python -m pip install --upgrade build
112-
113-
- name: Build package
114-
run: |
115-
git tag
116-
python -m build .
117-
118-
- name: Publish package
119-
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repos:
77
- id: trailing-whitespace
88

99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.13.1
10+
rev: v0.14.10
1111
hooks:
1212
- id: ruff-format
1313

@@ -17,14 +17,14 @@ repos:
1717
- id: napari-plugin-checks
1818

1919
- repo: https://github.com/pre-commit/mirrors-mypy
20-
rev: v1.18.2
20+
rev: v1.19.1
2121
hooks:
22-
- id: mypy
23-
additional_dependencies: [numpy, matplotlib]
22+
- id: mypy
23+
additional_dependencies: [numpy>=2.1, matplotlib]
2424

2525
- repo: https://github.com/astral-sh/ruff-pre-commit
2626
# Ruff version.
27-
rev: 'v0.13.1'
27+
rev: "v0.14.10"
2828
hooks:
2929
- id: ruff
3030

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
[![Python Version](https://img.shields.io/pypi/pyversions/napari-matplotlib.svg?color=green)](https://python.org)
66
[![tests](https://github.com/matplotlib/napari-matplotlib/workflows/tests/badge.svg)](https://github.com/matplotlib/napari-matplotlib/actions)
77
[![codecov](https://codecov.io/gh/matplotlib/napari-matplotlib/branch/main/graph/badge.svg)](https://codecov.io/gh/matplotlib/napari-matplotlib)
8-
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/matplotlib/pytest-mpl/master.svg)](https://results.pre-commit.ci/latest/github/matplotlib/pytest-mpl/master)
98
[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-matplotlib)](https://napari-hub.org/plugins/napari-matplotlib)
9+
[![SPEC 0 — Minimum Supported Dependencies](https://img.shields.io/badge/SPEC-0-green?labelColor=%23004811&color=%235CA038)](https://scientific-python.org/specs/spec-0000/)
1010

1111
A plugin to create Matplotlib plots from napari layers
1212

13-
----------------------------------
13+
---
1414

1515
## Introduction
16+
1617
`napari-matplotlib` is a bridge between `napari` and `matplotlib`, making it easy to create publication quality `Matplotlib` plots based on the data loaded in `napari` layers.
1718

1819
Documentation can be found at https://napari-matplotlib.github.io/
@@ -33,9 +34,7 @@ If you encounter any problems, please [file an issue] along with a detailed desc
3334

3435
[@napari]: https://github.com/napari
3536
[BSD-3]: http://opensource.org/licenses/BSD-3-Clause
36-
3737
[file an issue]: https://github.com/dstansby/napari-matplotlib/issues
38-
3938
[napari]: https://github.com/napari/napari
4039
[tox]: https://tox.readthedocs.io/en/latest/
4140
[pip]: https://pypi.org/project/pip/

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ filterwarnings = [
8484
"ignore:`np.bool8` is a deprecated alias for `np.bool_`:DeprecationWarning",
8585
# Coming from pydantic via napari
8686
"ignore:Pickle, copy, and deepcopy support will be removed from itertools in Python 3.14.:DeprecationWarning",
87-
# Until we stop supporting older numpy versions (<2.1)
88-
"ignore:(?s).*`newshape` keyword argument is deprecated.*$:DeprecationWarning",
8987
]
9088
qt_api = "pyqt6"
9189
addopts = [

src/napari_matplotlib/tests/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def fig_to_array(fig: Figure) -> npt.NDArray[np.uint8]:
1515
io_buf.seek(0)
1616
img_arr: npt.NDArray[np.uint8] = np.reshape(
1717
np.frombuffer(io_buf.getvalue(), dtype=np.uint8),
18-
newshape=(int(fig.bbox.bounds[3]), int(fig.bbox.bounds[2]), -1),
18+
shape=(int(fig.bbox.bounds[3]), int(fig.bbox.bounds[2]), -1),
1919
)
2020
return img_arr
2121

0 commit comments

Comments
 (0)