-
Notifications
You must be signed in to change notification settings - Fork 396
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
fix: use urllib3.connection where needed. #697
Conversation
Hi! Please, ensure to give |
Hmm, not quite sure what the failure means. I am not that familiar with tox. Error for 3.10 seems to be Ok, the first word in above error is actually like a step which was executed before. So eventually I found the failing test. For 3.10 it was a linting error, weird change as it removes a line and adds one on the same number. But running black locally gave the same result, so likely a hidden character. This is fixed. For 3.11 I think it was a flakey httpbin call, this has been mentioned before here. So maybe re-running the CI might help? |
Note that CI only runs against urllib3<2, so you should add an env to test >2. |
I think I just fixed that by reverting the tox.ini back to use urllib3 instead of urllib3<2 |
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #697 +/- ##
==========================================
- Coverage 89.74% 89.55% -0.20%
==========================================
Files 27 27
Lines 1746 1752 +6
Branches 311 311
==========================================
+ Hits 1567 1569 +2
- Misses 144 148 +4
Partials 35 35
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Hmpf, the failure is again on the linting step for 3.10. This is due to me being too lazy to figure out how to setup the tox env properly. I will do it some time soon, but for now the lint step will be trial and error :) I did run isort and found the step for linting in tox.ini. So also ran flake8 on patch, but this seemed fine. |
Ah, @therve! I get your point now. My revert made us test against v2+, but no longer against earlier versions. Should we create an env for this? I am not sure how this is best done, so if you have experience with it, feel free to do it or provide guidance :) |
I am somewhat baffled by the errors on this workflow. They are only on the two steps where I removed the urllib3 version constraint. Guess I will have to run the tests locally :D |
@shifqu all you need is tox — either through PyPI or a distro package — and then run |
Thanks! I started reading up on tox and was indeed amazed how simple it actually is. I am currently attempting to debug what is going on :) |
@shifqu cool — good luck! 👍 👍 |
@shifqu could you rebase this onto latest master? The new conflicts are mostly deletions. Please let me know if you need help with resolving the conflicts. |
Since urllib3 v2 the re-export of connection.HTTPConnection in urllib3.connectionpool was removed. In this commit we use urllib3.connection where needed. Some references to connectionpool.HTTPConnection are still there for backward compatibility. Closes kevin1024#688
In kevin1024#690 a quick fix was introduced to get a green ci, this change should no longer be required.
e219244
to
600f62b
Compare
Hey @hartwork, I just rebased. For this PR in general, I am confident that the AttributeError is fixed, but I suspect something in the new version of urllib messes with our mocked requests and returns I haven't been able to look at it more closely during the weekend, but will attempt to make some time this week. |
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.
For line 53 (new version), should we not have the else
branch in case the error is not raised? So that we save the requests types in the variables _VerifiedHTTPSConnection, _connHTTPConnection, _connHTTPSConnection
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.
@hartwork forgot to tag :)
As I mentioned in the other pull request the change of the response type messes up vcrpy big time: urllib3/urllib3#2649. When I tried that was the cause of most of the test failures once imports were fixed. |
FYI.
|
@shifqu thanks for the rebase! I'm experimenting with a few bits on top of yours at the moment, hopefully with some results before 02:00 UTC+2 tonight. |
@kuzminrobin that seems mistaken, both symbols exist, both symbols need to be patched, I think. Could you elaborate why you think this way? The fact that the code sets |
@hartwork, I don't insist. Yes, I may be mistaken. Just the migration guide made me think that way. I'm not familiar with the code base. I just provided the link to the migration guide just in case, and wanted to make sure that the Good luck in your fix efforts! |
The thing with changing |
Is there any chance that this issue will be resolved by end of month? |
Hey @kuzminrobin . I hadn’t gotten around to it, but this PR will be closed in favor of #699 |
@kuzminrobin we appreciate help with debugging why/how pull request #699 works with Python 3.10/3.11 but not 3.7/3.8/3.9, that's a blocker so far: we cannot go forward before that's better understood. The pull request has more details in its comments. |
Since urllib3 v2 the re-export of connection.HTTPConnection in urllib3.connectionpool was removed.
In this commit we use urllib3.connection where needed. Some references to connectionpool.HTTPConnection are still there for backward compatibility.
Closes #688