Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change supported python versions to 3.9-3.13 #1858

Merged
merged 7 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/general-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 8 additions & 4 deletions dace/frontend/python/replacements.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion doc/setup/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={
'': [
Expand Down
4 changes: 3 additions & 1 deletion tests/python_frontend/method_test.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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()
Expand Down
Loading