Skip to content

v1.1.0: DB path fix, API hardening, tests, CI, changelog, README repair - #3

Merged
3D3Q3 merged 2 commits into
mainfrom
claude/migrate-external-code-28btgm
Jul 4, 2026
Merged

v1.1.0: DB path fix, API hardening, tests, CI, changelog, README repair#3
3D3Q3 merged 2 commits into
mainfrom
claude/migrate-external-code-28btgm

Conversation

@3D3Q3

@3D3Q3 3D3Q3 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Applies the reviewed v1.1.0 changes from the external review session.

Fixed

  • Dedupe DB path (critical): seen_ids.sqlite was created in whatever directory the user ran from, breaking duplicate detection across directories. It now lives at ~/.chtext/seen_ids.sqlite, with automatic one-time migration of a legacy CWD database.
  • API _call hardening: network errors (requests.RequestException), non-2xx responses (raise_for_status), and non-JSON responses (rate limit/outage) are now wrapped in CtextAPIError instead of raising raw tracebacks.
  • Bare except: in the cmd_browse chapter-title loop → except Exception: so KeyboardInterrupt isn't swallowed.
  • Windows encoding: replaced the import-time sys.stdout/sys.stderr swap (which mutated global state for library importers) with a _configure_console_encoding() call at the start of main() using stream.reconfigure().
  • README: repaired broken markdown-links-in-code-blocks in install commands, fixed LICENSE links, removed a stray 4-backtick fence.

Added

  • tests/test_chtext.py — 21 offline tests covering CTextAPI, StateTracker (including a regression test that the default DB path is not the CWD), _extract_short_segments, and Config.
  • .github/workflows/ci.yml — lint (ruff) + test matrix on Python 3.9–3.13.
  • CHANGELOG.md (Keep a Changelog format).
  • README badges and a Known Limitations section.

Changed

  • Version is now dynamic ([tool.setuptools.dynamic] reading chtext.cli.__version__ = 1.1.0); build requires setuptools>=77 for the PEP 639 SPDX license string.
  • Minimum Python raised from 3.8 to 3.9. The first CI run showed setuptools>=77 cannot install on Python 3.8 (its floor is 3.9), so the 3.8 job failed at build-dependency resolution. Python 3.8 has been EOL since October 2024, so 3.8 was dropped rather than reverting to legacy license metadata.
  • Lint cleanup (unused imports, placeholder-less f-strings) and ruff config in pyproject.toml.

Verification (all run on this branch)

  • ruff check src/ tests/ — clean
  • python -m pytest tests/ -q — 21 passed
  • python -m build — produces chtext-1.1.0 sdist + wheel
  • Runtime smoke test: chtext generate from /tmp works, no seen_ids.sqlite created in /tmp, DB present at ~/.chtext/seen_ids.sqlite

Release notes

After merge: confirm CI is green, then create a GitHub release tagged v1.1.0 to trigger the publish workflow. Note that PyPI trusted publishing must be registered for 3D3Q3/chtext and a pypi environment must exist in repo settings, or the publish job will fail on OIDC.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CzedGhnBhFq1SzH8WQSVVg

xxxxxxxxxxxxx and others added 2 commits July 4, 2026 09:08
The PEP 639 SPDX license string requires setuptools>=77, whose own floor
is Python 3.9, so the 3.8 CI job could not even resolve build
dependencies. Python 3.8 reached end of life in October 2024.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CzedGhnBhFq1SzH8WQSVVg
@3D3Q3
3D3Q3 marked this pull request as ready for review July 4, 2026 09:18
@3D3Q3
3D3Q3 merged commit fa116b0 into main Jul 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants