-
-
Notifications
You must be signed in to change notification settings - Fork 976
Feature: optional pycurl #2269
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
Feature: optional pycurl #2269
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2269 +/- ##
==========================================
- Coverage 81.55% 80.20% -1.35%
==========================================
Files 77 78 +1
Lines 9541 9741 +200
Branches 1162 1199 +37
==========================================
+ Hits 7781 7813 +32
- Misses 1568 1731 +163
- Partials 192 197 +5 ☔ View full report in Codecov by Sentry. |
Nusnus
left a comment
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.
The py-kafka failures are not related
|
v5.7 or 5.6 for this? |
|
|
||
|
|
||
| def Client(hub: Hub | None = None, **kwargs: int) -> BaseClient: | ||
| """Create new HTTP client.""" |
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.
will this work as expected? we are not using any try except block here, I'm open to better suggestions as well
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.
i've looked at try-catch, but liner was complaining. and.. the .curl code already has this ImportError exception handling. so until the CurlClient is instantiated - there will be no exception. however the CurlClient.Curl will be None.
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.
ima gonna test the code now
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.
the code seems to work without pycurl and no thrown Exceptions
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.
ok
|
hopefully the kafka builds will pass now |
|
kafka is passing now |
|
for a saner approach, should we just revert it first and then you come with your urllib3 patch again cleanly but keeping pycurl as default one? |
|
@auvipy the reverting is not great for me. but the reported problem is in the existing code from before my changes |
So the slow downs aren't related to the dep changes? |
I can't yet figure out how to install pycurl on awslinux2023 yet (this is why I picked this migration in the first place) to test both speeds. |
no they are somewhat related. also we had to use sqs internal / private api which was faster, later we moved to saner public api but with performance regression, then again revert and adding new code. and recently moving to new json protocol properly. |
|
|
||
|
|
||
| def Client(hub: Hub | None = None, **kwargs: int) -> BaseClient: | ||
| """Create new HTTP client.""" |
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.
ok
| bumpversion==0.6.0 | ||
| pydocstyle==6.3.0 | ||
| mypy==1.14.1 | ||
| types-pycurl>=7.43.0.5; sys_platform != 'win32' and platform_python_implementation=="CPython" |
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.
what is types-pycurl? did the package name changed?
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.
Was suggested by mypy. Otherwise mypy ci was failing
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.
Weren't we using only pycurl?
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.
I started to get this error only now, and types-pycurl was suggested. The error was related to mypy build (which I am not very familiar with). Then I saw other types-* are already used from the same repo. And then if pycurl is optional then full pycurl dependency is not required and types-pycurl would be sufficient to pass mypy build. I suppose mypy build does typechecking that is why it errored
|
just tested the code. finally solved my so the code in this PR - however,.. i'll post speed tests soon back in the issue ticket #2258 |
Nusnus
left a comment
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.
It appears to be working finally, thank you so much @spawn-guy 🙏
I'll review it this week
This reverts commit ea86b85.
for more information, see https://pre-commit.ci
1e9a732 to
5b40be2
Compare
|
deprecated by #2312 |
as it was reported
urllib3might be slow(er) thanpycurlas an http client. (or even "not working" in 1 unverified report)this PR brings the curl back. and uses
pycurlwhen available, reverting tourllib3when notas the
pycurldependency was removed from being required bysqsextra moduleto use pycurl - users need to explicitly add and install pycurl library on their own.
the last required version in
pip/requirements.txtformat was