Bump codecov/codecov-action from 5 to 6 in the actions group (#76)
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
blurb
Overview
blurb is a tool designed to rid CPython core development of the scourge of
Misc/NEWSconflicts.The core concept: split
Misc/NEWSinto many separate files that, when concatenated back together in sorted order, reconstitute the originalMisc/NEWSfile. After that,Misc/NEWScould be deleted from the CPython repo and thereafter rendered on demand (e.g. when building a release). When committing a change to CPython, the commit process 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 install blurb from PyPI using
pip. Alternatively, simply addblurbto a directory on your path.Files used by blurb
blurb uses a new directory tree called
Misc/NEWS.d. Everything it does is in there, except for possibly modifyingMisc/NEWS.Under
Misc/NEWS.dyou’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 representing the variousMisc/NEWScategories. Inside these subdirectories are more.rstfiles with long, uninteresting, computer-generated names. Example:Misc/NEWS.d/next/Library/2017-05-04-12-24-06.gh-issue-25458.Yl4gI2.rstblurb subcommands
Like many modern utilities, blurb has only one executable (called
blurb), but provides a diverse set of functionality through subcommands. The subcommand is the first argument specified on the command-line.If you’re a CPython contributor, you probably don’t need to use anything except
blurb add— and you don’t even need to specify theaddpart. (If no subcommand is specified, blurb assumes you meantblurb add.) The other commands are only expected to be useful for CPython release managers.blurb help
blurb is self-documenting through the
blurb helpsubcommand. Run without any further arguments, it prints a list of all subcommands, with a one-line summary of the functionality of each. Run with a third argument, it prints help on that subcommand (e.g.blurb help release).blurb add
blurb addadds a newMisc/NEWSentry for you. It opens a text editor on a template; you edit the file, save, and exit. blurb then stores the file in the correct place, and stages it in Git for you.The template for the
blurb addmessage looks like this:Here’s how you interact with the file:
Add the GitHub issue number for this commit to the end of the
.. gh-issue:line. The issue can also be specified via the-i/--issueoption:Uncomment the line with the relevant
Misc/NEWSsection for this entry. For example, if this should go in theLibrarysection, uncomment the line reading#.. section: Library. To uncomment, just delete the#at the front of the line. The section can also be specified via the-s/--sectionoption:Finally, go to the end of the file, and enter your
NEWSentry. This should be a single paragraph of English text using simple reST markup.When
blurb addgets a valid entry, it writes it to a file with the following format:For example, a file added by
blurb addmight look like this::<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 to prevent filename collisions. blurb creates this by computing the 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 conflict between the filenames generated for two developers committing, even if they commit in at the exact same second.
Finally,
blurb addstages the file in git for you.blurb merge
blurb mergerecombines all the files in theMisc/NEWS.dtree back into a singleNEWSfile.blurb mergeaccepts 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 existing
Misc/NEWSfile doesn’t recreate the previousMisc/NEWSexactly. This is becauseMisc/NEWSnever used a consistent ordering for 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>:to specify issue numbers at the beginnings of entries, wheras the legacy approach toMisc/NEWSrequired usingIssue #<n>:.blurb release
blurb releaseis used by the release manager as part of the CPython release process. It takes exactly one argument, the name of the version being released.Here’s what it does under the hood:
Misc/NEWS.d/nextdirectory intoMisc/NEWS.d/<version>.rst.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 the version I’m releasing, and using this shortcut saves me some typing.)The “next” directory
You may have noticed that
blurb addadds news entries to a directory callednext, andblurb releasecombines those news entries into a single file named with the version. Why is 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-day exploit and we need to release an emergency 3.6.5 final, we don’t have to fix up a bunch of metadata.
Second, it means that if you cherry-pick a commit forward or backwards, you automatically pick up the
NEWSentry too. You don’t need to touch anything up — the system will already do the right thing. IfNEWSentries were already written to the final version directory, you’d have to move those around as part of the cherry-picking process.Copyright
blurb is Copyright 2015-2018 by Larry Hastings. Licensed to the PSF under a contributor agreement.
Changelog
See CHANGELOG.md.