On 25. 9. 24 08:20, Daniel Sahlberg wrote:
Hi,

I'm trying to read up on release.py (planning to make one of the upcoming releases - no promises I'll be done in time for 1.14.4 though).

There are quite a few cases where there is a dry_run parameter, for example in run_command:

[[[
def run_command(cmd, verbose=True, hide_stderr=False, dry_run=False):
 ...
    if not dry_run:
        subprocess.check_call(cmd, stdout=stdout, stderr=stderr)
    else:
        print('  ## dry-run; not executed')
]]]

Following the breadcrumbs, this parameter seems to be set from the command line arguments (for example in make_release_branch):
...dry_run=args.dry_run...

However I can't figure out how args.dry_run is set. I was looking in main, where the parser is setup but no trace of dry_run. Is it missing an add_argument or am I missing something?


You're not missing anything. I suspect those subcommands that initialize dry_run from args are never even used, because they would fail.

I recommend against adding a global --dry-run option, it would only obscure such uses. It looks like it was never properly implemented throughout the script, only for some subcommands and not even consistently for those.

There's quite a bit of release.py that should be reviewed and cleaned up (e.g., I don't think we use the buildbot update command at all).


-- Brane

Reply via email to