fix: pin chardet<6 to suppress RequestsDependencyWarning#405
Merged
andreatgretel merged 2 commits intomainfrom Mar 12, 2026
Merged
fix: pin chardet<6 to suppress RequestsDependencyWarning#405andreatgretel merged 2 commits intomainfrom
andreatgretel merged 2 commits intomainfrom
Conversation
requests 2.32.5 asserts chardet<6 at import time, but sqlfluff and diff_cover pull in chardet without an upper bound, resolving to 7.1.0 on fresh installs. Add a workspace constraint to cap chardet until a new requests release ships the fix from psf/requests#7220. Closes #404
nabinchha
approved these changes
Mar 12, 2026
Contributor
Greptile SummaryThis PR pins Key changes:
The fix correctly uses
|
| Filename | Overview |
|---|---|
| pyproject.toml | Adds constraint-dependencies = ["chardet>=3.0.2,<6"] to [tool.uv] — a minimal, targeted workspace-level constraint that prevents chardet 7.x from being resolved and triggering RequestsDependencyWarning from requests 2.32.5. |
| uv.lock | Lock file regenerated to reflect the new chardet constraint; chardet is now pinned at 5.2.0 (down from 7.1.0). Also introduces annotated-doc==0.0.4 as a new transitive dependency pulled in during lock regeneration. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["data-designer-engine\n(sqlfluff>=3.2.0,<4)"] --> B["sqlfluff 3.5.0"]
B --> C["chardet (no upper bound)"]
B --> D["diff-cover 10.2.0"]
D --> C
E["data-designer-config\n(requests>=2.32,<3)"] --> F["requests 2.32.5"]
F -->|"import-time check:\nchardet < 6 required"| G{{"chardet version?"}}
C -->|"Before fix:\nresolves to 7.1.0"| G
G -->|">= 6"| H["⚠️ RequestsDependencyWarning"]
G -->|"< 6"| I["✅ No warning"]
J["[tool.uv]\nconstraint-dependencies\nchardet>=3.0.2,<6"] -->|"constrains resolution"| C
C -->|"After fix:\nresolves to 5.2.0"| G
Last reviewed commit: bd5383e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
chardet>=3.0.2,<6as a workspace constraint in[tool.uv]to preventRequestsDependencyWarningon fresh installsrequests 2.32.5assertschardet<6at import time, butsqlfluffanddiff_coverpull inchardetwithout an upper bound, resolving to 7.1.0requestsrelease ships the fix from psf/requests#7220Closes #404
Test plan
uv.lockresolveschardet==5.2.0(was 7.1.0)python -W all -c "import requests"produces no warnings