Skip to content

Disable pip latest version check when building python native helper#5493

Merged
jeffwidman merged 1 commit intodependabot:mainfrom
jeffwidman:disable-pip-latest-version-check
Aug 8, 2022
Merged

Disable pip latest version check when building python native helper#5493
jeffwidman merged 1 commit intodependabot:mainfrom
jeffwidman:disable-pip-latest-version-check

Conversation

@jeffwidman
Copy link
Copy Markdown
Member

@jeffwidman jeffwidman commented Aug 8, 2022

This python helper is being run during the build of Dependabot-core
docker image, triggering the following warning:

You are using pip version 22.0.4; however, version 22.2.2 is available.
You should consider upgrading via the '/usr/local/.pyenv/versions/3.10.5/bin/python3.10 -m pip install --upgrade pip' command.

Beyond the annoyance of the warning message, this means that pip is
making an unnecessary call to a remote server to check the version.
This won't be a huge savings, a blogger benchmarked this as costing ~0.2s, but still might as well disable it.

This option can also be set globally using a config file or env var:

However, we have a number of different use cases for calling pip, and
in some cases we may end up wanting the version check... for example
it feels wrong/unpredictable to simultaneously disable the version check
while we are upgrading to the latest version.

@jeffwidman jeffwidman requested a review from a team as a code owner August 8, 2022 05:13
@jeffwidman jeffwidman force-pushed the disable-pip-latest-version-check branch from a8a09b2 to 42119d5 Compare August 8, 2022 05:19
This python helper is being run during the build of `Dependabot-core`
docker image, triggering the following warning:
```
You are using pip version 22.0.4; however, version 22.2.2 is available.
You should consider upgrading via the '/usr/local/.pyenv/versions/3.10.5/bin/python3.10 -m pip install --upgrade pip' command.
```

Beyond the annoyance of the warning message, this means that `pip` is
making an unnecessary call to a remote server to check the version.
A blogger [benchmarked this as costing ~0.2s](https://pythonspeed.com/articles/faster-pip-installs/), so disable it.

This option can also be set globally using a config file or env var:
* https://stackoverflow.com/a/46288945
* https://stackoverflow.com/a/60270281

However, we have a number of different use cases for calling `pip`, and
in some cases we _may_ end up wanting the version check... for example
it feels wrong/unpredictable to simultaneously disable the version check
while we are [upgrading to the latest version](dependabot#5195).
@jeffwidman jeffwidman force-pushed the disable-pip-latest-version-check branch from 42119d5 to 78cc70b Compare August 8, 2022 05:22
@jeffwidman jeffwidman merged commit 4af6603 into dependabot:main Aug 8, 2022
@jeffwidman jeffwidman deleted the disable-pip-latest-version-check branch August 8, 2022 16:25
@Nishnha Nishnha mentioned this pull request Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants