diff --git a/.github/workflows/general-ci.yml b/.github/workflows/general-ci.yml index cde07f0406..8d622f758f 100644 --- a/.github/workflows/general-ci.yml +++ b/.github/workflows/general-ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7,'3.12'] + python-version: ['3.9','3.13'] simplify: [0,1,autoopt] steps: diff --git a/dace/frontend/python/replacements.py b/dace/frontend/python/replacements.py index 73ab0d154c..406b120567 100644 --- a/dace/frontend/python/replacements.py +++ b/dace/frontend/python/replacements.py @@ -1565,18 +1565,22 @@ def _representative_num(dtype: Union[dtypes.typeclass, Number]) -> Number: nptype = dtype.type else: nptype = dtype - if issubclass(nptype, bool): + if isinstance(nptype, type): + nptype_class = nptype + else: + nptype_class = type(nptype) + if issubclass(nptype_class, bool): return True - elif issubclass(nptype, np.bool_): + elif issubclass(nptype_class, np.bool_): return np.bool_(True) - elif issubclass(nptype, Integral): + elif issubclass(nptype_class, Integral): # NOTE: Returning the max representable integer seems a better choice # than 1, however it was causing issues with some programs. This should # be revisited in the future. # return nptype(np.iinfo(nptype).max) return nptype(1) else: - return nptype(np.finfo(nptype).resolution) + return nptype(np.finfo(nptype_class).resolution) def _np_result_type(nptypes): diff --git a/doc/setup/installation.rst b/doc/setup/installation.rst index 893f4a1688..5de6a6be7b 100644 --- a/doc/setup/installation.rst +++ b/doc/setup/installation.rst @@ -3,7 +3,7 @@ Installation ============ -DaCe is routinely tested on and officially supports Python 3.7 or newer (Python 3.6 is also supported, but not actively tested). +DaCe is routinely tested on and officially supports Python 3.9 to 3.13. .. _dependencies: diff --git a/setup.py b/setup.py index 9c9bc020bb..d9c611a26e 100644 --- a/setup.py +++ b/setup.py @@ -63,7 +63,7 @@ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", ], - python_requires='>=3.6, <3.13', + python_requires='>=3.9, <3.14', packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), package_data={ '': [ diff --git a/tests/python_frontend/method_test.py b/tests/python_frontend/method_test.py index 84576de313..6d1b2214d4 100644 --- a/tests/python_frontend/method_test.py +++ b/tests/python_frontend/method_test.py @@ -1,5 +1,6 @@ # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. """ Tests dace.program as class methods """ +import pytest import dace import numpy as np import sys @@ -126,6 +127,7 @@ def test_static_withclass(): assert np.allclose(MyTestClass.static_withclass(A), A + 3) +@pytest.mark.skip(reason="Python 3.13 removed chained @classmethods, making this impossible for now") def test_classmethod(): # Only available in Python 3.9+ if sys.version_info >= (3, 9): @@ -282,7 +284,7 @@ def tester(a): test_callable() test_static() test_static_withclass() - test_classmethod() + #test_classmethod() test_nested_methods() test_decorator() test_sdfgattr_method_jit()