Skip to content

refactor: use re-exports in requests rather than assignments #8485

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

Merged
merged 4 commits into from
Aug 5, 2022
Merged

refactor: use re-exports in requests rather than assignments #8485

merged 4 commits into from
Aug 5, 2022

Conversation

kkirsche
Copy link
Contributor

@kkirsche kkirsche commented Aug 4, 2022

Partial: #8439

Uses re-exports of various items, adds SOCKSProxyManager and associated requirement.

X-Ref benefits from: #8467

Source:
https://github.com/psf/requests/blob/main/requests/adapters.py

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thanks, this looks great! I haven't examined in detail whether all of these re-exports are strictly necessary, but this is definitely a big improvement on the existing stub, so I'm happy for it to go in as it is.

I'll wait till the other two requests PRs are merged, and then merge master in, before merging this, but it looks good.

@kkirsche
Copy link
Contributor Author

kkirsche commented Aug 5, 2022

Makes sense, I was looking at requests after the last PR from how can I break it up into smaller, easier to review sections. It'll lead to more pull requests, but my hope was that being more focused in the PR should simplify the review and merging process. So some files, like this one, I expect will get touched multiple times as the details get refined

@AlexWaygood
Copy link
Member

Smaller, more focussed PRs are definitely good!

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2022

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/builders/linkcheck.py:18: note: ... from here:

bokeh (https://github.com/bokeh/bokeh)
+ bokeh/_testing/plugins/bokeh_server.py:32: note: ... from here:

cwltool (https://github.com/common-workflow-language/cwltool)
+ cwltool/docker.py:15: note: ... from here:

schemathesis (https://github.com/schemathesis/schemathesis)
+ src/schemathesis/cli/__init__.py:15: note: ... from here:
+ src/schemathesis/cli/__init__.py:15: note: ... from here:
+ src/schemathesis/cli/__init__.py:15: note: ... from here:
- src/schemathesis/service/client.py:7: note: ... from here:
- src/schemathesis/service/client.py:7: note: ... from here:
- src/schemathesis/service/client.py:7: note: ... from here:
+ src/schemathesis/cli/__init__.py:15: note: ... from here:
+ src/schemathesis/cli/__init__.py:15: note: ... from here:
+ src/schemathesis/cli/__init__.py:15: note: ... from here:
+ src/schemathesis/cli/__init__.py:15: note: ... from here:
- src/schemathesis/service/client.py:7: note: ... from here:
- src/schemathesis/service/client.py:7: note: ... from here:
- src/schemathesis/runner/events.py:6: note: ... from here:

schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/tests/test_cwl11.py:13: note: ... from here:

@AlexWaygood
Copy link
Member

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/builders/linkcheck.py:18: note: ... from here:

bokeh (https://github.com/bokeh/bokeh)
+ bokeh/_testing/plugins/bokeh_server.py:32: note: ... from here:

cwltool (https://github.com/common-workflow-language/cwltool)
+ cwltool/docker.py:15: note: ... from here:

schemathesis (https://github.com/schemathesis/schemathesis)
+ src/schemathesis/cli/__init__.py:15: note: ... from here:
+ src/schemathesis/cli/__init__.py:15: note: ... from here:
+ src/schemathesis/cli/__init__.py:15: note: ... from here:
- src/schemathesis/service/client.py:7: note: ... from here:
- src/schemathesis/service/client.py:7: note: ... from here:
- src/schemathesis/service/client.py:7: note: ... from here:
+ src/schemathesis/cli/__init__.py:15: note: ... from here:
+ src/schemathesis/cli/__init__.py:15: note: ... from here:
+ src/schemathesis/cli/__init__.py:15: note: ... from here:
+ src/schemathesis/cli/__init__.py:15: note: ... from here:
- src/schemathesis/service/client.py:7: note: ... from here:
- src/schemathesis/service/client.py:7: note: ... from here:
- src/schemathesis/runner/events.py:6: note: ... from here:

schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/tests/test_cwl11.py:13: note: ... from here:

This is weird, but I think it's fine.

@AlexWaygood AlexWaygood merged commit 3e88363 into python:master Aug 5, 2022
@kkirsche kkirsche deleted the requests/reexports branch August 5, 2022 11:48
@JelleZijlstra
Copy link
Member

@hauntsaninja do you have any idea what's causing the mypy-primer diff above?

@hauntsaninja
Copy link
Collaborator

Probably related to switching imports around:
https://github.com/python/mypy/blob/11fe16548c06cc67d6288d08cc6b27379ff974a0/mypy/errors.py#L854

primer is probably also obscuring the real change in message because: hauntsaninja/mypy_primer#12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants