Skip to content

Commit 5198d0c

Browse files
committed
Alphabetized imports, prepended new_ to template var names, used project.urls['Releases']
1 parent 63465f0 commit 5198d0c

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

remove-json-keys/utils/bump.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
from os import path
2-
from types import SimpleNamespace as sns
32
import sys
3+
from types import SimpleNamespace as sns
44
import tomli, tomli_w
55

66
# Init logger
77
sys.path.insert(0, path.join(path.dirname(__file__), '../src'))
88
from remove_json_keys.lib import log # type: ignore
99

10-
# Load pyproject.toml
10+
# Init project data
1111
pyproject_path = path.join(path.dirname(__file__), '../pyproject.toml')
1212
log.info(f'Loading {pyproject_path}...')
1313
with open(pyproject_path, 'rb') as file : pyproject = tomli.load(file)
1414
project = sns(**pyproject['project'])
1515

1616
def update_changelog_url():
17-
ver_tag = f'{project.name}-{project.version}'
18-
changelog_url = f'https://github.com/adamlui/python-utils/releases/tag/{ver_tag}'
19-
log.data(f'Generated changelog URL: {changelog_url}')
17+
new_ver_tag = f'{project.name}-{project.version}'
18+
new_changelog_url = f"{project.urls['Releases']}/tag/{new_ver_tag}"
19+
log.data(f'Generated changelog URL: {new_changelog_url}')
2020
log.info(f"{ 'Updating' if 'Changelog' in project.urls else 'Adding new' } Changelog URL...")
21-
project.urls['Changelog'] = changelog_url
21+
project.urls['Changelog'] = new_changelog_url
2222
pyproject['project'] = vars(project) # update og dict for dumping
2323
with open(pyproject_path, 'wb') as file : tomli_w.dump(pyproject, file)
24-
log.success(f'Bumped changelog URL ver tag to [{ver_tag}]!')
24+
log.success(f'Bumped changelog URL ver tag to [{new_ver_tag}]!')
2525

2626
update_changelog_url()

translate-messages/utils/bump.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
from os import path
2-
from types import SimpleNamespace as sns
32
import sys
3+
from types import SimpleNamespace as sns
44
import tomli, tomli_w
55

66
# Init logger
77
sys.path.insert(0, path.join(path.dirname(__file__), '../src'))
88
from translate_messages.lib import log # type: ignore
99

10-
# Load pyproject.toml
10+
# Init project data
1111
pyproject_path = path.join(path.dirname(__file__), '../pyproject.toml')
1212
log.info(f'Loading {pyproject_path}...')
1313
with open(pyproject_path, 'rb') as file : pyproject = tomli.load(file)
1414
project = sns(**pyproject['project'])
1515

1616
def update_changelog_url():
17-
ver_tag = f'{project.name}-{project.version}'
18-
changelog_url = f'https://github.com/adamlui/python-utils/releases/tag/{ver_tag}'
19-
log.data(f'Generated changelog URL: {changelog_url}')
17+
new_ver_tag = f'{project.name}-{project.version}'
18+
new_changelog_url = f"{project.urls['Releases']}/tag/{new_ver_tag}"
19+
log.data(f'Generated changelog URL: {new_changelog_url}')
2020
log.info(f"{ 'Updating' if 'Changelog' in project.urls else 'Adding new' } Changelog URL...")
21-
project.urls['Changelog'] = changelog_url
21+
project.urls['Changelog'] = new_changelog_url
2222
pyproject['project'] = vars(project) # update og dict for dumping
2323
with open(pyproject_path, 'wb') as file : tomli_w.dump(pyproject, file)
24-
log.success(f'Bumped changelog URL ver tag to [{ver_tag}]!')
24+
log.success(f'Bumped changelog URL ver tag to [{new_ver_tag}]!')
2525

2626
update_changelog_url()

0 commit comments

Comments
 (0)