python/cpython: NEWS entry names, before a pull request
CPython's release notes go in Misc/, named like 2026-05-07-12-00-00. The blurb tool writes that name, and the bedevere bot checks it on each pull request. One filename_ rule checks it before there is one. This config was written to test alint; CPython doesn't use alint.
What alint found
- id: cpython-gitattributes-generated-resolve
# fixed here: (?m), so ^ starts every line; and only entries with a
# slash, since .gitattributes matches a bare name at any depth
kind: registry_paths_resolve
source: ".gitattributes"
extract:
regex: '(?m)^([^#\s\[]\S*/\S*)\s+.*\bgenerated\b'
base: "."
entries_are_globs: true
expect: file
level: error✗ error cpython-gitattributes-generated-resolve
.gitattributes still marks Include/ and Include/ as generated, and neither file exists: token became Include/. Lib/ matches nothing either, because the .0 files are in certdata/.
The config
The config extends oss-baseline, python, ci/, hygiene/ and tooling/. Its own rules check the NEWS entries, the line endings .gitattributes sets, the generated files and SBOMs, and the version numbers in configure and Include/. make regen-all, Ruff, Black, sphinx-lint, actionlint and zizmor run from command rules.
- id: cpython-news-entry-filename
# fixed here: bedevere's pattern, which also takes bpo- numbers
kind: filename_regex
paths:
include: ["Misc/NEWS.d/next/*/*.rst" ]
exclude: ["Misc/NEWS.d/next/*/README.rst" ]
pattern: '^\d{4}-\d{2}-\d{2}(-\d{2}-\d{2}-\d{2})?\.(bpo|gh-issue)-\d+(,\d+)*\.[A-Za-z0-9_=-]+\.rst$'
level: errorblurb's format, date to nonce, as bedevere checks it, in all 11 sections. Two more rules check each section's README and reject section names with spaces, as a pre-commit hook does.
- id: cpython-version-minor-coherent
kind: cross_file_value_equals
source:
file: "Include/patchlevel.h"
extract: { regex: '#define PY_MINOR_VERSION\s+(\d+)' }
targets:
- file: "configure.ac"
extract: { regex: 'm4_define\(\[PYTHON_VERSION\],\s*\[\d+\.(\d+)\]\)' }
level: errorThe minor version is written in both Include/ and configure; this rule keeps them equal. A second rule does the same for the major version.
- id: cpython-regen-all-fresh
kind: command_idempotent
command: ["make", "-j4", "regen-all"]
timeout: 900
level: errorRegenerating needs CPython's own build, so this rule runs make regen-all and fails when the tree would change.
What stays outside alint
The C API checks and anything that compares a change with its base stay with CPython's tools:
- smelly, stable_abi and check-c-globals, which read the symbols libpython exports or parse C;
- Argument Clinic's checksums, which need Clinic's own algorithm;
- patchcheck, which compares a change with its base branch, and the ensurepip check, which downloads wheels.