Skip to content

Commit e070731

Browse files
committed
changed release step funcs to take keyword arguments instead of a single config argument
this requires **extra_kwargs everywhere (which is ugly) but makes the code more maintainable (as it is much more obvious which step func needs what) and makes it easier to call those functions standalone
1 parent 9c4a1a8 commit e070731

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

make_release.py

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
LARRAY_USERS_GROUP = "larray-users@googlegroups.com"
2626

2727

28-
def update_metapackage(context):
29-
if not context['public_release']:
28+
def update_metapackage(public_release, repository, release_name, **extra_kwargs):
29+
if not public_release:
3030
return
3131

32-
chdir(context['repository'])
33-
version = short(context['release_name'])
32+
chdir(repository)
33+
version = short(release_name)
3434

3535
# TODO: this should be echocall(redirect_stdout=False)
3636
print(f'Updating larrayenv metapackage to version {version}')
@@ -46,19 +46,29 @@ def update_metapackage(context):
4646
'--summary', "'Package installing larray and all sub-projects and optional dependencies'"])
4747

4848

49-
def merge_changelogs(config):
50-
if config['src_documentation'] is not None:
51-
chdir(join(config['build_dir'], config['src_documentation']))
49+
def merge_changelogs(build_dir, src_documentation, release_name, public_release, **extra_kwargs):
50+
chdir(join(build_dir, src_documentation))
5251

53-
if not config['public_release']:
54-
return
52+
if not public_release:
53+
return
5554

56-
check_call(['python', 'merge_changelogs.py', config['release_name']])
55+
check_call(['python', 'merge_changelogs.py', release_name])
5756

5857

5958
insert_step_func(merge_changelogs, msg='append changelogs from larray-editor project', before='update_changelog')
6059

6160

61+
# * the goal is to be able to fetch the editor changelog several times during development (manually) and automatically
62+
# during release
63+
# * we need to commit either a merged changelog or changes.rst which includes both and a copy of the editor changelog
64+
# because the doc is built on rtd
65+
# * the documentation must be buildable at any point (before a merge), so I need next_release to add an empty file
66+
67+
# def merge_changelogs(release_name):
68+
# include_changelog('CORE', release_name, LARRAY_GITHUB_REP, reset=True)
69+
# include_changelog('EDITOR', release_name, EDITOR_GITHUB_REP)
70+
71+
6272
# TODO : move to larrayenv project
6373
def announce_new_release(release_name):
6474
import win32com.client as win32
@@ -108,9 +118,9 @@ def announce_new_release(release_name):
108118

109119
local_repository = abspath(dirname(__file__))
110120
if argv[1] == '-m' or argv[1] == '--meta':
111-
local_config = set_config(local_repository, PACKAGE_NAME, SRC_CODE, argv[2], branch='master',
121+
local_config = set_config(local_repository, PACKAGE_NAME, SRC_CODE, release_name=argv[2], branch='master',
112122
src_documentation=SRC_DOC, tmp_dir=TMP_PATH)
113-
update_metapackage(local_config)
123+
update_metapackage(**local_config)
114124
elif argv[1] == '-a' or argv[1] == '--announce':
115125
no("Is metapackage larrayenv updated?")
116126
announce_new_release(argv[2])

0 commit comments

Comments
 (0)