diff --git a/news/5499.feature b/news/5499.feature new file mode 100644 index 00000000000..8f5d4773126 --- /dev/null +++ b/news/5499.feature @@ -0,0 +1 @@ +Report to Warehouse that pip is running under CI if the ``PIP_IS_CI`` environment variable is set. diff --git a/src/pip/_internal/download.py b/src/pip/_internal/download.py index 8b3b7a8775c..0dd22dd1e53 100644 --- a/src/pip/_internal/download.py +++ b/src/pip/_internal/download.py @@ -95,6 +95,8 @@ 'BUILD_ID', # AppVeyor, CircleCI, Codeship, Gitlab CI, Shippable, Travis CI 'CI', + # Explicit environment variable. + 'PIP_IS_CI', ) diff --git a/tests/unit/test_download.py b/tests/unit/test_download.py index 57f3cdeb5fa..de86fcf03c0 100644 --- a/tests/unit/test_download.py +++ b/tests/unit/test_download.py @@ -73,6 +73,7 @@ def test_user_agent(): ('BUILD_BUILDID', True), ('BUILD_ID', True), ('CI', True), + ('PIP_IS_CI', True), # Test a prefix substring of one of the variable names we use. ('BUILD', False), ])