blurb 2.0.0
pip install blurb
Released:
Command-line tool to manage CPython Misc/NEWS.d entries.
Navigation
Verified details
These details have beenverified by PyPIProject links
Owner
GitHub Statistics
Maintainers
Unverified details
These details havenot been verified by PyPIMeta
- License: BSD License
- Author:Larry Hastings
- Maintainer:Python Core Developers
- Requires: Python >=3.9
- Provides-Extra:
tests
Classifiers
- Intended Audience
- License
- Programming Language
Project description
blurb
Overview
blurb is a tool designed to rid CPython core developmentof the scourge ofMisc/NEWS conflicts.
The core concept: splitMisc/NEWS into manyseparate files that, when concatenated back togetherin sorted order, reconstitute the originalMisc/NEWS file.After that,Misc/NEWS could be deleted from the CPythonrepo and thereafter rendered on demand (e.g. when buildinga release). When committing a change to CPython, the commitprocess will write out a new file that sorts into the correct place,using a filename unlikely to have a merge conflict.
blurb is a single command with a number of subcommands.It's designed to be run inside a valid CPython (Git) repo,and automatically uses the correct file paths.
You can installblurb from PyPI usingpip. Alternatively,simply addblurb to a directory on your path.
Files used by blurb
blurb uses a new directory tree calledMisc/NEWS.d.Everything it does is in there, except for possiblymodifyingMisc/NEWS.
UnderMisc/NEWS.d you'll find the following:
A single file for all news entries per previous revision,named for the exact version number, with the extension
.rst.Example:Misc/NEWS.d/3.6.0b2.rst.The
nextdirectory, which contains subdirectories representingthe variousMisc/NEWScategories. Inside these subdirectoriesare more.rstfiles with long, uninteresting, computer-generatednames. Example:Misc/NEWS.d/next/Library/2017-05-04-12-24-06.gh-issue-25458.Yl4gI2.rst
blurb subcommands
Like many modern utilities,blurb has only one executable(calledblurb), but provides a diverse set of functionalitythrough subcommands. The subcommand is the first argument specifiedon the command-line.
If you're a CPython contributor, you probably don't need to useanything exceptblurb add — and you don't even need to specifytheadd part.(If no subcommand is specified,blurb assumes you meantblurb add.)The other commands are only expected to be useful for CPython releasemanagers.
blurb help
blurb is self-documenting through theblurb help subcommand.Run without any further arguments, it prints a list of all subcommands,with a one-line summary of the functionality of each. Run with athird argument, it prints help on that subcommand (e.g.blurb help release).
blurb add
blurb add adds a newMisc/NEWS entry for you.It opens a text editor on a template; you edit thefile, save, and exit.blurb then stores the filein the correct place, and stages it in Git for you.
The template for theblurb add message looks like this:
## Please enter the relevant GitHub issue number here:#.. gh-issue:## Uncomment one of these "section:" lines to specify which section# this entry should go in in Misc/NEWS.##.. section: Security#.. section: Core and Builtins#.. section: Library#.. section: Documentation#.. section: Tests#.. section: Build#.. section: Windows#.. section: macOS#.. section: IDLE#.. section: Tools/Demos#.. section: C API# Write your Misc/NEWS entry below. It should be a simple ReST paragraph.# Don't start with "- Issue #<n>: " or "- gh-issue<n>: " or that sort of stuff.###########################################################################Here's how you interact with the file:
Add the GitHub issue number for this commit to theend of the
.. gh-issue:line.Uncomment the line with the relevant
Misc/NEWSsection for this entry.For example, if this should go in theLibrarysection, uncommentthe line reading#.. section: Library. To uncomment, just deletethe#at the front of the line.Finally, go to the end of the file, and enter your
NEWSentry.This should be a single paragraph of English text usingsimple reST markup.
Whenblurb add gets a valid entry, it writes it to a filewith the following format:
Misc/NEWS.d/next/<section>/<datetime>.gh-issue-<issue_number>.<nonce>.rstFor example, a file added byblurb add might look like this::
Misc/NEWS.d/next/Library/2017-05-04-12-24-06.gh-issue-25458.Yl4gI2.rst<section> is the section provided in the commit message.
<datetime> is the current UTC time, formatted asYYYY-MM-DD-hh-mm-ss.
<nonce> is a hopefully-unique string of characters meant toprevent filename collisions.blurb creates this by computingthe MD5 hash of the text, converting it to base64 (using the"urlsafe" alphabet), and taking the first 6 characters of that.
This filename ensures several things:
All entries in
Misc/NEWSwill be sorted by time.It is unthinkably unlikely that there'll be a conflictbetween the filenames generated for two developers committing,even if they commit in at the exact same second.
Finally,blurb add stages the file in git for you.
blurb merge
blurb merge recombines all the files in theMisc/NEWS.d tree back into a singleNEWS file.
blurb merge accepts only a single command-line argument:the file to write to. By default, it writes toMisc/NEWS (relative to the root of your CPython checkout).
Splitting and recombining the existingMisc/NEWS filedoesn't recreate the previousMisc/NEWS exactly. Thisis becauseMisc/NEWS never used a consistent orderingfor the "sections" inside each release, whereasblurb mergehas a hard-coded preferred ordering for the sections. Also,blurb aggressively reflows paragraphs to < 78 columns,wheras the original hand-edited file occasionally had lines >80 columns. Finally,blurb strictly usesgh-issue-<n>: tospecify issue numbers at the beginnings of entries, wherasthe legacy approach toMisc/NEWS required usingIssue #<n>:.
blurb release
blurb release is used by the release manager as part ofthe CPython release process. It takes exactly one argument,the name of the version being released.
Here's what it does under the hood:
- Combines all recently-added NEWS entries fromthe
Misc/NEWS.d/nextdirectory intoMisc/NEWS.d/<version>.rst. - Runs
blurb mergeto produce an updatedMisc/NEWSfile.
One hidden feature: if the version specified is.,blurb releaseuses the name of the directory CPython is checked out to.(When making a release I generally name the directory after theversion I'm releasing, and using this shortcut saves me some typing.)
The "next" directory
You may have noticed thatblurb add adds news entries toa directory callednext, andblurb release combines thosenews entries into a single file named with the version. Whyis that?
First, it makes naming the next version a late-binding decision.If we are currently working on 3.6.5rc1, but there's a zero-dayexploit and we need to release an emergency 3.6.5 final, we don'thave to fix up a bunch of metadata.
Second, it means that if you cherry-pick a commit forward orbackwards, you automatically pick up theNEWS entry too. Youdon't need to touch anything up — the system will already dothe right thing. IfNEWS entries were already written to thefinal version directory, you'd have to move those around aspart of the cherry-picking process.
Copyright
blurb is Copyright 2015-2018 by Larry Hastings.Licensed to the PSF under a contributor agreement.
Changelog
SeeCHANGELOG.md.
Project details
Verified details
These details have beenverified by PyPIProject links
Owner
GitHub Statistics
Maintainers
Unverified details
These details havenot been verified by PyPIMeta
- License: BSD License
- Author:Larry Hastings
- Maintainer:Python Core Developers
- Requires: Python >=3.9
- Provides-Extra:
tests
Classifiers
- Intended Audience
- License
- Programming Language
Release historyRelease notifications |RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more aboutinstalling packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more aboutwheel file names.
Copy a direct link to the current filters
File details
Details for the fileblurb-2.0.0.tar.gz.
File metadata
- Download URL:blurb-2.0.0.tar.gz
- Upload date:
- Size: 24.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | c78d8114294225a4f7a2eabba6e05d36a6a50e45ba9f5a41afabc198350038e0 | |
| MD5 | 610dcb56c5851a8db57c6e3d3cc95475 | |
| BLAKE2b-256 | d7828597d891f4b03f3eaefcb4213a811643d558350cac9a69864d127832cc4f |
Provenance
The following attestation bundles were made forblurb-2.0.0.tar.gz:
Publisher:release.yml on python/blurb
- Statement:
- Statement type:
https://in-toto.io/Statement/v1 - Predicate type:
https://docs.pypi.org/attestations/publish/v1 - Subject name:
blurb-2.0.0.tar.gz - Subject digest:
c78d8114294225a4f7a2eabba6e05d36a6a50e45ba9f5a41afabc198350038e0 - Sigstore transparency entry:162578254
- Sigstore integration time:
- Permalink:
python/blurb@e7ea7184202a855d4dd28475f17430a8a247e85b - Branch / Tag:
refs/tags/v2.0.0 - Owner:https://github.com/python
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com - Runner Environment:
github-hosted - Publication workflow:
release.yml@e7ea7184202a855d4dd28475f17430a8a247e85b - Trigger Event:
release
- Statement type:
File details
Details for the fileblurb-2.0.0-py3-none-any.whl.
File metadata
- Download URL:blurb-2.0.0-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | f6d0e858dbe94765f6a89b8228217ffdb9c19cff08fc8f2c3153954846d31aa1 | |
| MD5 | 343e39fc31346a3c1e9715f5f5e449ff | |
| BLAKE2b-256 | b403374bd9e31b58e8a8e5dc65cc3f68ca7cdd716c32b5e5dcb0e1b76bb75b4a |
Provenance
The following attestation bundles were made forblurb-2.0.0-py3-none-any.whl:
Publisher:release.yml on python/blurb
- Statement:
- Statement type:
https://in-toto.io/Statement/v1 - Predicate type:
https://docs.pypi.org/attestations/publish/v1 - Subject name:
blurb-2.0.0-py3-none-any.whl - Subject digest:
f6d0e858dbe94765f6a89b8228217ffdb9c19cff08fc8f2c3153954846d31aa1 - Sigstore transparency entry:162578256
- Sigstore integration time:
- Permalink:
python/blurb@e7ea7184202a855d4dd28475f17430a8a247e85b - Branch / Tag:
refs/tags/v2.0.0 - Owner:https://github.com/python
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com - Runner Environment:
github-hosted - Publication workflow:
release.yml@e7ea7184202a855d4dd28475f17430a8a247e85b - Trigger Event:
release
- Statement type: