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

cuda.parallel: Address Python<3.9 TODOs #3318

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
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
Loading