diff options
author | Zach White <skullydazed@gmail.com> | 2021-05-19 15:24:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-19 15:24:46 -0700 |
commit | db1eacdaacb9c8f6889f46bc1c6af155b81ad72a (patch) | |
tree | cd32a69a04c7ff93a11941d82aef3ce31c2b7523 /lib/python/qmk/cli/generate | |
parent | a9aec546c873fa5a2cb1d9a10878aca71818b609 (diff) | |
download | qmk_firmware-db1eacdaacb9c8f6889f46bc1c6af155b81ad72a.tar.gz qmk_firmware-db1eacdaacb9c8f6889f46bc1c6af155b81ad72a.zip |
Align our subprocess usage with current best practices. (#12940)
* Align our subprocess usage with current best practices.
* remove unused import
* Apply suggestions from code review
Co-authored-by: Ryan <fauxpark@gmail.com>
* fix the cpp invocation for older python
* allow for unprompted installation
* make sure qmk new-keyboard works on windows
Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'lib/python/qmk/cli/generate')
-rw-r--r-- | lib/python/qmk/cli/generate/docs.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/python/qmk/cli/generate/docs.py b/lib/python/qmk/cli/generate/docs.py index a59a24db5..749336fea 100644 --- a/lib/python/qmk/cli/generate/docs.py +++ b/lib/python/qmk/cli/generate/docs.py | |||
@@ -1,8 +1,8 @@ | |||
1 | """Build QMK documentation locally | 1 | """Build QMK documentation locally |
2 | """ | 2 | """ |
3 | import shutil | 3 | import shutil |
4 | import subprocess | ||
5 | from pathlib import Path | 4 | from pathlib import Path |
5 | from subprocess import DEVNULL | ||
6 | 6 | ||
7 | from milc import cli | 7 | from milc import cli |
8 | 8 | ||
@@ -24,14 +24,16 @@ def generate_docs(cli): | |||
24 | shutil.copytree(DOCS_PATH, BUILD_PATH) | 24 | shutil.copytree(DOCS_PATH, BUILD_PATH) |
25 | 25 | ||
26 | # When not verbose we want to hide all output | 26 | # When not verbose we want to hide all output |
27 | args = {'check': True} | 27 | args = { |
28 | if not cli.args.verbose: | 28 | 'capture_output': False if cli.config.general.verbose else True, |
29 | args.update({'stdout': subprocess.DEVNULL, 'stderr': subprocess.STDOUT}) | 29 | 'check': True, |
30 | 'stdin': DEVNULL, | ||
31 | } | ||
30 | 32 | ||
31 | cli.log.info('Generating internal docs...') | 33 | cli.log.info('Generating internal docs...') |
32 | 34 | ||
33 | # Generate internal docs | 35 | # Generate internal docs |
34 | subprocess.run(['doxygen', 'Doxyfile'], **args) | 36 | cli.run(['doxygen', 'Doxyfile'], **args) |
35 | subprocess.run(['moxygen', '-q', '-a', '-g', '-o', BUILD_PATH / 'internals_%s.md', 'doxygen/xml'], **args) | 37 | cli.run(['moxygen', '-q', '-a', '-g', '-o', BUILD_PATH / 'internals_%s.md', 'doxygen/xml'], **args) |
36 | 38 | ||
37 | cli.log.info('Successfully generated internal docs to %s.', BUILD_PATH) | 39 | cli.log.info('Successfully generated internal docs to %s.', BUILD_PATH) |