Skip to content

Improve self-check logic #5808

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

Closed
techtonik opened this issue Sep 24, 2018 · 4 comments
Closed

Improve self-check logic #5808

techtonik opened this issue Sep 24, 2018 · 4 comments
Labels
auto-locked Outdated issues that have been locked by automation state: blocked Can not be done until something else is done type: enhancement Improvements to functionality type: feature request Request for a new feature

Comments

@techtonik
Copy link
Contributor

What's the problem this feature will solve?

Simplify the code to give less space to bugs.

From #5746 (comment). The self-checking logic is strange:

  • It uses one global state file outside of virtualenv for caching pip version checks.
  • It uses PackageFinder component where it could just query some URL with latest tag.
  • It checks installed version instead of checking itself.

Describe the solution you'd like

@pradyunsg
Copy link
Member

pradyunsg commented Sep 24, 2018

What PackageFinder does is it encapsulates the logic needed to find all the available versions of a package (in this case, pip itself) -- among a lot of other things.

Cache pip version check state local to virtualenv

We removed this functionality in #5419. There is only one latest version of pip, so we don't need to check upstream unless it changes, which is where the caching comes in.


I don't think anything would change on this front unless Warehouse gets a new endpoint for fetching the latest version number of a package -- information that is already exposed in a different manner already.

@pradyunsg pradyunsg added type: enhancement Improvements to functionality type: feature request Request for a new feature state: blocked Can not be done until something else is done labels Sep 24, 2018
@techtonik
Copy link
Contributor Author

Why pip needs to find all available versions of itself? It should only check its own version, exposed through at attribute somewhere. PackageFinder complicates startup time.

@cjerdonek
Copy link
Member

cjerdonek commented Aug 9, 2019

Why pip needs to find all available versions of itself? ... PackageFinder complicates startup time.

FWIW, with changes recently merged (summarized e.g. in this comment here), pip now no longer imports the PackageFinder machinery unless it's a command that already needs to create a network session (specifically download, install, list, search, uninstall, and wheel). So startup is now simpler in the general case.

Also (and this part is the way it was before), for the record pip only does the self-check for the following four commands: download, install, list, and wheel (the commands with the "index group" options like --no-index).

@pradyunsg
Copy link
Member

Indeed.

I don't think anything would change on this front unless Warehouse gets a new endpoint for fetching the latest version number of a package -- information that is already exposed in a different manner already.

IMO it is unlikely that PyPI/Warehouse/PEP 503 would gain such an endpoint. It adds another endpoint that has to be cached and the only location where this endpoint would be used by pip is for self-checking its own version. None the less, we can revisit this if and when such an endpoint is added to Warehouse.

Since there's nothing actionable for on this today, I'll go ahead and close this. Please feel free to leave a comment if someone disagrees with my assessment though.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Sep 9, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation state: blocked Can not be done until something else is done type: enhancement Improvements to functionality type: feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants