Commit b73f5d67 authored by moto's avatar moto Committed by Facebook GitHub Bot
Browse files

Surpress stderr from subprocess in setup.py (#2133)

Summary:
This commits supress the stderr output when shell commands are
executed `setup.py`.

`setup.py` performs multiple git commands to gather metadata.
When `git tag` command tries to find a tag, (which fails unless on release)
it produces `fatal: No names found, cannot describe anything.`

This is confusing especially when it is executed from higher level,
like `pip install git+https://...`.

Pull Request resolved: https://github.com/pytorch/audio/pull/2133

Reviewed By: nateanl

Differential Revision: D33455339

Pulled By: mthrok

fbshipit-source-id: 3e24451eb6fedcd0ad90f7e16e38fcdb70dc9704
parent cf8189ed
...@@ -16,7 +16,7 @@ ROOT_DIR = Path(__file__).parent.resolve() ...@@ -16,7 +16,7 @@ ROOT_DIR = Path(__file__).parent.resolve()
def _run_cmd(cmd): def _run_cmd(cmd):
try: try:
return subprocess.check_output(cmd, cwd=ROOT_DIR).decode("ascii").strip() return subprocess.check_output(cmd, cwd=ROOT_DIR, stderr=subprocess.DEVNULL).decode("ascii").strip()
except Exception: except Exception:
return None return None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment