-
Notifications
You must be signed in to change notification settings - Fork 3
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
refactor: replace requests with urllib3 #333
base: main
Are you sure you want to change the base?
Conversation
This simplifies our dependency tree a bit, since requests is built on urllib3 internally. It also chips away at a larger plan to replace requests with urllib3 in sigstore-python, per sigstore/sigstore-python#1040. Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
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.
Looks good to me technically.
Should note that this PR switches the certificate store that id uses, see discussion in sigstore/sigstore-python#1040.
else: | ||
assert False | ||
|
||
u3 = pretend.stub(request=_request, exceptions=pretend.stub(MaxRetryError=ValueError)) |
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.
could you avoid exceptions arg here by raising MaxRetryError in the first place?
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.
could you avoid exceptions arg here by raising MaxRetryError in the first place?
Unfortunately not: this happens because I stub out the entire urllib3
package, so urllib3.exeptions.MaxRetryError
would no longer be the "same" type. I could probably do a more precise stub instead, but MaxRetryError
is also an annoying one to raise in tests (since it needs to be initialized with a URL, connection pool, response, etc).
(WIP; haven't rewritten the GCP tests yet.)This simplifies our dependency tree a bit,
since requests is built on urllib3 internally.
It also chips away at a larger plan to replace
requests with urllib3 in sigstore-python, per
sigstore/sigstore-python#1040.