Skip to content

Commit f952144

Browse files
committed
Privatize pathfinder driver info API in compatibility branch
Align the compatibility-checks branch with the internal-only driver info helper by dropping the public re-exports and updating docs and tests to use the internal module directly. Made-with: Cursor
1 parent 9340619 commit f952144

4 files changed

Lines changed: 1 addition & 24 deletions

File tree

cuda_pathfinder/cuda/pathfinder/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@
6868
from cuda.pathfinder._static_libs.find_static_lib import (
6969
locate_static_lib as locate_static_lib,
7070
)
71-
from cuda.pathfinder._utils.driver_info import DriverCudaVersion as DriverCudaVersion
72-
from cuda.pathfinder._utils.driver_info import QueryDriverCudaVersionError as QueryDriverCudaVersionError
73-
from cuda.pathfinder._utils.driver_info import query_driver_cuda_version as query_driver_cuda_version
7471
from cuda.pathfinder._utils.env_vars import get_cuda_path_or_home as get_cuda_path_or_home
7572

7673
from cuda.pathfinder._version import __version__ # isort: skip

cuda_pathfinder/docs/source/api.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ CUDA bitcode and static libraries.
2222
CompatibilityCheckError
2323
CompatibilityInsufficientMetadataError
2424

25-
DriverCudaVersion
26-
QueryDriverCudaVersionError
27-
query_driver_cuda_version
28-
2925
SUPPORTED_NVIDIA_LIBNAMES
3026
load_nvidia_dynamic_lib
3127
LoadedDL

cuda_pathfinder/tests/test_utils_driver_info.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@
55

66
import pytest
77

8-
from cuda.pathfinder import (
9-
DriverCudaVersion as PublicDriverCudaVersion,
10-
)
11-
from cuda.pathfinder import (
12-
QueryDriverCudaVersionError as PublicQueryDriverCudaVersionError,
13-
)
14-
from cuda.pathfinder import (
15-
query_driver_cuda_version as public_query_driver_cuda_version,
16-
)
178
from cuda.pathfinder._dynamic_libs.load_dl_common import LoadedDL
189
from cuda.pathfinder._utils import driver_info
1910

@@ -51,12 +42,6 @@ def _loaded_cuda(abs_path: str) -> LoadedDL:
5142
)
5243

5344

54-
def test_driver_cuda_version_public_api_exports():
55-
assert PublicDriverCudaVersion is driver_info.DriverCudaVersion
56-
assert PublicQueryDriverCudaVersionError is driver_info.QueryDriverCudaVersionError
57-
assert public_query_driver_cuda_version is driver_info.query_driver_cuda_version
58-
59-
6045
def test_query_driver_cuda_version_uses_windll_on_windows(monkeypatch):
6146
fake_driver_lib = _FakeDriverLib(status=0, version=12080)
6247
loaded_paths: list[str] = []

cuda_pathfinder/tests/test_with_compatibility_checks.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@
1212
BitcodeLibNotFoundError,
1313
CompatibilityCheckError,
1414
CompatibilityInsufficientMetadataError,
15-
DriverCudaVersion,
1615
DynamicLibNotFoundError,
1716
LoadedDL,
1817
LocatedBitcodeLib,
1918
LocatedHeaderDir,
2019
LocatedStaticLib,
21-
QueryDriverCudaVersionError,
2220
StaticLibNotFoundError,
2321
WithCompatibilityChecks,
2422
)
23+
from cuda.pathfinder._utils.driver_info import DriverCudaVersion, QueryDriverCudaVersionError
2524

2625
STRICTNESS = os.environ.get("CUDA_PATHFINDER_TEST_WITH_COMPATIBILITY_CHECKS_STRICTNESS", "see_what_works")
2726
assert STRICTNESS in ("see_what_works", "all_must_work")

0 commit comments

Comments
 (0)