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

Cleanup operations.prepare more #7384

Merged
merged 8 commits into from
Nov 22, 2019

Conversation

chrahunt
Copy link
Member

Some basic information hiding so it is less onerous to split up RequirementPreparer.

Progresses #7049.

Instead of computing hashes on-the-fly we do it after fully downloading
the file. This step will let us move hash checking to a higher-level
function without introducing a lot of complexity.
A plain loop is easier to follow than chained generators consumed by
a helper function, and reduces the number of objects being passed around
just to download a file.
@chrahunt chrahunt added type: refactor Refactoring code skip news Does not need a NEWS file entry (eg: trivial changes) labels Nov 19, 2019
@chrahunt chrahunt marked this pull request as ready for review November 20, 2019 00:09
Copy link
Member

@xavfernandez xavfernandez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, really clear commits 👍

src/pip/_internal/operations/prepare.py Outdated Show resolved Hide resolved
src/pip/_internal/operations/prepare.py Show resolved Hide resolved
This abstraction will let us hide details about the actual downloading
and display of progress from most of operations.prepare.
Reduces exposure of session and progress_bar.
Reduces scope of session and progress_bar.
This simplifies the work done in the operations.prepare helper functions
and also opens up the door to remove session and progress_bar from
RequirementPreparer itself.
Just one step away from pulling this out of operations.prepare
altogether.
@chrahunt chrahunt merged commit 3ff2513 into pypa:master Nov 22, 2019
@chrahunt chrahunt deleted the refactor/cleanup-prepare-3 branch November 22, 2019 12:52
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Dec 22, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 22, 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 skip news Does not need a NEWS file entry (eg: trivial changes) type: refactor Refactoring code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants