Skip to content
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

Add treq.cookies helper module #385

Merged
merged 5 commits into from May 1, 2024
Merged

Add treq.cookies helper module #385

merged 5 commits into from May 1, 2024

Conversation

twm
Copy link
Contributor

@twm twm commented May 1, 2024

A bunch of cookie-related stuff, incrementally stepping towards addressing #325:

  • Add tests that cover the (suprising!) way that cookiejars get updated.
  • Extract a scoped_cookie() helper for creating Cookie objects.
  • Add a search() function for searching a cookiejar.
  • Fix a CookieAgent MyPy failure.
  • Improve the typing of treq.response._Response (including its cookie() method).

Fixes #384.

twm added 3 commits April 30, 2024 15:27
And fix a CookieAgent failure.

Fixes #384.
If we're going to ditch requests.cookies we need to offer *something*
less raw than a bare CookieJar.
@twm twm requested a review from a team May 1, 2024 03:22
Copy link
Member

@adiroiban adiroiban left a comment

Choose a reason for hiding this comment

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

Thanks for the update.
It looks good. Only minor comments.

Happy to see more stdlib usage

)


def raid(
Copy link
Member

Choose a reason for hiding this comment

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

minor comment

I am not familiar with other cookie API ... maybe this naming makes sense...maybe this is a fun name... I don't know.

Maybe call it search ? ... to be dull and boring


I was expecting to find this functionality in stdlib

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@twm
Copy link
Contributor Author

twm commented May 1, 2024

@adiroiban Thank you for the swift review! I renamed raid() to search() as you suggested.

@twm twm merged commit ebe8f37 into trunk May 1, 2024
16 checks passed
@twm twm deleted the 384-mypy-cookiejar branch May 1, 2024 21:13
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.

MyPy failure due to CookieAgent type annotations
2 participants