Skip to content

Commit 714c025

Browse files
committed
Test types across environments, remove inexistant setup.pyi, fix all issues on Python 3.13
1 parent 69869f3 commit 714c025

File tree

32 files changed

+27
-200
lines changed

32 files changed

+27
-200
lines changed

.github/workflows/test.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,24 @@ on: [push, pull_request, workflow_dispatch]
44

55
jobs:
66
test:
7-
runs-on: ubuntu-latest
7+
runs-on: ${{ matrix.os }}
88
timeout-minutes: 10
9+
strategy:
10+
matrix:
11+
# Oldest non-EOL and newest released
12+
python-version: ["3.9", "3.13"]
13+
# Tier 1 OSes
14+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
15+
fail-fast: false
916

1017
steps:
1118
- name: Check out code
1219
uses: actions/checkout@v2
1320

14-
- name: Setup Python
21+
- name: Setup Python ${{ matrix.python-version }}
1522
uses: actions/setup-python@v2
1623
with:
17-
python-version: "3.11"
24+
python-version: ${{ matrix.python-version }}
1825

1926
- name: Cache pip
2027
uses: actions/cache@v4
@@ -31,9 +38,10 @@ jobs:
3138
uses: jakebailey/pyright-action@v2
3239
with:
3340
pylance-version: latest-prerelease
41+
python-version: ${{ matrix.python-version }}
3442

3543
- name: Run mypy tests
36-
run: python -m mypy .
44+
run: python -m mypy . --python-version=${{ matrix.python-version }}
3745

3846
hygiene:
3947
runs-on: ubuntu-latest
@@ -45,4 +53,5 @@ jobs:
4553

4654
- name: Run Ruff Linter
4755
uses: astral-sh/ruff-action@v3
48-
- run: ruff format --check
56+
- name: Run Ruff Formatter
57+
run: ruff format --check

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ MigrationBackup/
357357
# Python virtual environment
358358
.venv
359359

360+
# Lock files (like uv.lock)
361+
*.lock
362+
360363
# Build files from utils
361364
.eggs
362365
*.egg-info

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ hygiene = ["ruff ==0.11.*"]
1111
tests = [
1212
# Tools used for testing
1313
"docopt-ng",
14-
"mypy ==1.13.*",
14+
"mypy ==1.15.*",
1515
"pyright",
1616

1717
# Typed libraries and stubs
@@ -112,7 +112,7 @@ extra-standard-library = [
112112
]
113113

114114
[tool.pyright]
115-
exclude = ["build", ".git"]
115+
exclude = ["build", ".git", ".venv*"]
116116
stubPath = "./stubs"
117117
pythonversion = "3.9" # Target oldest supported Python version
118118
typeCheckingMode = "standard"

stubs/matplotlib/_mathtext.pyi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
import enum
22
import functools
3+
import sys
34
from tkinter.tix import HList
45
from typing import Literal
56

67
from .font_manager import FontProperties
78
from .mathtext import MathtextBackend
89

10+
# tkinter.tix was removed from Python 3.13
11+
# Recent matplotlib versions define HList in this module
12+
if sys.version_info >= (3, 13):
13+
HList = ...
14+
else:
15+
from tkinter.tix import HList
16+
917
def get_unicode_index(symbol: str, math: bool = True) -> int: ...
1018

1119
class Fonts:

stubs/skimage/_shared/setup.pyi

Lines changed: 0 additions & 7 deletions
This file was deleted.

stubs/skimage/draw/setup.pyi

Lines changed: 0 additions & 7 deletions
This file was deleted.

stubs/skimage/future/graph/setup.pyi

Lines changed: 0 additions & 7 deletions
This file was deleted.

stubs/skimage/future/setup.pyi

Lines changed: 0 additions & 1 deletion
This file was deleted.

stubs/skimage/measure/setup.pyi

Lines changed: 0 additions & 7 deletions
This file was deleted.

stubs/skimage/morphology/setup.pyi

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)