Skip to content

Detect missing cpuinfo package when running test-libs.sh and let the user know - #967

Merged
mhucka merged 4 commits into
quantumlib:mainfrom
mhucka:mh-test-libs-add-check
Jan 5, 2026
Merged

Detect missing cpuinfo package when running test-libs.sh and let the user know#967
mhucka merged 4 commits into
quantumlib:mainfrom
mhucka:mh-test-libs-add-check

Conversation

@mhucka

@mhucka mhucka commented Dec 30, 2025

Copy link
Copy Markdown
Collaborator

Due to the fact that the package name is not the same as the module name (py-cpuinfo vs cpuinfo), the error that results from trying to run this script when py-cpuinfo is not installed can be confusing. Let's help users & developers by testing for the package and pointing them in the right direction.

Also, slightly improve the clarity of the usage message text in this script.

Due to the fact that the package name is not the same as the module name
(`py-cpuinfo` vs `cpuinfo`), the error that results from trying to run
this script when `py-cpuinfo` is not installed can be confusing. Let's
help users & developers by testing it and pointing them in the right
direction.
@github-actions github-actions Bot added the size: S 10< lines changed <50 label Dec 30, 2025

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request improves the developer experience by adding a check for the py-cpuinfo package in test_libs.sh and clarifying the usage message. The implementation is good, but I've suggested a few improvements to make the check more robust and adhere to shell scripting best practices, such as using python -m pip and redirecting error messages to stderr.

Comment thread dev_tools/test_libs.sh Outdated
mhucka and others added 2 commits December 29, 2025 21:27
Gemini Code Assist's suggestions are reasonable.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@mhucka mhucka changed the title Detect missing cpuinfo package and let the user know Detect missing cpuinfo package when running test-libs.sh and let the user know Jan 1, 2026
@mhucka
mhucka enabled auto-merge January 5, 2026 17:24
@mhucka
mhucka added this pull request to the merge queue Jan 5, 2026
Merged via the queue into quantumlib:main with commit 383e72b Jan 5, 2026
28 checks passed
@mhucka
mhucka deleted the mh-test-libs-add-check branch January 5, 2026 17:45
mhucka added a commit to mhucka/qsim that referenced this pull request Jan 18, 2026
…user know (quantumlib#967)

Due to the fact that the package name is not the same as the module name
(`py-cpuinfo` vs `cpuinfo`), the error that results from trying to run
this script when `py-cpuinfo` is not installed can be confusing. Let's
help users & developers by testing for the package and pointing them in
the right direction.

Also, slightly improve the clarity of the usage message text in this
script.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: S 10< lines changed <50

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants