Skip to content

Commit 674094f

Browse files
authored
build: drop python 3.8 add py3.13 (#671)
* build: add py3.13 * drop py3.8 * less min reqs * remove test * remove stardist-napari test
1 parent ca6b595 commit 674094f

Some content is hidden

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

43 files changed

+242
-242
lines changed

.github/workflows/test_and_deploy.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ jobs:
3030
os: [ubuntu-latest, macos-latest, windows-latest]
3131
qt: [pyqt6, pyside6]
3232
include:
33-
- python-version: "3.8"
33+
- python-version: "3.9"
3434
os: ubuntu-latest
3535
qt: pyqt5
36-
- python-version: "3.8"
36+
- python-version: "3.9"
37+
os: ubuntu-latest
38+
qt: pyside2
39+
- python-version: "3.9"
3740
os: macos-13
3841
qt: pyside2
39-
- python-version: "3.8"
40-
os: windows-latest
41-
qt: pyqt5
4242
- python-version: "3.9"
4343
os: macos-13
4444
qt: pyqt5
4545
- python-version: "3.9"
46-
os: ubuntu-latest
47-
qt: pyside2
46+
os: windows-latest
47+
qt: pyqt5
4848
- python-version: "3.10"
4949
os: ubuntu-latest
5050
qt: pyside2
@@ -54,6 +54,12 @@ jobs:
5454
- python-version: "3.12"
5555
os: ubuntu-latest
5656
qt: pyside6
57+
- python-version: "3.13"
58+
os: ubuntu-latest
59+
qt: pyside6
60+
- python-version: "3.13"
61+
os: windows-latest
62+
qt: pyqt6
5763

5864
test-min-reqs:
5965
name: Test min reqs
@@ -67,7 +73,7 @@ jobs:
6773
strategy:
6874
fail-fast: false
6975
matrix:
70-
python-version: ["3.8", "3.9", "3.10", "3.11"]
76+
python-version: ["3.9", "3.10", "3.11"]
7177

7278
test-pydantic1:
7379
name: Test pydantic 1
@@ -106,9 +112,6 @@ jobs:
106112
package-version: "v0.4.19.post1"
107113
pytest-args: napari/_tests/test_magicgui.py
108114
- package: hanjinliu/magic-class
109-
- package: stardist/stardist-napari
110-
package-extras: test
111-
pytest-args: stardist_napari
112115
- package: 4DNucleome/PartSeg
113116
package-extras: test
114117
pytest-args: package/tests/test_PartSeg/test_napari_widgets.py

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ repos:
1818
rev: v0.7.3
1919
hooks:
2020
- id: ruff
21-
args: ["--fix"]
21+
args: ["--fix", "--unsafe-fixes"]
22+
- id: ruff-format
2223

2324
- repo: https://github.com/pre-commit/mirrors-mypy
2425
rev: v1.13.0

docs/examples/demo_widgets/file_dialog.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ def filepicker(filename=Path("~")) -> Path:
1515
return filename
1616

1717

18-
1918
filepicker.filename.changed.connect(print)
2019
filepicker.show(run=True)

docs/examples/demo_widgets/files_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
A dialog to select multiple files.
44
"""
55

6+
from collections.abc import Sequence
67
from pathlib import Path
7-
from typing import Sequence
88

99
from magicgui import magicgui
1010

docs/examples/demo_widgets/range_slider.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
A double ended range slider widget.
44
"""
55

6-
from typing import Tuple
7-
86
from magicgui import magicgui
97

108

119
@magicgui(auto_call=True, range_value={"widget_type": "RangeSlider", "max": 500})
12-
def func(range_value: Tuple[int, int] = (20, 380)):
10+
def func(range_value: tuple[int, int] = (20, 380)):
1311
"""Double ended range slider."""
1412
print(range_value)
1513

docs/examples/matplotlib/waveform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
from dataclasses import dataclass, field
77
from enum import Enum
88
from functools import partial
9+
from typing import Annotated
910

1011
import matplotlib.pyplot as plt
1112
import numpy as np
1213
from matplotlib.backends.backend_qt5agg import FigureCanvas
1314
from scipy import signal
14-
from typing_extensions import Annotated
1515

1616
from magicgui import magicgui, register_type, widgets
1717

docs/examples/napari/napari_img_math.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def image_arithmetic(
5858
# Add, subtracts, multiplies, or divides to image layers.
5959
return operation.value(layerA, layerB)
6060
61+
6162
# create a viewer and add a couple image layers
6263
viewer = napari.Viewer()
6364
viewer.add_image(numpy.random.rand(20, 20), name="Layer 1")
@@ -107,6 +108,7 @@ def image_arithmetic(array1, operation, array2):
107108
```python
108109
from napari.types import ImageData
109110
111+
110112
def image_arithmetic(
111113
layerA: ImageData, operation: Operation, layerB: ImageData
112114
) -> ImageData:

docs/examples/napari/napari_parameter_sweep.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def gaussian_blur(layer: ImageData, sigma: float = 1.0, mode="nearest") -> Image
6060
if layer is not None:
6161
return skimage.filters.gaussian(layer, sigma=sigma, mode=mode)
6262
63+
6364
# create a viewer and add some images
6465
viewer = napari.Viewer()
6566
viewer.add_image(skimage.data.astronaut().mean(-1), name="astronaut")
@@ -88,9 +89,7 @@ def gaussian_blur(layer: ImageData, sigma: float = 1.0, mode="nearest") -> Image
8889
the blur radius, and a `mode` that determines how edges are handled.
8990
9091
```python
91-
def gaussian_blur(
92-
layer: Image, sigma: float = 1, mode="nearest"
93-
) -> Image:
92+
def gaussian_blur(layer: Image, sigma: float = 1, mode="nearest") -> Image:
9493
return filters.gaussian(layer.data, sigma=sigma, mode=mode)
9594
```
9695
@@ -124,9 +123,7 @@ def gaussian_blur(
124123
sigma={"widget_type": "FloatSlider", "max": 6},
125124
mode={"choices": ["reflect", "constant", "nearest", "mirror", "wrap"]},
126125
)
127-
def gaussian_blur(
128-
layer: ImageData, sigma: float = 1.0, mode="nearest"
129-
) -> ImageData:
126+
def gaussian_blur(layer: ImageData, sigma: float = 1.0, mode="nearest") -> ImageData:
130127
# Apply a gaussian blur to ``layer``.
131128
if layer is not None:
132129
return skimage.filters.gaussian(layer, sigma=sigma, mode=mode)
@@ -152,8 +149,8 @@ def gaussian_blur(
152149
the result of our decorated function anytime it is called.
153150
154151
```python
155-
def do_something_with_result(result):
156-
...
152+
def do_something_with_result(result): ...
153+
157154
158155
gaussian_blur.called.connect(do_something_with_result)
159156
```

docs/examples/notebooks/magicgui_jupyter.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"\n",
2929
"use_app(\"ipynb\")\n",
3030
"\n",
31+
"\n",
3132
"class Medium(Enum):\n",
3233
" \"\"\"Enum for various media and their refractive indices.\"\"\"\n",
3334
"\n",
@@ -38,7 +39,7 @@
3839
"\n",
3940
"\n",
4041
"@magicgui(\n",
41-
" call_button=\"calculate\", result_widget=True, layout='vertical', auto_call=True\n",
42+
" call_button=\"calculate\", result_widget=True, layout=\"vertical\", auto_call=True\n",
4243
")\n",
4344
"def snells_law(aoi=1.0, n1=Medium.Glass, n2=Medium.Water, degrees=True):\n",
4445
" \"\"\"Calculate the angle of refraction given two media and an AOI.\"\"\"\n",

docs/examples/notebooks/magicgui_jupyter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
from enum import Enum
1212
1313
from magicgui import magicgui, use_app
14+
1415
use_app("ipynb")
1516
17+
1618
class Medium(Enum):
1719
# Various media and their refractive indices.
1820
Glass = 1.520
@@ -22,7 +24,7 @@ class Medium(Enum):
2224
2325
2426
@magicgui(
25-
call_button="calculate", result_widget=True, layout='vertical', auto_call=True
27+
call_button="calculate", result_widget=True, layout="vertical", auto_call=True
2628
)
2729
def snells_law(aoi=1.0, n1=Medium.Glass, n2=Medium.Water, degrees=True):
2830
# Calculate the angle of refraction given two media and an angle of incidence.

0 commit comments

Comments
 (0)