Skip to content

Remove stale host device names from dpctl.__all__ - #2410

Merged
ndgrigorian merged 2 commits into
masterfrom
fix-stale-host-device-all
Nov 3, 2026
Merged

ndgrigorian merged 2 commits into
masterfrom
fix-stale-host-device-all

Conversation

@antonwolfy

Copy link
Copy Markdown
Collaborator

select_host_device and has_host_device were removed together with the host device in cee5afe, but they stayed listed in dpctl.__all__. Because of that, from dpctl import * fails:

AttributeError: module 'dpctl' has no attribute 'select_host_device'. Did you mean: 'select_cpu_device'?

This PR drops both names and adds test_star_import, which checks that the star import resolves every name in dpctl.__all__. The test fails without the fix and passes with it (checked on an Intel Arc B390 GPU).

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

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__.
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@coveralls

coveralls commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 74.989%. remained the same — fix-stale-host-device-all into master

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the change removing obsolete host-device exports to fix star imports.

No open issues 🎉

What changed in this PR

Fixes from dpctl import * by removing obsolete host-device names from the package’s public export list.

Changes:

  • Removes select_host_device and has_host_device from dpctl.__all__.
  • Adds a regression test that performs a star import and checks every declared export.
  • Documents the fix in the changelog.
File Description
dpctl/​tests/​test_service.py Adds regression coverage for star imports.
dpctl/​__init__.py Removes the two stale host-device exports.
CHANGELOG.md Records the star-import fix.

Review effort: Balanced

@ndgrigorian ndgrigorian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ndgrigorian
ndgrigorian merged commit c349507 into master Nov 3, 2026
92 of 98 checks passed
@ndgrigorian
ndgrigorian deleted the fix-stale-host-device-all branch November 3, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants