* 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>
* 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 a network pytest mark for tests that use the network
Sometimes it's useful to have the tests that use the network
marked so they can be skipped easily when we know the network
is not available.
This is useful for example on SUSE and openSUSE's build servers.
When building the httpx packages (actually, any package in the
distribution) the network is disabled so we can assure
reproducible builds (among other benefits). With this mark, it's
easier to skip tests that can not succeed.
* Add a better explanation for the network marker
Co-authored-by: Florimond Manca <15911462+florimondmanca@users.noreply.github.com>
Co-authored-by: Joe <nigelchiang@outlook.com>
Co-authored-by: Florimond Manca <15911462+florimondmanca@users.noreply.github.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Treat warnings as errors
* Defensive programming in Client.__del__ to avoid possible warnings on partially initialized instances
* Linting
* Ignore linting getattr errors in __del__
* getattr requires a default
* Tighten up closing of auth_flow generators
* Switch multipart test to open file in a context manager
* Ignore warnings on uvicorn
* Drop -Werror from addopts
* Warings specified entirely in 'filterwarnings' section
* Use ssl.PROTOCOL_TLS_CLIENT instead of deprecated ssl.PROTOCOL_TLS
* Push 'check_hostname = False' above 'context.verify_mode = ssl.CERT_NONE'
* Introduce set_minimum_tls_version_1_2 compatible across different python versions
* Commenting
* Add missing annotation
* Exclude _compat from coverage
Co-authored-by: Joe <nigelchiang@outlook.com>
Co-authored-by: jianghang <jianghang@didiglobal.com>
* url.userinfo should be URL encoded bytes
* Neater copy_with implementation
* Finesse API around URL properties and copy_with
* Docstring for URL, and drop url.authority
* Support url.copy_with(raw_path=...)
* Docstrings on URL methods
* Tweak docstring
* First pass as switching dispatchers over to httpcore interface
* Updates for httpcore interface
* headers in dispatch API as plain list of bytes
* Integrate against httpcore 0.6
* Integrate against httpcore interface
* Drop UDS, since not supported by httpcore
* Fix base class for mock dispatchers in tests
* Merge master and mark as potential '0.13.dev0' release
* BaseClient and AsyncClient
* Introduce 'httpx.Client'
* Top level API -> sync
* Top level API -> sync
* Add WSGI support, drop deprecated imports
* Wire up timeouts to urllib3
* Wire up pool_limits
* Add urllib3 proxy support
* Pull #734 into sync Client
* Update AsyncClient docstring
* Simpler WSGI implementation
* Set body=None when no content
* Wrap urllib3 connection/read exceptions
* Drop nox in favor of vanilla scripts
* Use named stages
* Fix attrs dependency resolution madness
* Add missing mkautodoc dev dependency
* Add missing install step on windows build
* Explicitly define stage order so that timed out Windows build runs last
* Add missing dev dependency on Black
* Clean up contributing guide
* Separate docs into docs-build and docs-serve