Commit Graph

806 Commits

Author SHA1 Message Date
Tom Christie
db4e417a13
Version 0.14.1 (#1164) 2020-08-11 12:04:03 +01:00
Felix Hildén
f540bd0bcf
Expand client docstrings (#1152)
* Add AsyncClient.aclose to API documentation

* Expand client docstrings
* Add docstrings for all verbs and close methods
* Include parameter merge information and see also

* Update _client.py

Co-authored-by: Tom Christie <tom@tomchristie.com>
2020-08-11 10:08:53 +01:00
Joe
45de714592
Map rfc3986 exceptions (#1163)
* Map rfc3896 exceptions
2020-08-11 09:44:56 +01:00
Tom Christie
7edfe64da6
Minor rfc3986 refactoring (#1157)
* Minor rfc3986 refactoring

* Update _models.py
2020-08-10 16:46:37 +01:00
Tom Christie
4cf74bc405
Fix behaviour with multiple Set-Cookie headers (#1156) 2020-08-10 14:53:51 +01:00
Riccardo Magliocchetti
b9db5e149e
Fix typo in 0.14.0 changelog (#1148) 2020-08-08 08:38:08 +01:00
Tom Christie
a25d924bb9
Minor formatting tweak to CHANGELOG (#1142)
* Update CHANGELOG.md

* Update CHANGELOG.md
2020-08-07 16:12:52 +01:00
Tom Christie
8c7729e42c
Version 0.14.0 (#1083)
* Version 0.14.0

* Update CHANGELOG

* Update CHANGELOG.md

Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com>

* Update CHANGELOG

* max_keepalive_connections

* Add deprecation test

* Update CHANGELOG.md

* Undate dependency pin callout

* Update expected 1.0 release date

Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com>
2020-08-07 15:50:25 +01:00
Tom Christie
8d9dfb54fc
HTTP/2 becomes fully optional (#1140)
* HTTP/2 becomes fully optional

* Fix linting, coverage
2020-08-07 15:16:21 +01:00
Tom Christie
360b63d4f4
Document exceptions (#1138)
* Document exceptions

* Update exceptions.md
2020-08-07 14:17:49 +01:00
Tom Christie
876e722b24
Update to httpcore 0.10 (#1126)
* Keep HTTPError as a base class for .request() and .raise_for_status()

* Updates for httpcore 0.10

* Update httpx/_exceptions.py

Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com>

* Use httpcore.SimpleByteStream/httpcore.IteratorByteStream

* Use httpcore.PlainByteStream

* Merge master

* Update to httpcore 0.10.x

Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com>
2020-08-07 14:14:11 +01:00
cdeler
0a38695063
Fixed warnings in unit tests suite, caused by #1127 PR (#1137) 2020-08-06 13:41:11 +01:00
cdeler
7123b0f7ba
#1066 make BaseClient's timeout accessible using getters and setters (#1135) 2020-08-06 12:09:21 +01:00
Tom Christie
0e73be83a8
Deprecate URL.is_ssl (#1128) 2020-08-05 19:10:59 +01:00
Tom Christie
3205536a09
Note on differences in proxy keys vs. requests (#1132)
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2020-08-05 19:06:03 +01:00
Tom Christie
a3392c6ea7
Base URL improvements (#1130)
* URL.join(url=...), not URL.join(relative_url=...)

* Fix URL.join()

* Support no argument 'httpx.URL()' usage

* Support client.base_url as a property

* Resolve base_url joining behaviour

* Fix coverage

* Update _client.py
2020-08-05 18:56:25 +01:00
cdeler
7279ed4658
Raise warning if proxy key is eg. "all" instead of "all://". (#1127)
* #1105 added deprecation warning, raised when we try to use proxies={"http": ...} instead of {"http://": ...}. Updated docs and added unit, which check the warning presence

* Update tests/client/test_proxies.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>

* Update tests/client/test_proxies.py

Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2020-08-05 18:41:50 +01:00
Tom Christie
1da46f3de0
Clean up keyword argument name, using URL.join(url=...), not URL.join(relative_url=...). (#1129)
* URL.join(url=...), not URL.join(relative_url=...)

* Fix URL.join()
2020-08-05 18:32:34 +01:00
Florimond Manca
78cf16ace9
Drop HSTS Preloading (#1110)
* Drop HSTS Preloading

* Update test_client.py

Co-authored-by: Tom Christie <tom@tomchristie.com>
2020-08-05 13:05:45 +01:00
Tom Christie
d7aa6e0189
Keep HTTPError as a base class for .request() and .raise_for_status() (#1125) 2020-08-03 20:06:18 +01:00
Florimond Manca
0fb28e8cab
Refine docs phrasing on proxy routing (#1124) 2020-08-03 10:29:03 +01:00
Florimond Manca
70cdd95006
Revamp proxies documentation (#1123) 2020-08-02 14:02:43 +02:00
Tom Christie
0e7730bccc
Setting app=... or transport=... should bypass environment proxies. (#1122)
* Setting app= or transport= should bypass proxies

* Tweak
2020-08-02 12:42:36 +01:00
Tom Christie
e5f87434a5
Use get_list consistently (#1119)
* Use get_list consistently

* Ensure DeprecationWarning on getlist vs. get_list
2020-08-02 11:33:50 +01:00
Joe
d76b2c2fb7
Handle bare env proxy hostname gracefully (#1120) 2020-08-02 10:48:09 +01:00
Tom Christie
682cad39eb
Cleaner no proxy support (#1103)
* Add internal URLMatcher class

* Use URLMatcher for proxy lookups in transport_for_url

* Docstring

* Pin pytest

* Add support for no-proxies configurations

* Don't call should_not_proxy on each request

* Drop print statements

* Tweak comment

* Tweak comment on domain wildcards

* Update httpx/_utils.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>

* Pull test_should_not_be_proxied cases into test_proxies_environ

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2020-08-02 10:00:45 +01:00
Florimond Manca
f67e925f72
Rename PoolLimits to Limits (#1113)
* Rename PoolLimits to Limits

* Lint

Co-authored-by: Tom Christie <tom@tomchristie.com>
2020-08-01 20:44:58 +01:00
Florimond Manca
26cd4f54e8
Switch to more concise Timeout parameters (#1111)
* Switch to more concise Timeout parameters

* Update docs

* Rename attributes

Co-authored-by: Tom Christie <tom@tomchristie.com>
2020-08-01 19:59:01 +01:00
Florimond Manca
a9284214e2
Make Headers.keys(), Headers.values() and Headers.items() return set-like views (#1114) 2020-08-01 20:15:15 +02:00
Florimond Manca
a110072bba
Client.trust_env becomes read-only (#1112) 2020-08-01 12:04:38 +02:00
Florimond Manca
71d5234305
Rename URLMatcher -> URLPattern (#1109) 2020-08-01 11:07:31 +02:00
Tom Christie
c6022dea9f
Drop the auto-prompting 'do you want to run scripts/lint now' (#1107) 2020-08-01 09:39:28 +01:00
Tom Christie
9409900898
Exception hierarchy (#1095)
* Exception heirachy

* Exception heirarchy

* Formatting tweaks

* Update httpx/_exceptions.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>

* Update httpx/_exceptions.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>

* Update httpx/_exceptions.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>

* Update httpx/_exceptions.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2020-07-31 12:57:49 +01:00
Tom Christie
2ba9c1ed90
Consistent multidict methods (#1089)
* Consistent multidict methods

* Consistent multidict methods and behaviour

* Update httpx/_models.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>

* Update httpx/_models.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2020-07-31 11:46:35 +01:00
Tom Christie
dba83d45a5
httpx.Timeout must include a default (#1085)
* httpx.Timeout must include a default

* Tweak docstring

* Gentle deprecation for mandatory default on httpx.Timeout(...)

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2020-07-31 11:41:53 +01:00
Tom Christie
e1a7d5a4ae
Use public API only from transports (#1096)
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2020-07-31 11:30:55 +01:00
Tom Christie
16893e414f
Add support for no-proxy configurations (#1099)
* Add internal URLMatcher class

* Use URLMatcher for proxy lookups in transport_for_url

* Docstring

* Pin pytest

* Add support for no-proxies configurations
2020-07-31 10:21:11 +01:00
Tom Christie
df54890c15
URL matching (#1098)
* Add internal URLMatcher class

* Use URLMatcher for proxy lookups in transport_for_url

* Docstring

* Pin pytest

* Update httpx/_utils.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2020-07-31 10:11:49 +01:00
Tom Christie
9728d8960f
Ignore PermissionError in netrc_info() (#1104)
* Ignore PermissionError in netrc_info()
2020-07-30 15:40:13 +01:00
Tom Christie
31e587c037 Pin pytest 2020-07-30 15:31:03 +01:00
Can Sarıgöl
926a55a84f
Included create_ssl_context function to create the same context with SSLConfig and serve as API (#996)
* Included create_ssl_context function to create the same context with SSLConfig and serve as API.

* Changed create_ssl_context with SSLConfig into the client implementation and tests.

* Dropped the __repr__ and __eq__ methods from SSLConfig and removed SSLConfig using from tests

* Fixed test issue regarding cert_authority trust of ssl context

Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2020-07-27 19:46:46 +01:00
Tom Christie
35f09d1394
Single consistent name for status codes (#1088)
* Single consistent name for status codes
* Gentle deprecation for httpx.StatusCode
2020-07-27 14:35:01 +01:00
Tom Christie
2e60e145d7
Drop extraneous proxy argument on URLLib3Transport. (#1090)
* Update urllib3.py

Drop `proxy` argument that has been accidentally left over on `URLLib3Transport`.
It's not used anywhere, and it's not relevant since we seperate `URLLib3Transport` and `URLLib3ProxyTransport` classes.

* Update urllib3.py
2020-07-26 20:45:17 +01:00
Tom Christie
6421575f5f
Tighten public API on auth classes (#1084)
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2020-07-26 19:05:33 +01:00
Tom Christie
50b17fdd65
Keep Proxy._build_auth_header as a private method (#1087) 2020-07-26 18:27:07 +01:00
Tom Christie
2d491c9e7d
Full coverage, with exception of URLLib3Transport (#1086) 2020-07-24 15:24:06 +01:00
Tom Christie
c089480260
URL.port becomes Optional[int] (#1080)
* URL.port becomes Optional[int], not int

* Minor _transport_for_url refactor

* Add docstring
2020-07-24 11:42:13 +01:00
Tom Christie
696c1eff03
Parameterize invalid URL tests (#1079) 2020-07-23 10:40:00 +01:00
Tom Christie
7e6e35160f
Drop URL(allow_relative=bool) (#1073)
* Drop URL(allow_relative=bool)

* Update httpx/_models.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>

* Linting

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2020-07-23 10:16:51 +01:00
Tom Christie
083d2e9aa0
Include 'request' on TooManyRedirect and RequestBodyUnavailable (#1077) 2020-07-23 09:55:21 +01:00