Allow the GH issue + Section as --flags and take news via stdin by gpshead · Pull Request #45 · python/blurb
and others added 3 commits
June 29, 2025 00:39This commit adds three new options to 'blurb add' for automation: - --gh_issue: Specify GitHub issue number - --section: Specify NEWS section (must be from the sacred list) - --rst_on_stdin: Read the news entry from stdin (no editor needed) When using --rst_on_stdin, one must provide both --gh_issue and --section, lest they be turned into a newt (they'll get better). Added comprehensive test coverage including: - Unit tests for parameter validation - Integration tests with mock CPython repo (ruled by Brian of Nazareth) - CLI tests that actually run the blurb command Also fixed the command-line parser to handle non-boolean options specifically for the add command, and improved error handling for temporary file cleanup. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This holy grail of refactoring reduces the code by >150 lines! We've eliminated the bureaucracy of wrapper functions and now apply `@app.command` decorators directly to the original functions. Just like the Knights of Ni demanded a shrubbery, cyclopts demands clear, typed parameters - and we have delivered! The code is now cleaner than the Holy Grail's cup after being washed by the French Taunter. Key improvements: - Moved cyclopts imports to top of file (no more silly walks) - Applied `@app.command` directly to functions (no indirection!) - Removed 'help' parameter from add() - cyclopts handles it - Simplified main() from ~200 lines to ~40 lines - Updated tests for new option naming (--gh-issue not --gh_issue) - All 28 tests still pass - it's not dead yet! 'Tis but a scratch compared to the original implementation! 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> (with a few human touchups by Greg)
gpshead
changed the title
Allow the GH issue & Section on the command line & news entry via stdin
Allow the GH issue + Section as --flags and take news via stdin
Integrate the user-friendly features from PR python#16 by @picnixz into the automation support from PR python#45, making the CLI more intuitive: - Change --gh-issue to --issue, accepting multiple formats: * Plain numbers: --issue 12345 * With gh- prefix: --issue gh-12345 * GitHub URLs: --issue python/cpython#12345 - Add smart section matching with: * Case-insensitive matching: --section lib matches "Library" * Partial matching: --section doc matches "Documentation" * Common aliases: --section api matches "C API" * Separator normalization: --section core-and-builtins - Improve error messages for invalid sections This combines the automation features from PR python#45 with the interface improvements suggested by @picnixz in PR python#16, as reviewed by @hugovk and @larryhastings. Co-authored-by: picnixz <picnixz@users.noreply.github.com>
Integrate the user-friendly features from PR python#16 by @picnixz into the automation support from PR python#45, making the CLI more intuitive: - Change --gh-issue to --issue, accepting multiple formats: * Plain numbers: --issue 12345 * With gh- prefix: --issue gh-12345 * GitHub URLs: --issue python/cpython#12345 - Add smart section matching with: * Case-insensitive matching: --section lib matches "Library" * Partial matching: --section doc matches "Documentation" * Common aliases: --section api matches "C API" * Separator normalization: --section core-and-builtins - Improve error messages for invalid sections This combines the automation features from PR python#45 with the interface improvements suggested by @picnixz in PR python#16, as reviewed by @hugovk and @larryhastings.
Now 'blurb -i 123' works the same as 'blurb add -i 123', because nobody expects the Spanish Inquisition... or having to type 'add' every time. - Forward all add command parameters to the default command - Update help text to indicate 'add' is the default command - Parameters like --issue, --section, and --rst-on-stdin now work directly with 'blurb' without specifying 'add'
Eliminated 4 redundant test methods from TestAddCommandAutomation that duplicated validation logic already covered by existing parametrized tests. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <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