Commit Graph

1471 Commits

Author SHA1 Message Date
Tom Christie
716749e3fd
Version 0.21.1 (#1941) 2021-11-16 11:51:56 +00:00
Tom Christie
4882e98049
Fix response.url annotation (#1940) 2021-11-16 11:47:46 +00:00
Tom Christie
b4f60694eb
Version 0.21 release notes (#1938) 2021-11-15 14:35:09 +00:00
Tom Christie
61188feeae
Version 0.21 (#1935)
* Integrate with httpcore 0.14

* Fix pool timeout test

* Add request extensions to API

* Add certificate and connection info to client, using 'trace' extension

* Fix test_pool_timeout flakiness
2021-11-15 14:30:54 +00:00
dependabot[bot]
c531263f42
Bump flake8-bugbear from 21.4.3 to 21.9.2 (#1917)
Bumps [flake8-bugbear](https://github.com/PyCQA/flake8-bugbear) from 21.4.3 to 21.9.2.
- [Release notes](https://github.com/PyCQA/flake8-bugbear/releases)
- [Commits](https://github.com/PyCQA/flake8-bugbear/compare/21.4.3...21.9.2)

---
updated-dependencies:
- dependency-name: flake8-bugbear
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-15 11:00:30 +00:00
dependabot[bot]
35b98a9f60
Bump black from 21.9b0 to 21.10b0 (#1921)
Bumps [black](https://github.com/psf/black) from 21.9b0 to 21.10b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-15 10:24:12 +00:00
dependabot[bot]
9082ed91e1
Bump types-certifi from 0.1.4 to 2021.10.8.0 (#1918)
Bumps [types-certifi](https://github.com/python/typeshed) from 0.1.4 to 2021.10.8.0.
- [Release notes](https://github.com/python/typeshed/releases)
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-certifi
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-12 13:50:39 +00:00
Tyler Chamberlain
da8f959af0
Expand docs note for async custom handler responses (#1916)
* Expand note for async custom handler responses

Custom response handlers need to run `response.read()` before they can read the content of the response. However when using an AsyncClient this will produce an error of `RuntimeError: Attempted to call a sync iterator on an async stream.`. Took me some digging to figure out I just needed to use `response.aread()` here instead of `response.read()` so figured I would an MR with an expansion on the note for anyone else.
Thanks!

* Update advanced.md
2021-11-01 11:39:18 +00:00
Adrian Garcia Badaracco
62b1666dc6
doc: Update comments about file types in _types.py (#1898)
* doc: Update comments about file types in _types.py

https://github.com/encode/httpx/discussions/1897

* Update httpx/_types.py

Co-authored-by: Tom Christie <tom@tomchristie.com>
2021-10-18 11:19:42 +01:00
dependabot[bot]
fa03b489f0
Bump flake8-pie from 0.5.0 to 0.15.0 (#1879)
* Bump flake8-pie from 0.5.0 to 0.15.0

Bumps [flake8-pie](https://github.com/sbdchd/flake8-pie) from 0.5.0 to 0.15.0.
- [Release notes](https://github.com/sbdchd/flake8-pie/releases)
- [Commits](https://github.com/sbdchd/flake8-pie/commits)

---
updated-dependencies:
- dependency-name: flake8-pie
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Don't use PIE on 3.6

* Adhere or ignore new rules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: Florimond Manca <florimond.manca@protonmail.com>
2021-10-15 12:03:53 +02:00
dependabot[bot]
c59be190e4
Bump black from 20.8b1 to 21.9b0 (#1877)
Bumps [black](https://github.com/psf/black) from 20.8b1 to 21.9b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: Florimond Manca <florimond.manca@protonmail.com>
2021-10-15 11:44:37 +02:00
Tom Christie
623b0ddeea
Don't pickle request/response extensions (#1892) 2021-10-13 13:45:29 +01:00
dependabot[bot]
885314a364
Bump wheel from 0.36.2 to 0.37.0 (#1878)
Bumps [wheel](https://github.com/pypa/wheel) from 0.36.2 to 0.37.0.
- [Release notes](https://github.com/pypa/wheel/releases)
- [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst)
- [Commits](https://github.com/pypa/wheel/compare/0.36.2...0.37.0)

---
updated-dependencies:
- dependency-name: wheel
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-13 12:02:04 +01:00
dependabot[bot]
6bc4a8d7ea
Bump coverage from 5.3 to 6.0.2 (#1891)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.3 to 6.0.2.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.3...6.0.2)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-13 11:43:07 +01:00
dependabot[bot]
d591ddbe52
Bump isort from 5.9.1 to 5.9.3 (#1881)
Bumps [isort](https://github.com/pycqa/isort) from 5.9.1 to 5.9.3.
- [Release notes](https://github.com/pycqa/isort/releases)
- [Changelog](https://github.com/PyCQA/isort/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pycqa/isort/compare/5.9.1...5.9.3)

---
updated-dependencies:
- dependency-name: isort
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-13 11:37:01 +01:00
Tom Christie
35164b7a64
Version 0.20 (#1890)
* Version 0.20

* Add date to changelog

* Freeze charset-normalizer to a known version for testing consistency
2021-10-13 10:43:58 +01:00
Marcelo Trylesinski
deb1a2b921
Update index.md (#1883)
Co-authored-by: Tom Christie <tom@tomchristie.com>
2021-10-06 13:26:49 +01:00
Marcelo Trylesinski
2212dda7c7
Bump Python 3.10 in the CI (#1886)
Co-authored-by: Tom Christie <tom@tomchristie.com>
2021-10-06 10:13:34 +01:00
Tom Christie
1752e4d672
Run CI on 3.9.5 (#1887)
* Update test-suite.yml

* Update test-suite.yml
2021-10-06 09:46:45 +01:00
Tom Christie
e1abaf146f
Tidy up the formatting of HTTP/2 requests (#1860)
* Tidy up the formatting of HTTP/2 requests

* Black linting
2021-09-14 13:36:22 +01:00
Tom Christie
d41840e18d
Fix typo. (#1859) 2021-09-14 12:48:06 +01:00
Tom Christie
7e01677f0a
List 'click' and 'rich' in the project dependencies (#1858) 2021-09-14 10:44:07 +01:00
Tom Christie
f2992442fd
Update README.md (#1857) 2021-09-14 09:54:50 +01:00
Tom Christie
ee9250d60b
Add cli support (#1855)
* Add cli support

* Add setup.py

* Import main to 'httpx.main'

* Add 'cli' to requirements

* Add tests for command-line client

* Drop most CLI tests

* Add test_json

* Add test_redirects

* Coverage exclusion over _main.py in order to test more clearly

* Black formatting

* Add test_follow_redirects

* Add test_post, test_verbose, test_auth

* Add test_errors

* Remove test_errors

* Add test_download

* Change test_errors - perhaps the empty host header was causing the socket error?

* Update test_errors to not break socket

* Update docs

* Update version to 1.0.0.beta0

* Tweak CHANGELOG

* Fix up images in README

* Tweak images in README

* Update README
2021-09-14 09:44:43 +01:00
Tom Christie
a761e17abc
is_informational / is_success / is_redirect / is_client_error / is_server_error (#1854) 2021-09-13 13:52:58 +01:00
Tom Christie
ff9813e84d
Transport API as plain request -> response method. (#1840)
* Responses as context managers

* timeout -> request.extensions

* Transport API -> request/response signature

* Fix top-level httpx.stream()

* Drop response context manager methods

* Simplify ASGI tests

* Black formatting
2021-09-13 13:34:46 +01:00
Tom Christie
47266d763b
Switch follow redirects default (#1808)
* Switch default on allow_redirects to False

* allow_redirects -> follow_redirects

* Update follow_redirects default in top-level API

* Update docs on follow_redirects
2021-09-13 13:21:22 +01:00
Adrian Garcia Badaracco
0b4a83257b
BUG: wsgi.error should be TextIO, not BytesIO in WSGI transport (#1828)
* wsgi.error should be StringIO, not BytesIO

Based on the documentation at https://modwsgi.readthedocs.io/en/master/user-guides/debugging-techniques.html#apache-error-log-files

* Default to sys.stderr and add test

* rename log_file param to wsgi_errors

Co-authored-by: Tom Christie <tom@tomchristie.com>
2021-09-07 15:44:35 +01:00
Robert Craigie
c24bbb85a6
Fix conditional imports for pyright (#1839) 2021-09-03 14:51:42 +01:00
dependabot[bot]
513a6aa067
Bump mkdocs-material from 7.1.8 to 7.2.6 (#1835)
* Bump mkdocs-material from 7.1.8 to 7.2.6

Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 7.1.8 to 7.2.6.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/docs/changelog.md)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/7.1.8...7.2.6)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update requirements.txt

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
2021-09-03 12:26:01 +01:00
dependabot[bot]
15defd1b5e
Bump twine from 3.4.1 to 3.4.2 (#1838)
Bumps [twine](https://github.com/pypa/twine) from 3.4.1 to 3.4.2.
- [Release notes](https://github.com/pypa/twine/releases)
- [Changelog](https://github.com/pypa/twine/blob/main/docs/changelog.rst)
- [Commits](https://github.com/pypa/twine/compare/3.4.1...3.4.2)

---
updated-dependencies:
- dependency-name: twine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-03 10:33:38 +01:00
dependabot[bot]
d6ecc516bf
Bump cryptography from 3.4.7 to 3.4.8 (#1837)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.7 to 3.4.8.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.4.7...3.4.8)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
2021-09-03 10:30:01 +01:00
dependabot[bot]
05df3d05a4
Bump trio-typing from 0.5.0 to 0.5.1 (#1836)
Bumps [trio-typing](https://github.com/python-trio/trio-typing) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/python-trio/trio-typing/releases)
- [Commits](https://github.com/python-trio/trio-typing/commits)

---
updated-dependencies:
- dependency-name: trio-typing
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-03 10:26:48 +01:00
Marcelo Trylesinski
62b7988a15
Add dependabot (#1823)
* Add dependabot

* Delete automerge.yml

Co-authored-by: Tom Christie <tom@tomchristie.com>
2021-09-03 10:19:15 +01:00
Stanis Trendelenburg
0d3fcc74a5
Close WSGI iterable when WSGIByteStream is closed (#1830)
* Make test fail when WSGI iterable is not closed

* Close WSGI iterable when WSGIByteStream is closed
2021-09-01 16:21:01 +01:00
TAHRI Ahmed R
ecbece178f
📝 Docs patch following PR #1791 section compatibility.encoding (#1812)
* 📝 Docs patch following PR #1791 section compatibility.encoding

Reintroducing charset detection

* 📝 Amend sentence in 3080a9d66e

Co-authored-by: Tom Christie <tom@tomchristie.com>
2021-08-31 13:44:12 +01:00
Marcelo Trylesinski
0ccc3fa9be
📌 Pin development requirements (#1721)
* 📌 Pin development requirements

*  Remove attrs dependency

* Add note about decision here

Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: Joe <jianghang@didiglobal.com>
2021-08-31 13:13:42 +01:00
Tom Christie
10b60d47c7
Fix iter_bytes with empty content (#1827) 2021-08-31 11:52:52 +01:00
Hugo van Kemenade
06498df528
Test under Python 3.10.0 RC 1 (#1820) 2021-08-27 21:01:06 +08:00
Patrick Arminio
317653585c
Fix typo in RemoteProtocolError description (#1817) 2021-08-26 09:26:06 +08:00
Florimond Manca
35de3dfeb6
Fix 0.19.0 release date in CHANGELOG (#1811) 2021-08-20 10:40:05 +01:00
Tom Christie
0d7c4caada
Version 0.19.0 (#1809)
* Update CHANGELOG

* Update CHANGELOG

* Version 0.19.0

* Update CHANGELOG
2021-08-19 12:37:25 +01:00
Tom Christie
2d9c3580e0
Switch event hooks to also run on redirects. (#1806)
* Switch event hooks to also run on redirects

* Bump coverage

* Add pragma: no cover, because sometime ya just gotta be pragmatic

* Update docs with note about response.read()
2021-08-18 15:12:39 +01:00
Tom Christie
4986743b3d
Resolve Python 3.6 tests hanging. (#1807)
* Update README.md

* Update requirements.txt

* Update README.md
2021-08-18 14:08:52 +01:00
Tom Christie
927c88d34f
Stricter enforcement of either 'with httpx.Client() as client' or 'client = httpx.Client()' lifespan styles. (#1800) 2021-08-13 15:17:15 +01:00
Antonio Larrosa
77193b2ab6
Add a network pytest mark for tests that use the network (#1669)
* 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>
2021-08-13 14:13:43 +01:00
Tom Christie
d5143120d1
Use either brotli or brotlicffi. (#1618)
* Use either brotli (recommended for CPython) or brotlicffi (Recommended for PyPy and others)

* Add comments in places where we switch behaviour depending on brotli/brotlicffi

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2021-08-13 11:52:45 +01:00
Tom Christie
acb5e6ac50
Add charset_normalizer detection. (#1791)
* Add charset_normalizer detection

* Tweak JSON tests for slightly different charset decoding behaviour

* Add charset-normalizer to docs
2021-08-13 11:38:53 +01:00
Tom Christie
77246617ca
Drop mode argument, 'httpx.Proxy(..., mode=...)' (#1795) 2021-08-13 11:34:56 +01:00
Amin Alaee
20e66d2048
enforce-upload-files-binary-type (#1736)
* enforce-upload-files-binary-type

* Update test_multipart.py

Co-authored-by: Tom Christie <tom@tomchristie.com>
2021-08-13 11:27:42 +01:00