Commit Graph

48 Commits

Author SHA1 Message Date
Joe Marshall
e9cabc8e1d
made dependencies on certifi and httpcore only load when required (#3377)
Co-authored-by: Tom Christie <tom@tomchristie.com>
2024-10-29 13:18:39 +00:00
Tom Christie
8e36f2bc68
Introduce new SSLContext API & escalate deprecations. (#3319)
Co-authored-by: Kar Petrosyan <92274156+karpetrosyan@users.noreply.github.com>
Co-authored-by: T-256 <132141463+T-256@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-10-28 14:30:08 +00:00
T-256
fd60b1815c
Ruff linter: Use the default line-length (#2922)
Co-authored-by: Tester <Tester@test.com>
Co-authored-by: Kar Petrosyan <92274156+karpetrosyan@users.noreply.github.com>
2023-11-29 13:28:31 +04:00
Iurii Pliner
b40c04dfa6
Drop support for Python 3.7 (#2813)
* Drop Python 3.7 support

* Fix lint

* Changelog
2023-08-09 10:02:28 +01:00
Adrian Garcia Badaracco
69e13cbc39
Remove and dissallow unused type ignores (#2470)
* Remove and dissallow unused type ignores

* add pragmas

* fix ignore
2022-11-29 16:55:45 +00:00
Adrian Garcia Badaracco
16e2830624
use # pragma: no cover instead of # pragma: nocover (#2471)
Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-11-29 10:23:18 -06:00
Tom Christie
8dc9b6bd59
SOCKS proxy support (#2034) 2022-01-19 14:58:19 +00:00
Tom Christie
77246617ca
Drop mode argument, 'httpx.Proxy(..., mode=...)' (#1795) 2021-08-13 11:34:56 +01:00
Tom Christie
d0835da230
Add keepalive_expiry to Limits config (#1398)
* Add keepalive_expiry to Limits config

* keepalive_expiry should be optional. In line with httpcore.
2020-11-25 15:32:37 +00:00
Tom Christie
f932af9172
Version 0.15.0 (#1301)
* Version 0.15.0

* Update CHANGELOG.md

Co-authored-by: Jamie Hewland <jamie.hewland@hpe.com>

* Escalate deprecations into removals.

* Deprecate overly verbose timeout parameter names

* Fully deprecate max_keepalive in favour of explicit max_keepalive_connections

* Fully deprecate PoolLimits in favour of Limits

* Deprecate instantiating 'Timeout' without fully explicit values

* Include deprecation notes in changelog

* Use httpcore 0.11.x

Co-authored-by: Jamie Hewland <jamie.hewland@hpe.com>
2020-09-22 11:44:28 +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
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
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
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
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
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
Florimond Manca
0296c2bbb9
Type check tests (#1054) 2020-07-07 11:10:43 +02:00
Tom Christie
991915a935
Rename pool limit options (#968)
* Pass proxy_url

* Rename hard_limit/soft_limit

* Use 'warn_deprecated' function

* Update PoolLimits docs

* Linting

* Update httpcore dependancy

* Update port in Transport API to be 'Optional[int]'
2020-05-21 13:26:20 +01:00
Florimond Manca
82dc6f32f8 Switch to private module names (#785)
* Rename modules

* Update names in package

* Fix tests

* Review docs
2020-01-28 14:34:43 +00:00
Yeray Diaz Diaz
b23420392e
Detect credentials in proxy URLs and create Proxy-authorization header (#780)
* Detect auth in proxy URLs and create Proxy-authorization header

* Add credentials and SOCKS details to proxy documentation

* Use URL.copy_with to remove credentials from URL
2020-01-20 13:50:50 +00:00
Tom Christie
f17ab37b2f
Prep for introducing SyncClient (#713)
* Reorganize method ordering in client

* Move 'request'

* Use 'httpx.Proxy' for proxy configuration
2020-01-07 10:27:01 +00:00
Tom Christie
79a9748ae6
Load SSL Context on init (#709) 2020-01-02 16:52:23 +00:00
Tom Christie
3124a38123
Minor config cleanup (#621) 2019-12-09 10:59:55 +00:00
Tom Christie
d15dc0b1f8
Tighten up top-level API to only expose public API (#608)
* Tighten up top-level API to only expose public API

* Leave HTTPProxyMode for backwards compat, raising warnings.

* Add missing import
2019-12-06 15:20:01 +00:00
Tom Christie
2f54b200de
Allow default+override timeout style (#593)
* Allow styles like: httpx.Timeout(5.0, pool_timeout=None)

* Update timeout docs

* Minor tweaks to sub headings in timeout docs

* Fixing up Timeout docs

* RequestTimeout -> TimeoutException

* Tweak timeout docs
2019-12-05 09:38:48 +00:00
Tom Christie
c033ed1b65
TimeoutConfig -> Timeout (#591) 2019-12-04 11:39:45 +00:00
Tom Christie
30229f1652
Better HTTP/2 defaults. (#584)
* Simplify HTTP version config, and switch HTTP/2 off by default

* HTTP/2 docs

* HTTP/2 interlinking in docs
2019-12-02 17:07:04 +00:00
Tom Christie
12d00b238e
Minor test fixes (#583)
* Minor test fixes

* Fix multipart test to less ambiguous file extension -> mime type check

* Include a no-file-extension case in multipart tests
2019-12-02 12:11:15 +00:00
Tom Christie
364378a814
Pool timeouts should be on the TimeoutConfig, not PoolLimits (#563)
* Pool timeouts should be on the TimeoutConfig, not PoolLimits

* Linting

* Fix type annotation

* Linting
2019-11-29 12:01:51 +00:00
Florimond Manca
e3140a0803
Reorganize timeout config tests (#491) 2019-10-22 22:04:42 +02:00
Can Sarıgöl
c9810a79d9 Add support for SSL_CERT_FILE and SSL_CERT_DIR (#307) 2019-09-23 10:24:53 -05:00
Tomás Farías
db7f2d0df3 Add support for SSLKEYLOGFILE (#301)
* Skip test if OpenSSL version is lower than 1.1.1

* Use bionic dist for Python 3.8 job

* Pass trust_env to SSLConfig use monkeypatch in testing

* Don't raise KeyError if SSLKEYLOGFILE is not set

* Move trust_env after verify and cert
2019-09-01 08:01:11 -05:00
Can Sarıgöl
4ea4af661d Raise TypeError if invalid parameter for HTTPVersionConfig (#253) 2019-08-20 17:39:05 -05:00
Tom Christie
fc27fd2530 Test coverage for HTTPVersionConfig 2019-08-20 12:33:28 +01:00
Seth Michael Larson
df8874b733
Accept SSLContext into SSLConfig(verify=...) (#215) 2019-08-14 22:30:02 -05:00
Can Sarıgöl
c5248e6c20 Run SSLConfig cert loading in threadpool (#209) 2019-08-14 21:30:01 -05:00
Stephen Brown II
fde30b8d14 Use pathlib.Path instead of os.path functions (#188) 2019-08-08 21:42:25 -05:00
Tom Christie
2d09d5b36c
Renaming -> httpx (#129)
* Renaming -> httpx

* Renaming to httpx
2019-07-19 15:15:16 +01:00
Seth Michael Larson
ba83e29aee Support client cert passwords, new TLS options (#118)
* Support client cert passwords, new TLS options

* Update test_config.py

* Switch to try-except for post_handshake_auth=True

SSLContext.post_handshake_auth raises AttributeError if the property is available but cannot be written to (needs OpenSSL 1.1.1+)

* Also try-except for hostname_checks_common_name=False

* Custom implementation of trustme.CA() that emits encrypted PKs

* lint

* Split name of test

* Updates from review comments

* Don't load default CAs yet
2019-07-16 10:08:57 +01:00
Tom Christie
c9747aa357
http3 (#86)
* Start fleshing out documentation

* Docs work

* http3

* Update docs

* Include lowercase status codes, for requests compat

* Updating docs

* Docs tweaks
2019-06-12 15:02:16 +01:00
Tom Christie
95740415db
Work on bringing API into parity with requests. (#76)
* Finesse timeout argument.

* Drop unused imports

* Add 'cert' and 'verify' arguments
2019-05-23 16:21:00 +01:00
Yeray Diaz Diaz
8d53257915 Add tests for config
Separate cert and key paths into its own fixture
2019-05-14 13:37:10 +01:00
Tom Christie
d7619a92a8 Finessing interface 2019-04-30 11:26:11 +01:00
Tom Christie
fab6fcd397 Adapters 2019-04-26 15:34:04 +01:00
Tom Christie
6d35506277 Drop unneccessary __hash__ methods 2019-04-25 17:05:40 +01:00
Tom Christie
a44190ff24 Stream refactoring and HTTP/2 test case 2019-04-25 12:05:23 +01:00
Tom Christie
42c0e06c8c Allow per-request timeout/ssl config 2019-04-18 10:36:30 +01:00