Commit Graph

127 Commits

Author SHA1 Message Date
Stephen Morton
f08d769f7c remove unneeded Iterable base class from CookieJar (#12812) 2024-10-15 19:47:56 +02:00
Max Muoto
df30049ac7 Correct requests cookies argument (#12654) 2024-09-13 18:09:05 +02:00
Stephen Finucane
b3774bc22b requests: Session.adapters is a mapping of Adapters (#12473)
Signed-off-by: Stephen Finucane <stephen@that.guru>
2024-09-06 15:05:55 -07:00
Adam Dangoor
59f612f514 Add hint for requests.models.Response.raw (#12616) 2024-09-04 12:15:53 +02:00
Andria Brown
ee24958e1e requests: Add connection property (type HTTPAdapter) to the Response class (#12279)
The `Response` instance is built by `HTTPAdapter`. When built, a property called `connection` is added to the `Response` that points back to the `HTTPAdapter` that created it. For example, this is used in the `requests` library's `HTTPDigestAuth` class to remake requests with credentials after authorization is requested by a server.
2024-07-11 17:09:07 -07:00
Brett Holman
434f6528b7 requests: Fix Response.content return type to include None (#12180) 2024-06-21 21:38:00 +02:00
Sebastian Rittau
fcbb142dd6 [requests] Update to 2.32.3 (#12060) 2024-05-31 21:00:43 -07:00
Sebastian Rittau
f9664a4325 [requests] Update to 2.32.2 (#12000)
Also replace some `Any` annotations with `Incomplete` and use `Final` in `requests.__version__`.
2024-05-22 06:16:42 -07:00
github-actions[bot]
6816cf47f7 [stubsabot] Bump requests to 2.32.* (#11991)
Release: https://pypi.org/pypi/requests/2.32.1
Homepage: https://requests.readthedocs.io
Repository: https://github.com/psf/requests
Typeshed stubs: https://github.com/python/typeshed/tree/main/stubs/requests
Diff: https://github.com/psf/requests/compare/v2.31.0...v2.32.1

Stubsabot analysis of the diff between the two releases:
 - Total lines of Python code added: 486.
 - Total lines of Python code deleted: 131.
2024-05-20 22:13:42 -04:00
LY(退网/offline)
bb1f813b1a requests: export packages and utils (#11723) 2024-04-05 16:17:41 +02:00
Alex Waygood
d698cb70eb requests: remove a type: ignore (#11704) 2024-04-02 14:30:35 +01:00
Arthur Bols
2eb447154c requests: annotate RequestsCookieJar (#11656) 2024-04-01 14:43:33 +02:00
Shantanu
88fa182253 Use PEP 570 syntax in third party stubs (#11554) 2024-03-10 14:11:43 +01:00
Shantanu
4d8ae17776 Bump mypy to 1.9, add to json.encoder, small fixups (#11549)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-03-09 14:25:00 -08:00
Colin Watson
c9f74e646a requests: Allow passing None header values (#11370)
https://github.com/python/typeshed/pull/7773 changed
`requests.session.Session` methods to accept None for header values, but
didn't do quite the same for the functions in `requests.api`.  I think
this was a mistake.  The functions in `requests.api` just pass through
the `headers` argument without doing anything in particular to it.

Furthermore, it's useful to be able to pass None as a header value:
because `requests.utils.default_headers` sets an `Accept-Encoding`
header by default, the easiest way to send a request with no
`Accept-Encoding` header is something like `requests.get(url,
headers={"Accept-Encoding": None})`.  It's annoying to have to construct
a `Session` just to pass type-checking.

It's a little confusing for the type alias to be called
`_HeadersUpdateMapping` in `requests.sessions` but `_HeadersMapping` in
`requests.api`; this is because the latter name was already used in
other type stubs (`tensorflow.keras.callbacks`), so it seemed best to
avoid breaking API.
2024-02-16 21:16:15 -08:00
Adam Dangoor
d689b486c0 Add parameter type to PreparedRequest.prepare_content_length (#11304) 2024-01-24 13:41:27 +01:00
Sebastian Rittau
b6eaadcfe5 Update typing_extensions imports in third-party stubs (#11245) 2024-01-05 15:40:13 +01:00
Akuli
3ede0565d1 requests: Use the Any trick in HTTPError (#11207) 2023-12-30 01:28:10 -08:00
Abderrahim HADDADI
dc3cc9578b requests: annotate utils.get_encoding_from_headers() (#10901) 2023-10-18 00:31:16 +02:00
Sandro Huber
e92bfcbab2 [requests] Allow HTTPError.response to be None (#10875)
This aligns with the definition in requests, but means that user code might
need additional assertions to ensure that `HTTPError.response` is not `None`.
2023-10-13 18:10:56 +02:00
Alex Waygood
011f24794d types-requests, types-influxdb-client: add note to the PyPI readme about the urllib3 pin (#10839) 2023-10-05 12:12:47 +01:00
Alex Waygood
559d31c4a3 Remove stubs for urllib3 (#10812)
Both types-requests and types-influxdb-client now depend on urllib3>=2 instead of types-urllib3. That in turn means that types-caldav, types-slumber and types-requests-oauthlib all depend indirectly on urllib3>=2, since all three stubs packages depend on types-requests.
2023-10-01 00:01:12 +01:00
Harshal Sheth
ec52bf1add [requests] loosen HTTPError constructor (#10776) 2023-09-27 08:02:46 +02:00
Aarni Koskela
3446594f0e [requests] Allow PreparedRequest for RequestException(request=...) (#10767) 2023-09-25 12:46:14 +02:00
Marti Raudsepp
71d81f886d [requests] Improve exception class constructors (#10740) 2023-09-22 19:42:58 -07:00
Erik Bjäreholt
ddebb83ea7 requests: type RequestException members (not Any) (#8989)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-09-20 05:20:33 -07:00
Sebastian Rittau
afe18e95a9 Add an upstream_repository field to METADATA.toml (#10487)
Closes: #10478
2023-07-20 16:45:41 +02:00
Jelle Zijlstra
0d0cbb6b97 Allowlist requests.compat.bytes.__buffer__ (#10231) 2023-05-28 21:23:00 -07:00
github-actions[bot]
e821090926 [stubsabot] Bump requests to 2.31.* (#10199)
Release: https://pypi.org/pypi/requests/2.31.0
Homepage: https://requests.readthedocs.io
Diff: https://github.com/psf/requests/compare/v2.30.0...v2.31.0

Stubsabot analysis of the diff between the two releases:
 - 0 public Python files have been added.
 - 0 files included in typeshed's stubs have been deleted.
 - 2 files included in typeshed's stubs have been modified or renamed: `requests/__version__.py`, `requests/sessions.py`.
 - Total lines of Python code added: 26.
 - Total lines of Python code deleted: 4.
2023-05-23 07:21:52 +01:00
Sebastian Rittau
5fdbf37c1f [requests] Update stubs to 2.30 (#10141) 2023-05-05 11:01:21 +01:00
Alex Waygood
2d84e56d6f Update requests for v2.29 (#10097) 2023-04-29 00:44:51 +01:00
Alex Waygood
b69b17c3d8 Add defaults for third-party stubs Q-T (#9959) 2023-03-28 13:16:31 +02:00
Adam Dangoor
19368ab964 Add type to requests.models.RequestEncodingMixin.path_url (#9923)
We can see at 7f694b79e1/requests/models.py (L104) that this always returns a string.
2023-03-22 19:20:40 +00:00
Avasam
52ec44fa58 Improve many __(a)exit__ annotations (#9696) 2023-02-25 21:50:30 +00:00
Avasam
ed6748fb32 Stubtest settings: change ignore_missing_stub default to false (#9779)
If you're reading about this commit from an autogenerated changelog entry, this should have no user-visible impact on how the stubs are interpreted by a type checker; it's just an internal change to how typeshed's tests work.
2023-02-20 22:37:45 +00:00
Alex Waygood
7180d0223b Use typing_extensions.Self instead of _typeshed.Self (#9702) 2023-02-15 11:32:43 +01:00
Alex Waygood
60789273a2 Improve pyright verification of third-party test cases in CI (#9650)
Co-authored-by: Avasam <samuel.06@hotmail.com>
2023-02-07 11:53:54 +00:00
Alex Waygood
0ef9c3f8e8 Enable flake8-pyi's Y037 (#9686) 2023-02-06 19:01:02 -08:00
Alex Waygood
efee70abfa Bump mypy to 1.0 (#9684) 2023-02-06 15:57:17 -08:00
Nikita Sobolev
f7cb7f33b2 Use OSError instead of IOError (#9683) 2023-02-06 18:56:32 +00:00
Alex Waygood
4fea314594 Replace Any with Incomplete in many places (#9558) 2023-01-18 08:48:16 +00:00
Eugene Vilensky
6a7839f2c5 requests: set session.headers to MutableMapping (#9395) 2022-12-22 15:02:58 +00:00
Mauricio Villegas
1b50eb09df requests: types for auth username and password (#9389) 2022-12-20 16:34:40 -06:00
Nikita Sobolev
c6261372d7 Always use bool and Literal for Python compat code (#9213) 2022-11-16 18:00:59 +00:00
Nikita Sobolev
62a6c3d616 Annotate known magic-method return types (#9131) 2022-11-08 18:28:42 +00:00
Nikita Sobolev
c0e9038f0d Fix and allow classes with missing metaclasses (#9136) 2022-11-08 18:13:59 +00:00
Samuel T
573ee94f35 All scripts/tests: always specify file encoding in calls to open() (#8882) 2022-10-11 22:29:36 +01:00
Alex Waygood
e173cbe7b6 Mark requests stubs as complete (#8858)
Co-authored-by: Kevin Kirsche <kevin.kirsche@one.verizon.com>
2022-10-06 15:31:02 -07:00
Alex Waygood
f9b1289226 requests: Add regression test for #8762 (#8835)
The final mypy_primer report for #8762 was an empty diff. Considering the number of issues we've had with our requests stubs over the last year, it feels like it makes sense to add a test case to make sure that it doesn't regress.
2022-10-03 16:11:44 -07:00
Rogdham
b3db49abbd requests: improve _Data type (#8762)
requests: improve _Data type

This allows to pass an Iterable[bytes] for streaming request data.
2022-09-21 16:35:09 -07:00