diff --git a/ci/tools/merge_cuda_core_wheels.py b/ci/tools/merge_cuda_core_wheels.py index c66a1bfa2a8..23a8a21289f 100644 --- a/ci/tools/merge_cuda_core_wheels.py +++ b/ci/tools/merge_cuda_core_wheels.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -27,10 +27,9 @@ import tempfile import zipfile from pathlib import Path -from typing import List -def run_command(cmd: List[str], cwd: Path | None = None, env: dict = os.environ) -> subprocess.CompletedProcess: +def run_command(cmd: list[str], cwd: Path | None = None, env: dict = os.environ) -> subprocess.CompletedProcess: """Run a command with error handling.""" print(f"Running: {' '.join(cmd)}") if cwd: @@ -78,7 +77,7 @@ def print_wheel_directory_structure(wheel_path: Path, filter_prefix: str = "cuda print(f"Warning: Could not list wheel contents: {e}", file=sys.stderr) -def merge_wheels(wheels: List[Path], output_dir: Path, show_wheel_contents: bool = True) -> Path: +def merge_wheels(wheels: list[Path], output_dir: Path, show_wheel_contents: bool = True) -> Path: """Merge multiple wheels into a single wheel with version-specific binaries.""" print("\n=== Merging wheels ===", file=sys.stderr) print(f"Input wheels: {[w.name for w in wheels]}", file=sys.stderr) diff --git a/cuda_core/tests/helpers/__init__.py b/cuda_core/tests/helpers/__init__.py index 5ce5ab7f05b..2305cfaa1e5 100644 --- a/cuda_core/tests/helpers/__init__.py +++ b/cuda_core/tests/helpers/__init__.py @@ -3,7 +3,6 @@ import functools import os -from typing import Union from cuda.core._utils.cuda_utils import handle_return from cuda.pathfinder import get_cuda_path_or_home @@ -23,7 +22,7 @@ @functools.cache -def supports_ipc_mempool(device_id: Union[int, object]) -> bool: +def supports_ipc_mempool(device_id: int | object) -> bool: """Return True if mempool IPC via POSIX file descriptor is supported. Uses cuDeviceGetAttribute(CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES) diff --git a/cuda_python_test_helpers/pyproject.toml b/cuda_python_test_helpers/pyproject.toml index 85652b61c50..f20720f6158 100644 --- a/cuda_python_test_helpers/pyproject.toml +++ b/cuda_python_test_helpers/pyproject.toml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 [build-system] @@ -12,7 +12,7 @@ description = "Shared test helpers for CUDA Python projects" readme = {file = "README.md", content-type = "text/markdown"} authors = [{ name = "NVIDIA Corporation" }] license = "Apache-2.0" -requires-python = ">=3.9" +requires-python = ">=3.10" classifiers = [ "Programming Language :: Python :: 3 :: Only", "Operating System :: POSIX :: Linux", diff --git a/toolshed/make_site_packages_libdirs.py b/toolshed/make_site_packages_libdirs.py index e1cbcb28825..d4664798850 100755 --- a/toolshed/make_site_packages_libdirs.py +++ b/toolshed/make_site_packages_libdirs.py @@ -17,7 +17,6 @@ import re import sys from pathlib import Path -from typing import Dict, Set sys.path.insert(0, str(Path(__file__).resolve().parent)) from _catalog_writer import load_catalog, update_specs, write_catalog @@ -31,8 +30,8 @@ def _strip_site_packages_prefix(p: str) -> str: return _SITE_PACKAGES_RE.sub("", p) -def _parse_lines_linux(lines: list[str]) -> Dict[str, Set[str]]: - d: Dict[str, Set[str]] = {} +def _parse_lines_linux(lines: list[str]) -> dict[str, set[str]]: + d: dict[str, set[str]] = {} for raw in lines: line = raw.strip() if not line or line.startswith("#"): @@ -63,9 +62,9 @@ def _extract_libname_from_dll(fname: str) -> str | None: return name or None -def _parse_lines_windows(lines: list[str]) -> Dict[str, Set[str]]: +def _parse_lines_windows(lines: list[str]) -> dict[str, set[str]]: """Collect {libname: set(dirnames)} with deduped directories.""" - m: Dict[str, Set[str]] = {} + m: dict[str, set[str]] = {} for raw in lines: line = raw.strip() if not line or line.startswith("#"):