Skip to content

Commit

Permalink
Address Python<3.9 TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
shwina committed Jan 10, 2025
1 parent 2c5bdcd commit 31f22c9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
9 changes: 1 addition & 8 deletions python/cuda_parallel/cuda/parallel/experimental/_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import shutil
from functools import lru_cache
from importlib.resources import as_file, files
from typing import List, Optional

from . import _cccl as cccl
Expand All @@ -30,10 +31,6 @@ def _get_cuda_path() -> Optional[str]:

@lru_cache()
def get_bindings() -> ctypes.CDLL:
# TODO: once docs env supports Python >= 3.9, we
# can move this to a module-level import.
from importlib.resources import as_file, files

with as_file(files("cuda.parallel.experimental")) as f:
cccl_c_path = str(f / "cccl" / "libcccl.c.parallel.so")
_bindings = ctypes.CDLL(cccl_c_path)
Expand All @@ -55,10 +52,6 @@ def get_bindings() -> ctypes.CDLL:

@lru_cache()
def get_paths() -> List[bytes]:
# TODO: once docs env supports Python >= 3.9, we
# can move this to a module-level import.
from importlib.resources import as_file, files

with as_file(files("cuda.parallel")) as f:
# Using `.parent` for compatibility with pip install --editable:
cub_include_path = str(f.parent / "_include")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

from __future__ import annotations # TODO: required for Python 3.7 docs env

import ctypes
from typing import Callable

Expand Down
4 changes: 1 addition & 3 deletions python/cuda_parallel/cuda/parallel/experimental/typing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from typing_extensions import (
Protocol,
) # TODO: typing_extensions required for Python 3.7 docs env
from typing import Protocol


class DeviceArrayLike(Protocol):
Expand Down
3 changes: 1 addition & 2 deletions python/cuda_parallel/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ def build_extension(self, ext):
],
packages=find_namespace_packages(include=["cuda.*"]),
python_requires=">=3.9",
# TODO: typing_extensions required for Python 3.7 docs env
install_requires=["numba>=0.60.0", "cuda-python", "jinja2", "typing_extensions"],
install_requires=["numba>=0.60.0", "cuda-python", "jinja2"],
extras_require={
"test": [
"pytest",
Expand Down

0 comments on commit 31f22c9

Please sign in to comment.