Skip to content

Commit 65d2d11

Browse files
committed
Fixes for Python 3.10
1 parent e4baa64 commit 65d2d11

4 files changed

Lines changed: 14 additions & 2 deletions

File tree

cuda_core/cuda/core/system/_device.pyx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
from libc.stdint cimport intptr_t, uint64_t
66
from libc.math cimport ceil
77

8-
from enum import StrEnum
8+
import sys
9+
if sys.version_info >= (3, 11):
10+
from enum import StrEnum
11+
else:
12+
from backports.strenum import StrEnum
913
from multiprocessing import cpu_count
1014
from typing import Iterable
1115
import warnings

cuda_core/cuda/core/system/_system_events.pyx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55

66
from libc.stdint cimport intptr_t
77

8-
from enum import StrEnum
8+
import sys
9+
if sys.version_info >= (3, 11):
10+
from enum import StrEnum
11+
else:
12+
from backports.strenum import StrEnum
913

1014
from cuda.bindings import nvml
1115

cuda_core/pixi.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ numpy = "*"
186186
cuda-bindings = "*"
187187
cuda-pathfinder = "*"
188188

189+
[package.target.'python_version < "3.11"'.run-dependencies]
190+
"backports.strenum" = "*"
191+
189192
[target.linux.tasks.build-cython-tests]
190193
cmd = ["$PIXI_PROJECT_ROOT/tests/cython/build_tests.sh"]
191194

cuda_core/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ classifiers = [
5050
dependencies = [
5151
"cuda-pathfinder >=1.4.2",
5252
"numpy",
53+
"backports.strenum; python_version < '3.11'",
5354
]
5455

5556
[project.optional-dependencies]

0 commit comments

Comments
 (0)