cleanup: dead code, F401/F841 enforcement, Z-timestamp bug fix#151
Merged
Conversation
First cut of the post-1.0 cleanup backlog. All internal/private; no public symbol affected, API stays frozen. Fixes: - Knowledge/checkpoint loaders crashed on Z-suffixed timestamps on Python 3.10 (fromisoformat rejected the trailing Z until 3.11). All 17 ISO-parse sites now route through a single selectools._time.parse_iso helper. (#136) - selectools doctor printed the OK/MISSING icon but dropped the set/not-set status text it computed; now shows both. (#135) Internal: - Removed dead code: 3 unused serve dataclasses, 2 unreachable private helpers, 4 dead locals, 104 unused imports. (#137) - Enforced ruff F401 + F841 everywhere; scoped the F401 ignore to **/__init__.py re-export hubs so dead imports/locals can't accumulate silently. (#138) - Documented PineconeVectorStore(environment=...) as deprecated/ignored. (#149) Full suite: 7650 passed, 159 skipped, 0 failed. mypy clean, ruff + format clean.
This was referenced Jun 15, 2026
johnnichev
added a commit
that referenced
this pull request
Jun 15, 2026
Cleanup & Z-timestamp patch. Bumps version 1.0.0 -> 1.0.1 and rolls the [Unreleased] changelog into a dated [1.0.1] section. Contents already merged via #151: Z-suffix timestamp crash fix on Python 3.10 (#136), doctor status text (#135), dead-code removal (#137), ruff F401/F841 enforcement (#138). All internal; frozen 1.0 API unchanged.
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.
First cut of the post-1.0 code-cleanup backlog (#150). Everything here is internal/private — no public symbol is touched, the 1.0 frozen API is unchanged. Net -32 lines across 61 files.
Closes #135, #136, #137, #138. Advances #149.
Bugs fixed
Z-suffixed timestamps on Python 3.10.datetime.fromisoformatdid not accept a trailingZ(UTC designator) until Python 3.11, so a value like"2026-06-15T12:00:00Z"— exactly what Postgres/Supabase/Redis return — raisedValueErroron the project's minimum interpreter. All 17 ISO-parse sites now route through oneselectools._time.parse_isohelper that normalizes the suffix first. Newtests/test_time.pylocks in the regression (Z suffix, fractional seconds, offsets, naive, datetime passthrough).selectools doctordropped the status text it computed. The per-key line built aset/not setstring and then printed only theOK/MISSINGicon. Now shows both (OPENAI_API_KEY: OK (set)), matching the deps-section style.Hygiene
servedataclasses (InvokeRequest,BatchRequest,BatchResponse), 2 unreachable private helpers (bm25._score_document,hybrid._find_matching_key), 4 dead locals, and 104 unused imports acrosssrc/. Each verified to have zero call sites before removal.F401(unused imports) andF841(unused locals) are now enforced everywhere; theF401ignore is scoped to**/__init__.pyre-export hubs. Dead imports/locals can no longer accumulate silently — this is what surfaced the 104 + 4 above.PineconeVectorStore(environment=...)as deprecated/ignored (Pinecone v3+ infers the host). The parameter removal stays a breaking change scheduled for a later minor.Verification
mypy src/selectoolsclean (182 files including the new_time.py).ruff check+ruff format --checkclean; stability audit map unchanged.Notes
The DRY consolidation is deliberately scoped to the one item that also closed a bug (the timestamp helper). The larger DRY items in the backlog (#139 LLM-judge scaffold, #140 session validators, #141 import guards, etc.) are left as separate follow-ups.
Changelog entry is under
[Unreleased]; this is release-ready as a 1.0.1 patch whenever you want to tag it.