-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Move PackageFinder's --trusted-host logic to PipSession #6903
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cjerdonek
added
type: refactor
Refactoring code
skip news
Does not need a NEWS file entry (eg: trivial changes)
C: finder
PackageFinder and index related code
labels
Aug 21, 2019
cjerdonek
force-pushed
the
move-trusted-hosts
branch
from
August 21, 2019 10:04
da3e058
to
639ca60
Compare
pradyunsg
approved these changes
Aug 21, 2019
This one's good @cjerdonek! ^>^ |
Awesome, thanks! |
chrahunt
reviewed
Aug 22, 2019
chrahunt
reviewed
Aug 22, 2019
cjerdonek
force-pushed
the
move-trusted-hosts
branch
from
August 22, 2019 07:04
639ca60
to
ce218c3
Compare
Thanks for reviewing, @chrahunt. I updated the PR. |
chrahunt
approved these changes
Aug 22, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 👍
lock
bot
added
the
auto-locked
Outdated issues that have been locked by automation
label
Sep 21, 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
C: finder
PackageFinder and index related code
skip news
Does not need a NEWS file entry (eg: trivial changes)
type: refactor
Refactoring code
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR moves
PackageFinder
's--trusted-host
logic toPipSession
.Before this PR, the
--trusted-host
state and logic was spread across two classes:PipSession
(via itsself.mount()
calls) andPackageFinder
(from itstrusted_hosts
attribute). This meant that both classes had to know about the trusted hosts and be kept in sync with each other when updating the trusted hosts.Moving
PackageFinder
's--trusted-host
logic toPipSession
lets all of this logic be kept in one place. It also makesPackageFinder
simpler, because (1)PackageFinder
no longer has to know about or have methods to manage the trusted hosts (aside from a single property that delegates to the underlyingPipSession
), and (2) we no longer need to pass thetrusted_hosts
value toPackageFinder
as an argument when constructing thePackageFinder
instance (we only need to pass thePipSession
argument). So the argument list becomes smaller on thePackageFinder
side.Putting it wholly in
download.py
also makes sense from a subject matter perspective.