pw_doctor: allow skipping CIPD checks
Change-Id: I22fc7f680238315ada03dadbb0f25c6ff2394efb
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/13685
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Rob Mohr <mohrr@google.com>
diff --git a/pw_cli/py/pw_cli/env.py b/pw_cli/py/pw_cli/env.py
index dc9eaa7..ab11dcb 100644
--- a/pw_cli/py/pw_cli/env.py
+++ b/pw_cli/py/pw_cli/env.py
@@ -42,6 +42,8 @@
parser.add_allowed_suffix('_CIPD_INSTALL_DIR')
+ parser.add_var('PW_DOCTOR_SKIP_CIPD_CHECKS')
+
parser.add_var('PW_CIPD_PACKAGE_FILES')
parser.add_var('PW_VIRTUALENV_REQUIREMENTS')
parser.add_var('PW_VIRTUALENV_SETUP_PY_ROOTS')
diff --git a/pw_doctor/py/pw_doctor/doctor.py b/pw_doctor/py/pw_doctor/doctor.py
index 1402047..5bdf33f 100755
--- a/pw_doctor/py/pw_doctor/doctor.py
+++ b/pw_doctor/py/pw_doctor/doctor.py
@@ -196,6 +196,9 @@
@register_into(CHECKS)
def cipd(ctx: DoctorContext):
"""Check cipd is set up correctly and in use."""
+ if os.environ.get('PW_DOCTOR_SKIP_CIPD_CHECKS'):
+ return
+
cipd_path = 'pigweed'
cipd_exe = shutil.which('cipd')
@@ -237,7 +240,11 @@
@register_into(CHECKS)
def cipd_versions(ctx: DoctorContext):
- """Check cipd is set up correctly and in use."""
+ """Check cipd tool versions are current."""
+
+ if os.environ.get('PW_DOCTOR_SKIP_CIPD_CHECKS'):
+ return
+
try:
root = pathlib.Path(os.environ['PW_ROOT']).resolve()
except KeyError: