Detect missing cpuinfo package when running test-libs.sh and let the user know - #967
Merged
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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.
Gemini Code Assist's suggestions are reasonable. Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
sergeisakov
approved these changes
Jan 5, 2026
mhucka
enabled auto-merge
January 5, 2026 17:24
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Due to the fact that the package name is not the same as the module name (
py-cpuinfovscpuinfo), the error that results from trying to run this script whenpy-cpuinfois 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.