Improve handling of CI varaible for build systems that set it to a string like azure.

This commit is contained in:
Matt Davis
2022-08-05 18:37:28 -04:00
committed by Oz N Tiram
parent 66f03afd0b
commit 9b2428e01a
+9 -1
View File
@@ -81,7 +81,15 @@ def normalize_pipfile_path(p):
os.environ.pop("__PYVENV_LAUNCHER__", None)
# Internal, to tell whether the command line session is interactive.
SESSION_IS_INTERACTIVE = _isatty(sys.stdout)
PIPENV_IS_CI = env_to_bool(os.environ.get("CI") or os.environ.get("TF_BUILD") or False)
# TF_BUILD indicates to Azure pipelines it is a build step
PIPENV_IS_CI = os.environ.get("CI") or os.environ.get("TF_BUILD")
try:
PIPENV_IS_CI = env_to_bool(PIPENV_IS_CI)
except ValueError:
# CI variable detected and it did not evaluate to a false value
PIPENV_IS_CI = True
NO_COLOR = False
if os.getenv("NO_COLOR") or os.getenv("PIPENV_COLORBLIND"):
NO_COLOR = True