Skip to content

fix(audio): probe audioread without an unused import (unblocks ruff-check on main) - #3987

Merged
Qubitium merged 1 commit into
mainfrom
fix/audio-unused-import
Nov 14, 2026
Merged

Qubitium merged 1 commit into
mainfrom
fix/audio-unused-import

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Why

ruff-check has been failing on main since #3970/#3980, so every open PR inherits a red required check:

gptqmodel/utils/audio.py:16:5: F401 [*] `audioread` imported but unused

The bounded media-fetch change stopped decoding audio through audioread but kept import audioread only to set AUDIOREAD_AVAILABLE.

Change

Probe the distribution with importlib.util.find_spec("audioread") instead of importing it.

  • AUDIOREAD_AVAILABLE keeps its meaning: an absent package still reports False.
  • No unused binding, so format/check.sh and the ruff-check job pass.
  • Verified locally: ruff check gptqmodel docs/eora tests setup.py → All checks passed, and AUDIOREAD_AVAILABLE reports False in this environment (package absent), matching the previous ImportError path.

Scope

One file, 5 lines. No behaviour change for installed audioread users: the flag is True either way, and the decode path already routes through the bounded fetch helper.

The bounded media-fetch change (#3970) stopped decoding audio through
audioread directly but left `import audioread` in place purely to set
AUDIOREAD_AVAILABLE. Ruff flags the now-unused import (F401), so
`format/check.sh` — and therefore the `ruff-check` CI job — fails on main
for every open pull request.

Probe the distribution with importlib.util.find_spec instead of importing
it. The availability flag keeps its meaning (an absent package still
reports False) and the module no longer shadows the check with an unused
binding.
@Qubitium
Qubitium merged commit db1bba9 into main Nov 14, 2026
6 checks passed
@Qubitium
Qubitium deleted the fix/audio-unused-import branch November 14, 2026 12:31
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.

1 participant