diff --git a/pipenv/environments.py b/pipenv/environments.py index 5b5e49f4..ed0d1664 100644 --- a/pipenv/environments.py +++ b/pipenv/environments.py @@ -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