8000 blurb: replace spaces with underscores in news directory by hugovk · Pull Request #499 · python/core-workflow · GitHub
[go: up one dir, main page]

Skip to content

blurb: replace spaces with underscores in news directory #499

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

Merged
merged 17 commits into from
Mar 6, 2024
Merged
Changes from 1 commit
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
Next Next commit
Remove unused code
  • Loading branch information
hugovk committed Mar 28, 2023
commit 036771539caa8682648c06deec2ce6634ece8ce3
68 changes: 0 additions & 68 deletions blurb/blurb.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import io
import inspect
import itertools
import math
import os
from pathlib import Path
import re
Expand Down Expand Up @@ -249,40 +248,6 @@ def safe_mkdir(path):
os.makedirs(path)


def which(cmd, path="PATH"):
"""Find cmd on PATH."""
if os.path.exists(cmd):
return cmd
if cmd[0] == '/':
return None
for segment in os.getenv(path).split(":"):
program = os.path.normpath(os.path.join(segment, cmd))
if os.path.exists(program):
return program
return None


def strip_whitespace_lines(lines):
# strip from head
while lines:
if lines[0]:
break
lines.pop(0)

# strip from tail
while lines:
if lines[-1]:
return
lines.pop()


def longest_line(lines):
longest = 0
for line in lines:
longest = max(longest, len(line))
return longest


def version_key(element):
fields = list(element.split("."))
if len(fields) == 1:
Expand Down Expand Up @@ -632,31 +597,6 @@ def save_next(self):
blurb.save(filename)
return filename

def save_split_next(self):
"""
Save out blurbs created from "blurb split".
They don't have dates, so we have to get creative.
"""
filenames = []
# the "date" MUST have a leading zero.
# this ensures these files sort after all
# newly created blurbs.
width = int(math.ceil(math.log(len(self), 10))) + 1
i = 1
blurb = Blurbs()
while self:
metadata, body = self.pop()
metadata['date'] = str(i).rjust(width, '0')
if 'release date' in metadata:
del metadata['release date']
blurb.append((metadata, body))
filename = blurb._extract_next_filename()
blurb.save(filename)
blurb.clear()
filenames.append(filename)
i += 1
return filenames


tests_run = 0

Expand Down Expand Up @@ -694,13 +634,6 @@ def filename_test(self, filename):
b.load(filename)



def run(s):
process = subprocess.run(s.split(), capture_output=True)
process.check_returncode()
return process.stdout.decode('ascii')


readme_re = re.compile(r"This is \w+ version \d+\.\d+").match

def chdir_to_repo_root():
Expand Down Expand Up @@ -993,7 +926,6 @@ def release(version):
metadata = {"no changes": "True", "gh-issue": "0", "section": "Library", "date": date, "nonce": nonceify(body)}
blurbs.append((metadata, body))
else:
no_changes = None
count = len(filenames)
print(f'Merging {count} blurbs to "{output}".')

Expand Down
0