From e55d671956507953e11b630eec57f83c7d1e28c5 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Tue, 3 Nov 2026 18:24:15 +0100 Subject: [PATCH 1/2] Remove stale host device names from dpctl.__all__ select_host_device and has_host_device were removed together with the host device, but stayed in dpctl.__all__, so `from dpctl import *` raised AttributeError. Add a test that the star import resolves every name in __all__. --- CHANGELOG.md | 1 + dpctl/__init__.py | 2 -- dpctl/tests/test_service.py | 6 ++++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cc5c4bf8a..0c3e560a9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed ### Fixed +* Removed stale `select_host_device` and `has_host_device` names from `dpctl.__all__`, which made `from dpctl import *` fail with `AttributeError` [gh-XXXX](https://github.com/IntelPython/dpctl/pull/XXXX) ### Maintenance diff --git a/dpctl/__init__.py b/dpctl/__init__.py index 11c4a3281f..8e59a60fcd 100644 --- a/dpctl/__init__.py +++ b/dpctl/__init__.py @@ -88,13 +88,11 @@ "select_cpu_device", "select_default_device", "select_gpu_device", - "select_host_device", "select_device_with_aspects", "get_num_devices", "has_cpu_devices", "has_gpu_devices", "has_accelerator_devices", - "has_host_device", "get_composite_devices", ] __all__ += [ diff --git a/dpctl/tests/test_service.py b/dpctl/tests/test_service.py index b5b4fe23e9..224aed326e 100644 --- a/dpctl/tests/test_service.py +++ b/dpctl/tests/test_service.py @@ -123,6 +123,12 @@ def test___version__(): assert re.match(reg_expr, dpctl_ver) is not None +def test_star_import(): + ns = {} + exec("from dpctl import *", ns) + assert all(name in ns for name in dpctl.__all__) + + def test_dev_utils(): import tempfile From 93cf24a2983a1e2ba2d7c4c667b351d690eeb5a9 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Tue, 3 Nov 2026 18:24:39 +0100 Subject: [PATCH 2/2] Add gh-2410 to the changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c3e560a9f..32b70e3d4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed ### Fixed -* Removed stale `select_host_device` and `has_host_device` names from `dpctl.__all__`, which made `from dpctl import *` fail with `AttributeError` [gh-XXXX](https://github.com/IntelPython/dpctl/pull/XXXX) +* Removed stale `select_host_device` and `has_host_device` names from `dpctl.__all__`, which made `from dpctl import *` fail with `AttributeError` [gh-2410](https://github.com/IntelPython/dpctl/pull/2410) ### Maintenance