Skip to content

Commit

Permalink
Merge pull request #154 from hanjinliu/test-py313
Browse files Browse the repository at this point in the history
drop 3.8 and add 3.13
  • Loading branch information
hanjinliu authored Oct 24, 2024
2 parents 26be3d4 + e4ef4ae commit 7adea76
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
platform: [ubuntu-latest, macos-latest, windows-latest]
backend: [pyqt5]
include:
Expand Down
17 changes: 10 additions & 7 deletions magicclass/ext/vispy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from .widgets2d import (
VispyPlotCanvas,
VispyImageCanvas,
VispyMultiPlotCanvas,
VispyMultiImageCanvas,
)
from .widgets3d import Vispy3DCanvas, VispyMulti3DCanvas
try:
from .widgets2d import (
VispyPlotCanvas,
VispyImageCanvas,
VispyMultiPlotCanvas,
VispyMultiImageCanvas,
)
from .widgets3d import Vispy3DCanvas, VispyMulti3DCanvas
except OSError:
pass # cannot run vispy in macOS and python 3.13

__all__ = [
"VispyPlotCanvas",
Expand Down
6 changes: 5 additions & 1 deletion magicclass/ext/vispy/tests/test_vispy2d.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import sys
import numpy as np
from numpy.testing import assert_allclose
from magicclass.ext.vispy import VispyPlotCanvas
import pytest

@pytest.mark.skipif(not (sys.version_info < (3, 13)), reason="requires python<3.13")
def test_add_and_delete_data():
from magicclass.ext.vispy import VispyPlotCanvas

canvas = VispyPlotCanvas()
curve = canvas.add_curve(np.random.random(100), color="blue")
assert len(canvas.layers) == 1
Expand Down
5 changes: 1 addition & 4 deletions magicclass/functools/_dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,8 @@ class singledispatchmethod(functools.singledispatchmethod):
"""

def __init__(self, func):
if not callable(func) and not hasattr(func, "__get__"):
raise TypeError(f"{func!r} is not callable or a descriptor")

super().__init__(func)
self.dispatcher = singledispatch(func)
self.func = func
if sys.version_info < (3, 10):
self._wrapped_func = func
functools.update_wrapper(
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dynamic = ["version"]
description = "Generate multifunctional GUIs from classes"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.8"
requires-python = ">=3.9"
authors = [
{ name = "Hanjin Liu", email = "[email protected]" },
]
Expand Down

0 comments on commit 7adea76

Please sign in to comment.