GeezerVison is showing github.com — Prepare release 26.10.0 (#5478) · psf/black@4f1883b
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/workflows/changelog.yml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 23 | 23 | if: > | 24 | 24 | contains(github.event.pull_request.labels.*.name, 'ci: skip news') != true | 25 | 25 | run: | | 26 | | - grep -Pz "\((\n\s*)?#${{ github.event.pull_request.number }}(\n\s*)?\)" CHANGES.md || \ | | 26 | + grep -Pz '\((#\d+,\s+)*#${{ github.event.pull_request.number }}(,\s+#\d+)*\)$' CHANGES.md || \ | 27 | 27 | (echo "Please add '(#${{ github.event.pull_request.number }})' change line to CHANGES.md (or if appropriate, ask a maintainer to add the 'ci: skip news' label)" && \ | 28 | 28 | exit 1) |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/cut_release.yml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -109,7 +109,7 @@ jobs: | 109 | 109 | - name: Create PR | 110 | 110 | run: | | 111 | 111 | gh pr create \ | 112 | | - -t "Add new changelog" -b "" \ | | 112 | + -t "Add new changelog" -b "<sub>This PR is automated</sub>" \ | 113 | 113 | -l "ci: skip news" -l "C: maintenance" \ | 114 | 114 | -a "$USER" | 115 | 115 | env: | |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/prepare_release.yml +12-8Lines changed: 12 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -89,14 +89,18 @@ jobs: | 89 | 89 |
| 90 | 90 | - name: Write PR description | 91 | 91 | run: | | 92 | | - echo "Please follow the process in [the docs](https://black.readthedocs.io/en/latest/contributing/release_process.html#cutting-a-release) to cut a release." > description.md | 93 | | - echo "<details><summary>Changelog Diff</summary>" >> description.md | 94 | | - echo "" >> description.md | 95 | | - echo "\`\`\`diff" >> description.md | 96 | | - git diff origin/stable "origin/$BRANCH" -- CHANGES.md >> description.md | 97 | | - echo "\`\`\`" >> description.md | 98 | | - echo "" >> description.md | 99 | | - echo "</details>" >> description.md | | 92 | + { | | 93 | + echo "<!-- Please don't edit this; it will be overridden -->" | | 94 | + echo "Please follow the process in [the docs](https://black.readthedocs.io/en/latest/contributing/release_process.html#cutting-a-release) to cut a release." | | 95 | + echo "<details><summary>Changelog Diff</summary>" | | 96 | + echo | | 97 | + echo '`````diff' | | 98 | + git diff origin/stable "origin/$BRANCH" -- CHANGES.md | | 99 | + echo '`````' | | 100 | + echo | | 101 | + echo "</details>" | | 102 | + echo "<sub>This PR is automated</sub>" | | 103 | + } > description.md | 100 | 104 | env: | 101 | 105 | BRANCH: |- | 102 | 106 | ${{ needs.create.outputs.version | |
Collapse file Copy file name to clipboardExpand all lines: CHANGES.md +100-199Lines changed: 100 additions & 199 deletions - Display the source diff
- Display the rich diff
Large diffs are not rendered by default. Collapse file Copy file name to clipboardExpand all lines: docs/contributing/release_process.md +6-3Lines changed: 6 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -129,7 +129,8 @@ old _Black_ versions, then creates a PR with the changes for your review. The PR | 129 | 129 | creation is authenticated in order to trigger test CI. | 130 | 130 |
| 131 | 131 | ```{note} | 132 | | -_Currently this workflow uses a GitHub API token associated with @JelleZijlstra's account._ | | 132 | +_Currently this workflow uses a GitHub API token associated with @JelleZijlstra's | | 133 | +account._ | 133 | 134 | ``` | 134 | 135 |
| 135 | 136 | #### update | @@ -165,7 +166,8 @@ further release automation. Then, only if the release was stable, it updates the | 165 | 166 | `stable` branch by force pushing it to the most recent tag. | 166 | 167 |
| 167 | 168 | ```{note} | 168 | | -_Currently this workflow uses a GitHub API token associated with @JelleZijlstra's account._ | | 169 | +_Currently this workflow uses a GitHub API token associated with @JelleZijlstra's | | 170 | +account._ | 169 | 171 | ``` | 170 | 172 |
| 171 | 173 | #### new-changelog | @@ -175,7 +177,8 @@ not auto-merged to allow the releaser time to make sure all the release workflow | 175 | 177 | succeed. The PR creation is authenticated in order to trigger test CI. | 176 | 178 |
| 177 | 179 | ```{note} | 178 | | -_Currently this workflow uses a GitHub API token associated with @JelleZijlstra's account._ | | 180 | +_Currently this workflow uses a GitHub API token associated with @JelleZijlstra's | | 181 | +account._ | 179 | 182 | ``` | 180 | 183 |
| 181 | 184 | ### build and publish | |
Collapse file Copy file name to clipboardExpand all lines: docs/guides/using_black_with_jupyter_notebooks.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -111,7 +111,7 @@ Simply replace the `black` hook with `black-jupyter`. | 111 | 111 | ```yaml | 112 | 112 | repos: | 113 | 113 | - repo: https://github.com/psf/black-pre-commit-mirror | 114 | | - rev: 26.5.1 | | 114 | + rev: 26.10.0 | 115 | 115 | hooks: | 116 | 116 | - id: black-jupyter | 117 | 117 | language_version: python3.11 | |
Collapse file Copy file name to clipboardExpand all lines: docs/integrations/github_actions.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -128,4 +128,4 @@ The action provides the following outputs: | 128 | 128 | - `failure_count`: Number of files that failed to reformat. | 129 | 129 |
| 130 | 130 | These outputs are only accessible if the action version as well as `with.version` are | 131 | | -both 26.10+. | | 131 | +both 26.10.0+. |
Collapse file Copy file name to clipboardExpand all lines: docs/integrations/source_version_control.md +3-3Lines changed: 3 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,7 +8,7 @@ Use [pre-commit](https://pre-commit.com/). Once you | 8 | 8 | repos: | 9 | 9 | # Using this mirror lets us use mypyc-compiled black, which is about 2x faster | 10 | 10 | - repo: https://github.com/psf/black-pre-commit-mirror | 11 | | - rev: 26.5.1 | | 11 | + rev: 26.10.0 | 12 | 12 | hooks: | 13 | 13 | - id: black | 14 | 14 | # It is recommended to specify the latest version of Python | @@ -34,7 +34,7 @@ include Jupyter Notebooks. To use this hook, simply replace the hook's `id: blac | 34 | 34 | ```yaml | 35 | 35 | repos: | 36 | 36 | - repo: https://github.com/psf/black-pre-commit-mirror | 37 | | - rev: 26.5.1 | | 37 | + rev: 26.10.0 | 38 | 38 | hooks: | 39 | 39 | - id: black-jupyter | 40 | 40 | language_version: python3.11 | @@ -64,7 +64,7 @@ Configure exclusions directly in `.pre-commit-config.yaml`: | 64 | 64 | ```yaml | 65 | 65 | repos: | 66 | 66 | - repo: https://github.com/psf/black-pre-commit-mirror | 67 | | - rev: 26.5.1 | | 67 | + rev: 26.10.0 | 68 | 68 | hooks: | 69 | 69 | - id: black | 70 | 70 | exclude: ^migrations/|^generated/ | |
Collapse file Copy file name to clipboardExpand all lines: docs/usage_and_configuration/the_basics.md +3-3Lines changed: 3 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -280,8 +280,8 @@ configuration file for consistent results across environments. | 280 | 280 |
| 281 | 281 | ```console | 282 | 282 | $ black --version | 283 | | -black, 26.5.1 (compiled: yes) | 284 | | -$ black --required-version 26.5.1 -c "format = 'this'" | | 283 | +black, 26.10.0 (compiled: yes) | | 284 | +$ black --required-version 26.10.0 -c "format = 'this'" | 285 | 285 | format = "this" | 286 | 286 | $ black --required-version 31.5b2 -c "still = 'beta?!'" | 287 | 287 | Oh no! 💥 💔 💥 The required version does not match the running version! | @@ -394,7 +394,7 @@ You can check the version of _Black_ you have installed using the `--version` fl | 394 | 394 |
| 395 | 395 | ```console | 396 | 396 | $ black --version | 397 | | -black, 26.5.1 | | 397 | +black, 26.10.0 | 398 | 398 | ``` | 399 | 399 |
| 400 | 400 | #### `--config` | |
Collapse file Copy file name to clipboardExpand all lines: scripts/release.py +27-36Lines changed: 27 additions & 36 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -209,10 +209,10 @@ def cleanup_changes_template_for_release(self) -> None: | 209 | 209 | ) | 210 | 210 |
| 211 | 211 | # Remove all comments | 212 | | - changes_string = re.sub(r"(?m)^<!--(?>(?:.|\n)*?-->)\n+", "", changes_string) | | 212 | + changes_string = re.sub(r"(?m)<!--(?>(?:.|\n)*?-->)\n*", "", changes_string) | 213 | 213 |
| 214 | 214 | # Remove empty subheadings | 215 | | - changes_string = re.sub(r"(?m)^###.+\n+(?=#)", "", changes_string) | | 215 | + changes_string = re.sub(r"(?m)^(#+).+\n+(?=#)(?!\1#)", "", changes_string) | 216 | 216 |
| 217 | 217 | with self.changes_path.open("w", encoding="utf-8") as cfp: | 218 | 218 | cfp.write(changes_string) | @@ -258,47 +258,35 @@ def get_changelog(self) -> str | None: | 258 | 258 | return heading_split[1].strip() | 259 | 259 |
| 260 | 260 |
| 261 | | -def _handle_debug(debug: bool) -> None: | 262 | | - """Turn on debugging if asked, otherwise default to INFO""" | 263 | | - log_level = logging.DEBUG if debug else logging.INFO | 264 | | - logging.basicConfig( | 265 | | - format="[%(asctime)s] %(levelname)s: %(message)s (%(filename)s:%(lineno)d)", | 266 | | - level=log_level, | 267 | | - ) | 268 | | - LOG.debug(f"Log level: {logging.getLevelName(log_level)}") | 269 | | - | 270 | | - | 271 | | -def parse_args() -> argparse.Namespace: | 272 | | - parser = argparse.ArgumentParser() | 273 | | - parser.add_argument( | 274 | | - "-d", "--debug", action="store_true", help="Verbose debug output" | 275 | | - ) | | 261 | +def add_subparser(name: str, help: str) -> argparse.ArgumentParser: | | 262 | + return subparsers.add_parser(name, help=help, description=help) | 276 | 263 |
| 277 | | - subparsers = parser.add_subparsers(dest="command") | 278 | 264 |
| 279 | | - def add_parser(name: str, help: str) -> argparse.ArgumentParser: | 280 | | - return subparsers.add_parser(name, help=help, description=help) | 281 | | - | 282 | | - add_parser("prepare", help="Prepare a release").add_argument( | 283 | | - "version", type=str, nargs="?", help="Override the next version" | 284 | | - ) | 285 | | - add_parser("add", help="Add the Unreleased template to CHANGES.md") | 286 | | - add_parser( | 287 | | - "prerelease", | 288 | | - help="Returns the next prerelease version for the given stable version", | 289 | | - ).add_argument("version", type=str, help="The stable version") | 290 | | - add_parser("version", help="Returns the next version number") | 291 | | - add_parser("changes", help="Returns the latest changelog") | 292 | | - | 293 | | - args = parser.parse_args() | 294 | | - return args | | 265 | +parser = argparse.ArgumentParser() | | 266 | +parser.add_argument("-d", "--debug", action="store_true", help="Verbose debug output") | | 267 | +subparsers = parser.add_subparsers(dest="command") | | 268 | +add_subparser("prepare", help="Prepare a release").add_argument( | | 269 | + "version", type=str, nargs="?", help="Override the next version" | | 270 | +) | | 271 | +add_subparser("add", help="Add the Unreleased template to CHANGES.md") | | 272 | +add_subparser( | | 273 | + "prerelease", | | 274 | + help="Returns the next prerelease version for the given stable version", | | 275 | +).add_argument("version", type=str, help="The stable version") | | 276 | +add_subparser("version", help="Returns the next version number") | | 277 | +add_subparser("changes", help="Returns the latest changelog") | 295 | 278 |
| 296 | 279 |
| 297 | 280 | def main() -> int: | 298 | | - args = parse_args() | | 281 | + args = parser.parse_args() | 299 | 282 |
| 300 | 283 | if (args.command == "prepare" or args.command == "add") or args.debug: | 301 | | - _handle_debug(args.debug) | | 284 | + log_level = logging.DEBUG if args.debug else logging.INFO | | 285 | + logging.basicConfig( | | 286 | + format="[%(asctime)s] %(levelname)s: %(message)s (%(filename)s:%(lineno)d)", | | 287 | + level=log_level, | | 288 | + ) | | 289 | + LOG.debug(f"Log level: {logging.getLevelName(log_level)}") | 302 | 290 |
| 303 | 291 | # Need parent.parent cause script is in scripts/ directory | 304 | 292 | sf = SourceFiles( | @@ -324,6 +312,9 @@ def main() -> int: | 324 | 312 | return 1 | 325 | 313 | print(changes) | 326 | 314 | return 0 | | 315 | + case None: | | 316 | + parser.print_help() | | 317 | + return 0 | 327 | 318 |
| 328 | 319 | LOG.error(f"Unknown command: {args.command}") | 329 | 320 | return 1 | |
|