ApeWorX / py-solc-x

Python wrapper and version management tool for the solc Solidity compiler.
https://solcx.readthedocs.io/
MIT License
141 stars 49 forks source link

Mute solc which stderr output #81

Closed dmuhs closed 4 years ago

dmuhs commented 4 years ago

Issue

When a solc binary is not installed on the system, the which lookup in the installation routine returns 1 and prints an error message to stdout. This message is visible in client applications, even though it is not critical and a solc executable is correctly downloaded and installed.

A sample error message looks like this:

which: no solc in (/home/kthxbai/tools/mythx-cli/venv/bin:<more paths>)

What I did

Route the stderr of which to /dev/null in the lookup logic for detecting already installed solc versions.

How to verify it

Run any script that dynamically installs a specified solc version and verify that no error message is shown.

Checklist

I have not included a changelog entry as the v0.9.0 PR is already open and you might want to include this in the upcoming release by merging this PR into master and rebasing into the PR branch.

codecov[bot] commented 4 years ago

Codecov Report

Merging #81 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #81   +/-   ##
=======================================
  Coverage   76.97%   76.97%           
=======================================
  Files           8        8           
  Lines         582      582           
  Branches      133      133           
=======================================
  Hits          448      448           
  Misses        105      105           
  Partials       29       29           
Impacted Files Coverage Δ
solcx/install.py 73.20% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f596b9c...34e4a38. Read the comment docs.