Skip to content

Commit ba53909

Browse files
authored
Merge pull request #6522 from theacodes/add-pip-ci
Check for explicit PIP_IS_CI environment variable to report automated installs to Warehouse.
2 parents eeb74ae + 03ad042 commit ba53909

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

news/5499.feature

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Report to Warehouse that pip is running under CI if the ``PIP_IS_CI`` environment variable is set.

src/pip/_internal/download.py

+2
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@
9595
'BUILD_ID',
9696
# AppVeyor, CircleCI, Codeship, Gitlab CI, Shippable, Travis CI
9797
'CI',
98+
# Explicit environment variable.
99+
'PIP_IS_CI',
98100
)
99101

100102

tests/unit/test_download.py

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def test_user_agent():
7373
('BUILD_BUILDID', True),
7474
('BUILD_ID', True),
7575
('CI', True),
76+
('PIP_IS_CI', True),
7677
# Test a prefix substring of one of the variable names we use.
7778
('BUILD', False),
7879
])

0 commit comments

Comments
 (0)