Skip to content

Commit

Permalink
Merge branch 'main' into no-spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Dec 26, 2023
2 parents acc9e05 + d752290 commit 22b23c9
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 27 deletions.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/proofreader_membership.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Python Proofreaders Team Membership
about: Request to join the Python Proofreaders team
title: "Request for Python Proofreaders team membership: name"
---

<!--
Anyone can create this issue to request membership to join the Python Proofreaders team.
More details: https://devguide.python.org/documentation/help-documenting/#proofreading
-->

# Request for Python Proofreaders team membership
@python/organization-owners, please add a new proofreader:

<!-- replace with real info -->

| | Description |
| --- | -------------------------- |
| GitHub username | @your-github-username |
| Additional info | e.g. _"I've made 1 million PRs"_, _"I found over 9000 typos in the docs"_ |
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
name: ${{ matrix.python-version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ blurb
Interactive utility for writing CPython ``Misc/NEWS.d`` entries. See
the blurb_ directory for more details.

.. _blurb: https://github.com/python/core-workflow/tree/master/blurb
.. _blurb: https://github.com/python/core-workflow/tree/main/blurb


Other core workflow tools
Expand Down
2 changes: 1 addition & 1 deletion blurb/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ and automatically uses the correct file paths.

You can install **blurb** from PyPI using ``pip``. Alternatively,
simply add ``blurb`` to a directory on your path.
**blurb**'s only dependency is Python 3.7+.
**blurb**'s only dependency is Python 3.8+.


Files used by blurb
Expand Down
54 changes: 34 additions & 20 deletions blurb/blurb.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,27 +460,34 @@ def finish_entry():
throw("Blurb 'body' can't start with " + repr(naughty_prefix) + "!")

no_changes = metadata.get('no changes')
section = metadata.get('section')

if not no_changes:
if not section:
throw("No 'section' specified. You must provide one!")
elif section not in sections:
throw("Invalid 'section'! You must use one of the predefined sections.")

issue_number = None

if metadata.get("gh-issue") is not None:
try:
issue_number = int(metadata.get('gh-issue'))
except (TypeError, ValueError):
throw("Invalid GitHub issue number! (" + repr(issue_number) + ")")
elif metadata.get("bpo") is not None:
try:
issue_number = int(metadata.get('bpo'))
except (TypeError, ValueError):
throw("Invalid bpo issue number! (" + repr(issue_number) + ")")

issue_keys = {
'gh-issue': 'GitHub',
'bpo': 'bpo',
}
for key, value in metadata.items():
# Iterate over metadata items in order.
# We parsed the blurb file line by line,
# so we'll insert metadata keys in the
# order we see them. So if we issue the
# errors in the order we see the keys,
# we'll complain about the *first* error
# we see in the blurb file, which is a
# better user experience.
if key in issue_keys:
try:
int(value)
except (TypeError, ValueError):
throw(f"Invalid {issue_keys[key]} issue number! ({value!r})")

if key == "section":
if no_changes:
continue
if value not in sections:
throw(f"Invalid section {value!r}! You must use one of the predefined sections.")

if not 'section' in metadata:
throw("No 'section' specified. You must provide one!")

self.append((metadata, text))
metadata = {}
Expand Down Expand Up @@ -810,6 +817,13 @@ def test(*args):
# unittest.main doesn't work because this isn't a module
# so we'll do it ourselves

while not (os.path.isdir(".git") and os.path.isdir("blurb")):
old_dir = os.getcwd()
os.chdir("..")
if old_dir == os.getcwd():
# we reached the root and never found it!
sys.exit("Error: Couldn't find the root of your blurb repo!")

print("-" * 79)

for clsname, cls in sorted(globals().items()):
Expand Down
4 changes: 2 additions & 2 deletions blurb/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ author = "Larry Hastings"
author-email = "larry@hastings.org"
maintainer = "Python Core Developers"
maintainer-email = "core-workflow@mail.python.org"
home-page = "https://github.com/python/core-workflow/tree/master/blurb"
requires-python = ">=3.7"
home-page = "https://github.com/python/core-workflow/tree/main/blurb"
requires-python = ">=3.8"
description-file = "README.rst"
classifiers = [
"Intended Audience :: Developers",
Expand Down
4 changes: 4 additions & 0 deletions blurb/tests/fail/invalid-gh-number.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. gh-issue: abcde
.. section: Library
Things, stuff.
4 changes: 4 additions & 0 deletions blurb/tests/fail/invalid-section.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. gh-issue: 8675309
.. section: Funky Kong
This is an invalid blurb. Shockingly, "Funky Kong" is not a valid section name.
4 changes: 4 additions & 0 deletions blurb/tests/fail/no-gh-number.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. gh-issue:
.. section: Library
Things, stuff.
3 changes: 3 additions & 0 deletions blurb/tests/fail/no-section.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.. gh-issue: 8675309
This is an invalid blurb. It doesn't have a "section".

0 comments on commit 22b23c9

Please sign in to comment.