Skip to content

Commit 8e8543e

Browse files
committed
Condensed bump.py
1 parent 08ea44f commit 8e8543e

2 files changed

Lines changed: 10 additions & 14 deletions

File tree

remove-json-keys/utils/bump.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@ def update_changelog_url():
1717
logging.debug(f'Generated changelog URL: {changelog_url}')
1818

1919
if 'urls' not in pyproject['project']:
20-
logging.debug('Adding [project.urls] section to pyproject.toml...')
20+
logging.debug('Creating [project.urls] section...')
2121
pyproject['project']['urls'] = {}
2222

23-
if 'Changelog' in pyproject['project']['urls']:
24-
logging.debug('Replacing existing Changelog URL...')
25-
else:
26-
logging.debug('Adding new Changelog URL...')
27-
23+
logging.debug(
24+
f"{'Replacing existing' if 'Changelog' in pyproject['project']['urls'] else 'Adding new '} Changelog URL...")
2825
pyproject['project']['urls']['Changelog'] = changelog_url
2926
with open(pyproject_path, 'wb') as file : tomli_w.dump(pyproject, file)
30-
logging.info(f"Bumped changelog URL ver tag to '{ver_tag}'!")
27+
28+
logging.info(f"Bumped changelog URL ver tag to [{ver_tag}]!")
3129

3230
update_changelog_url()

translate-messages/utils/bump.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@ def update_changelog_url():
1717
logging.debug(f'Generated changelog URL: {changelog_url}')
1818

1919
if 'urls' not in pyproject['project']:
20-
logging.debug('Adding [project.urls] section to pyproject.toml...')
20+
logging.debug('Creating [project.urls] section...')
2121
pyproject['project']['urls'] = {}
2222

23-
if 'Changelog' in pyproject['project']['urls']:
24-
logging.debug('Replacing existing Changelog URL...')
25-
else:
26-
logging.debug('Adding new Changelog URL...')
27-
23+
logging.debug(
24+
f"{'Replacing existing' if 'Changelog' in pyproject['project']['urls'] else 'Adding new '} Changelog URL...")
2825
pyproject['project']['urls']['Changelog'] = changelog_url
2926
with open(pyproject_path, 'wb') as file : tomli_w.dump(pyproject, file)
30-
logging.info(f"Bumped changelog URL ver tag to '{ver_tag}'!")
27+
28+
logging.info(f"Bumped changelog URL ver tag to [{ver_tag}]!")
3129

3230
update_changelog_url()

0 commit comments

Comments
 (0)