chore: remove duplicate imports, dead code, and pointless copies#313
Open
henryiii wants to merge 1 commit into
Open
chore: remove duplicate imports, dead code, and pointless copies#313henryiii wants to merge 1 commit into
henryiii wants to merge 1 commit into
Conversation
de1eb4c to
10e367c
Compare
- Move `import contextlib` into the stdlib import block - Remove duplicate `import re` inside the `sys.version_info` guard - Remove duplicate `"KNOWN_METADATA_VERSIONS"` entry in `constants.__all__` - Drop no-op `os.fspath()` around `Path.as_posix()` (already returns str) - Remove trailing `continue` at end of loop body in `_validate_dotted_names` - Iterate `val.items()` directly instead of `val.copy().items()` in `get_optional_dependencies`; return `requirements_dict` directly - Remove redundant `assert "project" in data` (block above already raised) - Simplify `KeyDispatcher.dispatch` to a single `next()` expression Assisted-by: ClaudeCode:claude-sonnet-4-6
10e367c to
a62e211
Compare
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.
🤖 AI text below 🤖
Summary
No-behavior-change cleanups identified in review:
import contextlibinto the stdlib import block (was stranded after theTYPE_CHECKINGblock)import reinside thesys.version_info < (3, 12, 4)guard (reis already imported at module top)"KNOWN_METADATA_VERSIONS"entry inconstants.__all__os.fspath()wrappingPath.as_posix()calls —as_posix()already returnsstrcontinueat end of loop body in_validate_dotted_names(last statement, no effect)val.items()directly instead ofval.copy().items()inget_optional_dependencies; returnrequirements_dictdirectly instead ofdict(requirements_dict)assert "project" in data— the block above already raised if"project"was missing; mypy passes without itKeyDispatcher.dispatchfrom a list-build + index + dict-lookup to a singlenext()expressionTest plan
prek -a --quiet— lint passesuv run noxfile.py -s mypy— mypy strict passes (252 sources, no issues)uv run pytest— 252 passed, 83 skipped (exceptiongroup not installed)🤖 Generated with Claude Code
Part of #307.