Skip to content

Document the existing local newsfragment check - #3530

Closed
anshurajbisoyi98-ctrl wants to merge 4 commits into
python-trio:mainfrom
anshurajbisoyi98-ctrl:codex/check-newsfragments
Closed

anshurajbisoyi98-ctrl wants to merge 4 commits into
python-trio:mainfrom
anshurajbisoyi98-ctrl:codex/check-newsfragments

Conversation

@anshurajbisoyi98-ctrl

@anshurajbisoyi98-ctrl anshurajbisoyi98-ctrl commented Oct 2, 2026 •

Copy link
Copy Markdown

Fixes #3084.

Document the existing command for checking newsfragment syntax and references locally:

make -C docs dummy SPHINXOPTS="-E -W --keep-going"

The final diff is 11 added lines in newsfragments/README.rst. It reuses the existing Makefile and Sphinx configuration, with no custom builder mode, Python changes, or new test infrastructure. The dummy builder checks the assembled changelog and documentation without generating HTML; -E rereads edited fragments and -W makes warnings fail the build.

Validation by Codex on macOS / Python 3.13.12:

  • The documented command passes with valid fragments.
  • An intentionally undefined reference makes it fail.
  • Hash comparisons confirm existing fragments and release history remain unchanged; the Git index tree is preserved.
  • Applicable pre-commit hooks and git diff --check pass.

This replaces the earlier implementation in response to the concern about maintenance cost. Fresh CI on a2b00b7 is pending.

AI assistance: I used Codex to simplify the change, verify the commands, and update this description.

Signed-off-by: Anshu Raj Bisoyi <230949664+anshurajbisoyi98-ctrl@users.noreply.github.com>
Signed-off-by: Anshu Raj Bisoyi <230949664+anshurajbisoyi98-ctrl@users.noreply.github.com>
@codecov

codecov Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00000%. Comparing base (582223a) to head (a2b00b7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@               Coverage Diff               @@
##                 main        #3530   +/-   ##
===============================================
  Coverage   100.00000%   100.00000%           
===============================================
  Files             128          128           
  Lines           19474        19474           
  Branches         1323         1323           
===============================================
  Hits            19474        19474           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: ANSHU RAJ BISOYI <anshu@ANSHUs-MacBook-Air-2.local>
@anshurajbisoyi98-ctrl

Copy link
Copy Markdown
Author

Addressed the four uncovered lines reported by Codecov in a8400c3.

I extracted the documentation-config lookup and added cases for checkout tests, installed-package tests running from empty/, and missing documentation sources. I also exercised the subprocess guard to confirm it raises a failure if the check tries to run Towncrier or Git.

Local verification with Codex on Python 3.13.12:

  • Tool tests: 22 passed, 3 skipped.
  • Without optional Sphinx dependencies: the module correctly skips during collection.
  • Combined coverage for test_check_newsfragments.py: 100% lines and branches (70 statements, 12 branches; no missing lines or partial branches).
  • Applicable pre-commit hooks, Mypy, make -C docs check-newsfragments, and git diff --check passed.

The new commit is pushed; the refreshed Codecov report and CI results are pending.

@A5rocks

A5rocks commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Sorry this seems significantly too much code for very marginal value, to me.

Signed-off-by: ANSHU RAJ BISOYI <anshu@ANSHUs-MacBook-Air-2.local>
@anshurajbisoyi98-ctrl anshurajbisoyi98-ctrl changed the title Codex/check newsfragments Document the existing local newsfragment check Oct 2, 2026
@anshurajbisoyi98-ctrl

Copy link
Copy Markdown
Author

Thanks, I agree the custom mode and test infrastructure were too much for this convenience. I simplified the PR in a2b00b7 to an 11-line README addition documenting the existing Sphinx dummy-builder command. There are now no Python or Makefile changes in the final diff.

I verified that the command succeeds on valid fragments, rejects an undefined reference, and preserves existing fragments, release history and the Git index. Applicable lint checks pass. I also updated the title and description to match this smaller scope.

Simplification and verification performed with Codex.

@A5rocks A5rocks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR! I think it's true that we need to improve this section of the contributor docs, but I think it would be rude to new contributors to give them LLM output as contribution docs.

Comment thread newsfragments/README.rst
make -C docs dummy SPHINXOPTS="-E -W --keep-going"

This checks the assembled changelog and documentation without generating HTML.
Warnings cause the command to fail; ``-E`` ensures edited fragments are reread.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to provide -W for this? And the description for -E doesn't help me understand why that's there.

@A5rocks A5rocks closed this Oct 5, 2026
@anshurajbisoyi98-ctrl
anshurajbisoyi98-ctrl deleted the codex/check-newsfragments branch October 5, 2026 05:30
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.

Make it easier to check the formatting of a newsfragment locally

2 participants