feat!: ship a reader console script and target Python 3.14 - #17
Merged
Merged
Conversation
Add a [project.scripts] entry point so the extractor can be installed with `uv tool install` and reused by other CLI/TUI tools, instead of only being runnable as a script from a clone. - extract the argparse block into cli(), the console-script entry point; main() stays the library API returning a ParseResult, so importing reader no longer risks parsing sys.argv - add a hatchling [build-system] and name reader.py explicitly in the wheel/sdist targets, since it is a single top-level module rather than a package directory - drop the shebang and executable bit: the interpreter is now resolved by the console script's absolute shebang, not by a PATH lookup that silently required an activated venv - raise requires-python to >=3.14 and track .python-version so the interpreter pin travels with the repo - document the install, library, and development paths, and note that `uv tool install` ignores uv.lock unless given constraints BREAKING CHANGE: requires Python 3.14 or newer, and `./reader.py` is no longer executable. Use the installed `reader` command, `uv run reader`, or `python reader.py`. The CLI flags, the JSON output schema, and main()/ParseResult are unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Major bump: requires-python rose to >=3.14 and the ./reader.py script invocation was removed, both breaking for existing consumers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Why
readershipped no console script, so other CLI/TUI tools could not reuse the extractor withoutsys.pathsurgery (seesandbox/tui.py). This adds a[project.scripts]entry point so it can be installed withuv tool installand imported as a library.What changed
if __name__ == "__main__":intocli().main()remains the library API returning aParseResult, so importingreaderno longer risks parsingsys.argv.[build-system].reader.pyis a single top-level module rather than a package directory, so the wheel/sdist targets name it explicitly — a new file that must ship has to be added to thoseincludelists.#!/usr/bin/env python3resolved to whateverpython3came first onPATH, which silently required an activated venv; the console script carries an absolute shebang into its own environment instead.requires-python = ">=3.14",[tool.pyright] pythonVersionin step, and.python-versionis now tracked (un-ignored in.gitignore) so the interpreter pin travels with the repo. No dependency versions moved —requirements.txtregenerates identical.-hblock is regenerated from real output (it had drifted from argparse's 3.13 option formatting). AGENTS.md gains packaging and Python-version sections, including the fact thatuv tool installresolves fresh from[project.dependencies]and ignoresuv.lockunless given-c requirements.txt.Breaking
Requires Python 3.14 or newer, and
./reader.pyis no longer executable — usereader,uv run reader, orpython reader.py. The CLI flags, the JSON output schema, andmain()/ParseResultare unchanged, so downstream consumers of.title,.author, and.content.textare unaffected.Verification
Locally on CPython 3.14.7:
uv run ruff check .clean andbasedpyrightreports zero diagnostics forreader.py. All four formats (json,html,md,txt) plus-wwrapping and-ttable formats verified against a local fixture and both reference pages — https://www.paulgraham.com/greatwork.html (table/br-based layout) and https://www.gnu.org/philosophy/free-sw.en.html. The wheel was checked to contain onlyreader.pyplus metadata, and both install routes were exercised end to end in throwaway environments:🤖 Generated with Claude Code