Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix graphviz check in pass manager visualization #2495

Merged
merged 3 commits into from
May 24, 2019

Conversation

mtreinish
Copy link
Member

Summary

This commit fixes the graphviz check in the pass manager visualization
added recently in #2445. The check was added to determine if the dot
command was in the default PATH by trying to subprocess out and run
'dot -V' however the way in which subprocess was called results in both
the dot version string and a blank line being printed if graphviz is
actually installed. This happens on import time which we definitely
don't want to do (and breaks test discovery in stestr). This commit addresses
that by updating the subprocess call to redirect stdout and stderr, but it also
loosens the exception catch to never raise, if anything fails during the attempt
to run dot we should not treat that as fatal, instead just say we don't have
graphviz.

Details and comments

This commit fixes the graphviz check in the pass manager visualization
added recently in Qiskit#2445. The check was added to determine if the dot
command was in the default PATH by trying to subprocess out and run
'dot -V' however the way in which subprocess was called results in both
the dot version string and a blank line being printed if graphviz is
actually installed. This happens on import time which we definitely
don't want to do (and breaks test discovery in stestr).
@mtreinish mtreinish merged commit 256f719 into Qiskit:master May 24, 2019
@mtreinish mtreinish deleted the fix-graphviz-check branch May 24, 2019 17:04
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this pull request Jul 30, 2019
This commit fixes the graphviz check in the pass manager visualization
added recently in Qiskit#2445. The check was added to determine if the dot
command was in the default PATH by trying to subprocess out and run
'dot -V' however the way in which subprocess was called results in both
the dot version string and a blank line being printed if graphviz is
actually installed. This happens on import time which we definitely
don't want to do (and breaks test discovery in stestr).
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.

2 participants