Skip to content

stubs/requests: expand types for files #7999

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 6 commits into from
Jun 1, 2022

Conversation

tommilligan
Copy link
Contributor

Relates to #7724
Closes #7998

This PR allows passing a sequence of tuple for the files argument, where applicable in the requests library.

Existing types have been aliased for readability, and to document that all type of file specification are supported in either the Mapping or Sequence[tuple] form.

@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! I dug around in the source code and tried out your repro, all looks good. Just one comment about how we can simplify the code a little, and also make the stub a little more permissive.

@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.

LGTM, but given the number of issues we've had with requests stubs recently, I'd like a second opinion before merging :)

@AlexWaygood AlexWaygood requested a review from Akuli May 31, 2022 11:44
@github-actions

This comment has been minimized.

Copy link
Collaborator

@Akuli Akuli left a comment

Choose a reason for hiding this comment

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

I'm mostly concerned about using _TextMapping. The rest are small nits.

@github-actions

This comment has been minimized.

@tommilligan tommilligan requested a review from Akuli May 31, 2022 16:31
@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2022

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Collaborator

@Akuli Akuli left a comment

Choose a reason for hiding this comment

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

Thanks!

@Akuli Akuli merged commit 51f97dd into python:master Jun 1, 2022
@isFakeAccount
Copy link

Which version will reflect these changes?

@tommilligan
Copy link
Contributor Author

@isFakeAccount I can confirm these changes were released as of at least types-requests 2.27.30

pip install types-requests==2.27.30 -U 

@tommilligan tommilligan deleted the requests-files-tuples branch June 28, 2022 06:21
@isFakeAccount
Copy link

Thanks for the quick response @tommilligan

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.

requests: allow passing a list of tuples for files
4 participants