Commit Graph

1056 Commits

Author SHA1 Message Date
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
Tom Christie
50790af69b
Update HTTP/2 support in extras_require (#1799)
* Update extras_require

* Update setup.py
2021-08-13 11:07:13 +01:00
Tom Christie
541a0afe56
Add Client(allow_redirect=<...>) (#1790) 2021-08-10 13:30:55 +01:00
Michał Górny
ee24e67180
Fix JSON wrong encoding tests on big endian platforms (#1781)
Fix test_json_without_specified_encoding_*_error tests on big endian
platforms.  The tests wrongly assume that data encoded as "utf-32-be"
can not be decoded as "utf-32".  This is true on little endian platforms
but on big endian platforms "utf-32" is equivalent to "utf-32-be".
To avoid the problem, explicitly decode as "utf-32-le", as this should
trigger the expected exception independently of platform's endianness.
2021-08-05 17:05:38 +01:00
Michał Górny
8c64e0c65f
Inline SERVER_SCOPE and remove typing_extensions requirement (#1773) 2021-07-26 15:08:58 +01:00
Almaz
b839478661
Replace for loops with comprehensions (#1759) 2021-07-21 14:30:55 +01:00
Adrian Garcia Badaracco
b169013115
Fix typo in wsgi.py (#1749) 2021-07-14 10:08:21 +01:00
Thomas Grainger
ab64f7c41f
check sys.version_info and ssl.OPENSSL_VERSION_INFO once (#1720) 2021-06-28 13:20:32 +01:00
Thomas Grainger
1737fc6229
use context.minimum_version in py3.7+ where available (#1714) 2021-06-28 13:12:30 +01:00
Florimond Manca
3d192aed45
Allow passing additional pytest args to scripts/test (#1710) 2021-06-24 11:15:59 +01:00
Joe
6b93787514
Test under Python 3.10b3 (#1707) 2021-06-22 13:25:19 +01:00
Sidharth Vinod
bb7f7dfda8
Add httpx-caching (#1694) 2021-06-17 13:30:33 +01:00
Sidharth Vinod
5096663181
Fix third party documentation link (#1691) 2021-06-17 11:37:03 +01:00
Tom Christie
f312e629bf
Version 0.18.2 (#1690)
* Version 0.18.2
2021-06-17 11:29:22 +01:00
Tom Christie
b43af721cd
Treat warnings as errors (#1687)
* 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>
2021-06-16 15:34:12 +01:00
laggardkernel
47d712c01c
Fix typo (#1688) 2021-06-16 07:52:39 +02:00