Skip to content

Remove types-requests dependency#373

Merged
oschwald merged 1 commit into
mainfrom
wstorey/typeshed
May 19, 2026
Merged

Remove types-requests dependency#373
oschwald merged 1 commit into
mainfrom
wstorey/typeshed

Conversation

@horgh
Copy link
Copy Markdown
Contributor

@horgh horgh commented May 19, 2026

requests 2.34.0 ships inline type annotations, replacing the typeshed stubs. The types-requests PyPI page recommends uninstalling when on requests 2.34.0 or newer.

requests 2.34.0 ships inline type annotations, replacing the typeshed
stubs. The types-requests PyPI page recommends uninstalling when on
requests 2.34.0 or newer.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the types-requests dependency from the linting group in pyproject.toml and updates the uv.lock file. A review comment identifies a potential issue where removing these type stubs without bumping the minimum requests version to 2.34.0 (the version where inline types were introduced) could lead to static analysis failures in environments using older versions of the library.

Comment thread pyproject.toml
Comment on lines 42 to 45
lint = [
"mypy>=1.15.0",
"ruff>=0.11.6",
"types-requests>=2.32.0.20250328",
]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Removing types-requests from the lint group relies on requests providing its own type annotations, which started in version 2.34.0. However, the project.dependencies section (line 12) still specifies requests>=2.24.0. This discrepancy can lead to static analysis failures in environments where an older version of requests is installed, as no type information will be available. The minimum version of requests should be bumped to 2.34.0 to maintain type safety.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From Claude:

  My read: Gemini has a point, but it's narrower than it sounds.

  - For this project's own mypy run: uv.lock pins requests==2.34.0, so CI and uv run mypy will always see the inline types. No risk here.
  - For downstream consumers importing minfraud: types-requests was in the lint dependency-group, which is dev-only. Downstream users never got those stubs via minfraud — they
  had to install types-requests themselves if they wanted typed requests. So removing the dev-only stub doesn't change anything about what downstream users see; their mypy
  behavior over import requests was already governed by whatever requests version they have. Gemini's framing implies downstream regression but there isn't one.
  - The only real-world scenario where this bites is: someone editing this repo who bypasses uv.lock and ends up with requests<2.34.0. Unlikely, and easily fixed by re-locking.

@oschwald oschwald merged commit f8b8a43 into main May 19, 2026
47 checks passed
@oschwald oschwald deleted the wstorey/typeshed branch May 19, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants