This aligns with the definition in requests, but means that user code might
need additional assertions to ensure that `HTTPError.response` is not `None`.
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.
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.
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.
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.
- Move the logic for running mypy on the test cases from `tests/mypy_test.py` to a separate script, `tests/regr_test.py`.
- Add the necessary logic in order to be able to have test cases for third-party stubs.
- Move logic common to `tests/mypy_test.py` and `tests/regr_test.py` into `tests/colors.py`, and rename `tests/colors.py` to `tests/utils.py`.
- Add a new check to `tests/check_consistent.py`, to enforce the use of `# pyright: reportUnnecessaryTypeIgnoreComment=true` comments in third-party test cases. These are essential if we want to have our tests against false-negatives work with pyright.
- Update the relevant documentation to account for the new test file.
- Add a new job to the `tests.yml` GitHub workflow, to run the new test in CI.
- Add a simple proof-of-concept test case for `requests`, as a regression test for #7998.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
In the requests package the function `utils.parse_header_links()`
takes a str as input and returns a list of dictionaries.
This can be seen in the unit tests that are used:
786255613b/tests/test_utils.py (L644-L664)
Fixes#7776
Mutating hooks, as in `session.hooks['response'] = ...`, should work. Reassigning it like `session.hooks = ...` is probably a bad idea, so it will always be a `dict`.