* fix: NO_PROXY supports IPv4, IPv6 and localhost
* add more tests for test_get_environment_proxies
---------
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Replace quadratic algo in LineDecoder
Leading to enormous speedups when doing things such as
Response(...).iter_lines() as described on issue #2422
* Update httpx/_decoders.py
* Update _decoders.py
Handle text ending in `\r` more gracefully.
Return as much content as possible.
* Update test_decoders.py
* Update _decoders.py
* Update _decoders.py
* Update _decoders.py
* Update httpx/_decoders.py
Co-authored-by: cdeler <serj.krotov@gmail.com>
* Update _decoders.py
---------
Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: cdeler <serj.krotov@gmail.com>
* fix type annotation for MockTransport
* add type ignore
* better type checks
* better type checks
* add pragma
---------
Co-authored-by: Tom Christie <tom@tomchristie.com>
* NetRCAuth class
* Add docs for httpx.NetRCAuth()
* Drop failing cross-domain test for NetRCAuth()
* Update tests
* Update httpx/_auth.py
* Add tests for netrc file with no password
* Drop RawURL
* First pass at adding urlparse
* Update urlparse
* Add urlparse
* Add urlparse
* Unicode non-printables can be valid in IDNA hostnames
* Update _urlparse.py docstring
* Linting
* Trim away ununsed codepaths
* Tweaks for path validation depending on scheme and authority presence
* Minor cleanups
* Minor cleanups
* full_path -> raw_path, forr internal consistency
* Linting fixes
* Drop rfc3986 dependency
* Add test for #1833
* Linting
* Drop 'rfc3986' dependancy from README and docs homepage
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* replace pytest-asyncio with anyio
* remove pytest-trio also
* Update setup.cfg
* use anyio.Lock in test_auth
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Typing: enable disallow_untyped_calls
Only the test suite needed adjusting to add type hints.
* Update setup.cfg
Co-authored-by: Tom Christie <tom@tomchristie.com>
- ignore mypy when it comes to comparing an IntEnum member with an int
- Correct type hint for `test_wsgi_server_port`'s `expected_server_port`
parameter.
Co-authored-by: Tom Christie <tom@tomchristie.com>
- Add explicit exports for names imported from `_compat`
- Correct imports of `URL` (from `._urls`, not via `._models`)
- Correct import of the uvicorn `Server` class
Co-authored-by: Tom Christie <tom@tomchristie.com>
* reuse the digest auth challenge to avoid sending twice as many requests
* fix for digest testcase
* ran testing/linting scripts
* codereview changes, removed tomchristie username from all authentication tests
Co-authored-by: Philipp Reitter <p.reitter@accessio.at>
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Typing: always fill in generic type parameters
Being explicit about the parameters helps find bugs and makes the library
easier to use for users.
- Tell mypy to disallow generics without parameter values
- Give all generic types parameters values
* fix things that aren't coming in from other commits
* lint
Co-authored-by: Martijn Pieters <mj@zopatista.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Use multipart instead of cgi for multipart tests
The cgi module has been deprecated as of python 3.11.
Signed-off-by: Vincent Fazio <vfazio@gmail.com>
* Update setup.cfg
All references to the cgi module have all been removed so there's no
longer a need to silence those deprecation warnings.
The deprecation warning for certifi is resolved as of version 2022.09.24.
Signed-off-by: Vincent Fazio <vfazio@gmail.com>
Signed-off-by: Vincent Fazio <vfazio@gmail.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Add Response(..., default_encoding=...)
* Add tests for Response(..., default_encoding=...)
* Add Client(..., default_encoding=...)
* Switch default encoding to 'utf-8' instead of 'autodetect'
* Make charset_normalizer an optional dependancy, not a mandatory one.
* Documentation
* Use callable for default_encoding
* Update tests for new charset autodetection API
* Update docs for new charset autodetection API
* Update requirements
* Drop charset_normalizer from requirements
* Test case for clean stream closing on cancellations
* Test case for clean stream closing on cancellations
* Linting on tests
* responses should close on any BaseException