Skip to content

Commit 8b48fea

Browse files
authored
chore: update ci and pre-commit (#717)
* fixes * update actions * pin pyside6 on 3.10 or lower * generally pin * process events * fix name
1 parent 549b7af commit 8b48fea

File tree

9 files changed

+31
-22
lines changed

9 files changed

+31
-22
lines changed

.github/workflows/deploy_docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
docs:
1313
runs-on: macos-latest # for the screenshots
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v6
1616
with:
1717
fetch-depth: 0
18-
- uses: astral-sh/setup-uv@v6
18+
- uses: astral-sh/setup-uv@v7
1919
with:
2020
enable-cache: true
2121

.github/workflows/test_and_deploy.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ jobs:
5858

5959

6060
steps:
61-
- uses: actions/checkout@v4
61+
- uses: actions/checkout@v6
6262
with:
6363
fetch-depth: 0
6464
fetch-tags: true
6565

6666
- name: 🐍 Set up Python ${{ matrix.python-version }}
67-
uses: astral-sh/setup-uv@v6
67+
uses: astral-sh/setup-uv@v7
6868
with:
6969
python-version: ${{ matrix.python-version }}
7070
enable-cache: true
@@ -95,7 +95,7 @@ jobs:
9595
update_existing: true
9696

9797
- name: Upload coverage
98-
uses: actions/upload-artifact@v4
98+
uses: actions/upload-artifact@v5
9999
with:
100100
name: covreport-${{ matrix.os }}-py${{ matrix.python-version }}-${{ matrix.add-group }}-${{ matrix.resolution }}
101101
path: ./.coverage*
@@ -113,12 +113,12 @@ jobs:
113113
os: [macos-latest]
114114

115115
steps:
116-
- uses: actions/checkout@v4
116+
- uses: actions/checkout@v6
117117
with:
118118
fetch-depth: 0
119119

120120
- name: 🐍 Set up Python ${{ matrix.python-version }}
121-
uses: astral-sh/setup-uv@v6
121+
uses: astral-sh/setup-uv@v7
122122
with:
123123
python-version: ${{ matrix.python-version }}
124124
enable-cache: true
@@ -128,7 +128,7 @@ jobs:
128128
run: uv run --no-dev --group pyqt6 coverage run -p -m pytest -v
129129

130130
- name: Upload coverage
131-
uses: actions/upload-artifact@v4
131+
uses: actions/upload-artifact@v5
132132
with:
133133
name: covreport-mindeps-${{ matrix.os }}-py${{ matrix.python-version }}
134134
path: ./.coverage*
@@ -169,7 +169,7 @@ jobs:
169169
needs: test
170170
runs-on: ubuntu-latest
171171
steps:
172-
- uses: actions/checkout@v4
172+
- uses: actions/checkout@v6
173173
with:
174174
fetch-depth: 0
175175
- uses: hynek/build-and-inspect-python-package@v2
@@ -184,7 +184,7 @@ jobs:
184184
contents: write
185185
steps:
186186
- name: Download built artifact to dist/
187-
uses: actions/download-artifact@v4
187+
uses: actions/download-artifact@v6
188188
with:
189189
name: Packages
190190
path: dist

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,4 @@ dmypy.json
136136
examples/_wip
137137
.ruff_cache
138138
docs/_images/
139+
uv.lock

.pre-commit-config.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,27 @@ repos:
99
hooks:
1010
- id: validate-pyproject
1111

12-
- repo: https://github.com/crate-ci/typos
13-
rev: v1.33.1
12+
- repo: https://github.com/rhysd/actionlint
13+
rev: v1.7.9
14+
hooks:
15+
- id: actionlint
16+
files: "^\\.github/workflows/.*\\.ya?ml$"
17+
18+
- repo: https://github.com/adhtruong/mirrors-typos
19+
rev: v1.40.0
1420
hooks:
1521
- id: typos
22+
args: [--force-exclude] # omitting --write-changes
1623

1724
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.11.12
25+
rev: v0.14.8
1926
hooks:
2027
- id: ruff-check
2128
args: ["--fix", "--unsafe-fixes"]
2229
- id: ruff-format
2330

2431
- repo: https://github.com/pre-commit/mirrors-mypy
25-
rev: v1.16.0
32+
rev: v1.19.0
2633
hooks:
2734
- id: mypy
2835
files: "^src/"

docs/examples/napari/napari_parameter_sweep.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
# - 'auto_call' tells magicgui to call the function when a parameter changes
4949
# - we use 'widget_type' to override the default "float" widget on sigma,
5050
# and provide a maximum valid value.
51-
# - we contstrain the possible choices for 'mode'
51+
# - we constrain the possible choices for 'mode'
5252
@magicgui(
5353
auto_call=True,
5454
sigma={"widget_type": "FloatSlider", "max": 6},
@@ -173,7 +173,7 @@ def do_something_with_result(result): ...
173173
# - 'auto_call' tells magicgui to call the function when a parameter changes
174174
# - we use 'widget_type' to override the default "float" widget on sigma,
175175
# and provide a maximum valid value.
176-
# - we contstrain the possible choices for 'mode'
176+
# - we constrain the possible choices for 'mode'
177177
@magicgui(
178178
auto_call=True,
179179
sigma={"widget_type": "FloatSlider", "max": 6},

docs/gallery_conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def qt_window_scraper(block: tuple, script: GalleryScript) -> str:
2525
Returns
2626
-------
2727
md : str
28-
The ReSTructuredText that will be rendered to HTML containing
28+
The reStructuredText that will be rendered to HTML containing
2929
the images. This is often produced by :func:`figure_md_or_html`.
3030
"""
3131
imgpath_iter = script.run_vars.image_path_iterator
@@ -61,7 +61,7 @@ def napari_image_scraper(block, script: GalleryScript):
6161
Returns
6262
-------
6363
md : str
64-
The ReSTructuredText that will be rendered to HTML containing
64+
The reStructuredText that will be rendered to HTML containing
6565
the images. This is often produced by :func:`figure_md_or_html`.
6666
"""
6767
viewer = napari.current_viewer()

src/magicgui/type_map/_type_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def match_type(self, type_: Any, default: Any | None = None) -> WidgetTuple | No
149149

150150
if safe_issubclass(origin, set):
151151
for arg in get_args(type_):
152-
if get_origin(arg) is Literal:
152+
if get_origin(arg) is Literal: # type: ignore [comparison-overlap]
153153
return widgets.Select, {"choices": get_args(arg)}
154154

155155
pint = sys.modules.get("pint")

src/magicgui/widgets/bases/_ranged_widget.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ def __init__(
240240
self._min_pos = min_pos
241241
self._max_pos = max_pos
242242
ValueWidget.__init__(
243-
self, # type: ignore
244-
value=value, # type: ignore
245-
bind=bind, # type: ignore
243+
self,
244+
value=value,
245+
bind=bind,
246246
nullable=nullable,
247247
**base_widget_kwargs,
248248
)

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def always_qapp(qapp):
1717
for w in qapp.topLevelWidgets():
1818
w.close()
1919
w.deleteLater()
20+
qapp.processEvents()
2021

2122

2223
@pytest.fixture(autouse=True, scope="function")

0 commit comments

Comments
 (0)