Skip to content

Produce better Misc/NEWS output for Sphinx #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions src/blurb/blurb.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
(This formatting will be inserted when rendering the final output.)
* Lines longer than 76 characters will be wordwrapped.
* In the final output, the first line will have
"- gh-issue-<gh-issue-number>: " inserted at the front,
"- :gh:`<gh-issue-number>`: " inserted at the front,
and subsequent lines will have two spaces inserted
at the front.

Expand Down Expand Up @@ -989,13 +989,6 @@
s = sep.join(str(x) for x in a)
return builtins.print(s, file=buff)

print ("""
+++++++++++
Python News
+++++++++++

""".strip())

for version in versions:
filenames = glob_blurbs(version)

Expand All @@ -1013,7 +1006,7 @@
assert len(filenames) == 1
blurbs.load(filenames[0])

header = "What's New in Python " + printable_version(version) + "?"
header = printable_version(version)

Check warning on line 1009 in src/blurb/blurb.py

View check run for this annotation

Codecov / codecov/patch

src/blurb/blurb.py#L1009

Added line #L1009 was not covered by tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something (I'm guessing this line?) is dropping "Python" before the version numbers in the headers, which has a knock-on effect that a lot (but not all) of anchors change from like #python-3-13-0-alpha-4 to #id62:

(main on left, PR on right)

image image

print()
print(header)
print("=" * len(header))
Expand Down Expand Up @@ -1042,14 +1035,13 @@
if metadata.get("gh-issue"):
issue_number = metadata['gh-issue']
if int(issue_number):
body = "gh-" + issue_number + ": " + body
body = f":gh:`{issue_number}`: {body}"

Check warning on line 1038 in src/blurb/blurb.py

View check run for this annotation

Codecov / codecov/patch

src/blurb/blurb.py#L1038

Added line #L1038 was not covered by tests
elif metadata.get("bpo"):
issue_number = metadata['bpo']
if int(issue_number):
body = "bpo-" + issue_number + ": " + body
body = f":issue:`{issue_number}`: {body}"

Check warning on line 1042 in src/blurb/blurb.py

View check run for this annotation

Codecov / codecov/patch

src/blurb/blurb.py#L1042

Added line #L1042 was not covered by tests

body = "- " + body
text = textwrap_body(body, subsequent_indent=' ')
text = textwrap_body(f"- {body}", subsequent_indent=' ')

Check warning on line 1044 in src/blurb/blurb.py

View check run for this annotation

Codecov / codecov/patch

src/blurb/blurb.py#L1044

Added line #L1044 was not covered by tests
print(text)
print()
print("**(For information about older versions, consult the HISTORY file.)**")
Expand Down