GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Prepare release 26.10.0 (#5478) · psf/black@4f1883b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • changelog.yml
    • cut_release.yml
    • prepare_release.yml
  • CHANGES.md
  • docs
    • contributing
      • release_process.md
    • guides
      • using_black_with_jupyter_notebooks.md
    • integrations
      • github_actions.md
      • source_version_control.md
    • usage_and_configuration
      • the_basics.md
  • scripts
    • release.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/changelog.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/changelog.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ jobs:
2323
if: >
2424
contains(github.event.pull_request.labels.*.name, 'ci: skip news') != true
2525
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 || \
2727
(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)" && \
2828
exit 1)
Collapse file

‎.github/workflows/cut_release.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/cut_release.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
- name: Create PR
110110
run: |
111111
gh pr create \
112-
-t "Add new changelog" -b "" \
112+
-t "Add new changelog" -b "<sub>This PR is automated</sub>" \
113113
-l "ci: skip news" -l "C: maintenance" \
114114
-a "$USER"
115115
env:
Collapse file

‎.github/workflows/prepare_release.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/prepare_release.yml
+12-8Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,18 @@ jobs:
8989

9090
- name: Write PR description
9191
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
100104
env:
101105
BRANCH: |-
102106
${{ needs.create.outputs.version
Collapse file

‎CHANGES.md‎

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

‎docs/contributing/release_process.md‎

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 numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ old _Black_ versions, then creates a PR with the changes for your review. The PR
129129
creation is authenticated in order to trigger test CI.
130130

131131
```{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._
133134
```
134135

135136
#### update
@@ -165,7 +166,8 @@ further release automation. Then, only if the release was stable, it updates the
165166
`stable` branch by force pushing it to the most recent tag.
166167

167168
```{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._
169171
```
170172

171173
#### new-changelog
@@ -175,7 +177,8 @@ not auto-merged to allow the releaser time to make sure all the release workflow
175177
succeed. The PR creation is authenticated in order to trigger test CI.
176178

177179
```{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._
179182
```
180183

181184
### build and publish
Collapse file

‎docs/guides/using_black_with_jupyter_notebooks.md‎

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 numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Simply replace the `black` hook with `black-jupyter`.
111111
```yaml
112112
repos:
113113
- repo: https://github.com/psf/black-pre-commit-mirror
114-
rev: 26.5.1
114+
rev: 26.10.0
115115
hooks:
116116
- id: black-jupyter
117117
language_version: python3.11
Collapse file

‎docs/integrations/github_actions.md‎

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 numberDiff line numberDiff line change
@@ -128,4 +128,4 @@ The action provides the following outputs:
128128
- `failure_count`: Number of files that failed to reformat.
129129

130130
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

‎docs/integrations/source_version_control.md‎

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 numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Use [pre-commit](https://pre-commit.com/). Once you
88
repos:
99
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
1010
- repo: https://github.com/psf/black-pre-commit-mirror
11-
rev: 26.5.1
11+
rev: 26.10.0
1212
hooks:
1313
- id: black
1414
# 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
3434
```yaml
3535
repos:
3636
- repo: https://github.com/psf/black-pre-commit-mirror
37-
rev: 26.5.1
37+
rev: 26.10.0
3838
hooks:
3939
- id: black-jupyter
4040
language_version: python3.11
@@ -64,7 +64,7 @@ Configure exclusions directly in `.pre-commit-config.yaml`:
6464
```yaml
6565
repos:
6666
- repo: https://github.com/psf/black-pre-commit-mirror
67-
rev: 26.5.1
67+
rev: 26.10.0
6868
hooks:
6969
- id: black
7070
exclude: ^migrations/|^generated/
Collapse file

‎docs/usage_and_configuration/the_basics.md‎

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 numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ configuration file for consistent results across environments.
280280

281281
```console
282282
$ 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'"
285285
format = "this"
286286
$ black --required-version 31.5b2 -c "still = 'beta?!'"
287287
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
394394

395395
```console
396396
$ black --version
397-
black, 26.5.1
397+
black, 26.10.0
398398
```
399399

400400
#### `--config`
Collapse file

‎scripts/release.py‎

Copy file name to clipboardExpand all lines: scripts/release.py
+27-36Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ def cleanup_changes_template_for_release(self) -> None:
209209
)
210210

211211
# 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)
213213

214214
# Remove empty subheadings
215-
changes_string = re.sub(r"(?m)^###.+\n+(?=#)", "", changes_string)
215+
changes_string = re.sub(r"(?m)^(#+).+\n+(?=#)(?!\1#)", "", changes_string)
216216

217217
with self.changes_path.open("w", encoding="utf-8") as cfp:
218218
cfp.write(changes_string)
@@ -258,47 +258,35 @@ def get_changelog(self) -> str | None:
258258
return heading_split[1].strip()
259259

260260

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)
276263

277-
subparsers = parser.add_subparsers(dest="command")
278264

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")
295278

296279

297280
def main() -> int:
298-
args = parse_args()
281+
args = parser.parse_args()
299282

300283
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)}")
302290

303291
# Need parent.parent cause script is in scripts/ directory
304292
sf = SourceFiles(
@@ -324,6 +312,9 @@ def main() -> int:
324312
return 1
325313
print(changes)
326314
return 0
315+
case None:
316+
parser.print_help()
317+
return 0
327318

328319
LOG.error(f"Unknown command: {args.command}")
329320
return 1

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.