Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CI variable handling #5222

Merged
merged 5 commits into from
Aug 6, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/5128.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
If environment variable ``CI`` or ``TF_BUILD`` is set but does not evaluate to ``False`` it is now treated as ``True``.
10 changes: 9 additions & 1 deletion pipenv/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
oz123 marked this conversation as resolved.
Show resolved Hide resolved
try:
PIPENV_IS_CI = env_to_bool(PIPENV_IS_CI)
oz123 marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down