-
-
Notifications
You must be signed in to change notification settings - Fork 18
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 HttpAuthenticationType to add callable #133
Conversation
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 PR itself bring a valid point. I had to make a change to avoid making a whole TypeAlias being a string. Some IDE / type checkers may not like it. It is most importantly a personal design choice.
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.
Thanks for the review and fix. I did not know that TypeAlias were allowed to be partial strings. I think it is better that way.
**Added** - Official support for Python 3.13 - Support for asynchronous auth callables. - Support for asynchronous bodies through `AsyncIterable` that yield either bytes or str. - Support for purposely excluding a domain/port from connecting to QUIC/HTTP3 via the `quic_cache_layer` property of `Session`. In order to exclude `cloudflare.com` from HTTP3 auto-upgrade: ```python from niquests import Session s = Session() s.quic_cache_layer.exclude_domain("cloudflare.com") ``` **Fixed** - auth argument not accepting a function according to static type checkers. (#133) - RequestsCookieJar having a lock in `AsyncSession`. Its effect has been nullified to improve performances. **Changed** - urllib3-future lower bound version is raised to 2.8.902
**Added** - Official support for Python 3.13 - Support for asynchronous auth callables. - Support for asynchronous bodies through `AsyncIterable` that yield either bytes or str. - Support for purposely excluding a domain/port from connecting to QUIC/HTTP3 via the `quic_cache_layer` property of `Session`. In order to exclude `cloudflare.com` from HTTP3 auto-upgrade: ```python from niquests import Session s = Session() s.quic_cache_layer.exclude_domain("cloudflare.com") ``` **Fixed** - auth argument not accepting a function according to static type checkers. (#133) - RequestsCookieJar having a lock in `AsyncSession`. Its effect has been nullified to improve performances. **Changed** - urllib3-future lower bound version is raised to 2.8.902
**Added** - Official support for Python 3.13 - Support for asynchronous auth callables. - Support for asynchronous bodies through `AsyncIterable` that yield either bytes or str. - Support for purposely excluding a domain/port from connecting to QUIC/HTTP3 via the `quic_cache_layer` property of `Session`. In order to exclude `cloudflare.com` from HTTP3 auto-upgrade: ```python from niquests import Session s = Session() s.quic_cache_layer.exclude_domain("cloudflare.com") ``` **Fixed** - auth argument not accepting a function according to static type checkers. (#133) - RequestsCookieJar having a lock in `AsyncSession`. Its effect has been nullified to improve performances. **Changed** - urllib3-future lower bound version is raised to 2.8.902
3.7.1 (2024-07-07) ------------------ **Added** - Official support for Python 3.13 - Support for asynchronous auth callables. - Support for asynchronous bodies through `AsyncIterable` that yield either bytes or str. - Support for purposely excluding a domain/port from connecting to QUIC/HTTP3 via the `quic_cache_layer` property of `Session`. In order to exclude `cloudflare.com` from HTTP3 auto-upgrade: ```python from niquests import Session s = Session() s.quic_cache_layer.exclude_domain("cloudflare.com") ``` **Fixed** - auth argument not accepting a function according to static type checkers. (#133) - RequestsCookieJar having a lock in `AsyncSession`. Its effect has been nullified to improve performances. **Changed** - urllib3-future lower bound version is raised to 2.8.902 --------- Co-authored-by: MtkN1 <51289448+MtkN1@users.noreply.github.com>
Add a callable object to the
HttpAuthenticationType
type definition.A type checking error occurs when a callable object is given as the
auth
argument.Reproduction code
This is allowed at runtime.
niquests/src/niquests/models.py
Lines 615 to 647 in d83ab6b