Skip to content

Commit

Permalink
v0.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
marzer committed Dec 24, 2024
1 parent be409df commit c9360a7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.19.4 - 2024-12-24

- fixed minor issues on Python 3.8

## v0.19.3 - 2024-11-11

- fixed crash with nested C-style enums without a name (#39) (@tim-janik)
Expand Down
13 changes: 8 additions & 5 deletions src/poxy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,21 @@ def _invoker(func, **kwargs):
sys.exit(0)


def make_boolean_optional_arg(args, name, default, help='', **kwargs):
def make_boolean_optional_arg(args: argparse.ArgumentParser, name: str, default, help='', **kwargs):
name = name.strip().lstrip('-')
if sys.version_info >= (3, 9):
args.add_argument(rf'--{name}', default=default, help=help, action=argparse.BooleanOptionalAction, **kwargs)
else:
args.add_argument(rf'--{name}', action=r'store_true', help=help, **kwargs)
dest = name.replace(r'-', r'_')
args.add_argument(rf'--{name}', action=r'store_true', help=help, dest=dest, default=default, **kwargs)
args.add_argument(
rf'--no-{name}',
action=r'store_false',
help=(help if help == argparse.SUPPRESS else None),
dest=name,
dest=dest,
default=default,
**kwargs,
)
args.set_defaults(**{name: default})


def git(git_args: str, cwd=None) -> typing.Tuple[int, str, str]:
Expand Down Expand Up @@ -124,7 +126,8 @@ def multi_version_git_tags(args: argparse.Namespace):
original_branch = current_branch

default_branch = git_failed_if_nonzero(git('rev-parse --abbrev-ref origin/HEAD', cwd=input_dir))[1]
default_branch = default_branch.removeprefix(r'origin/')
if default_branch.startswith(r'origin/'):
default_branch = default_branch[len(r'origin/') :]
print(rf'Default branch: {default_branch}')

tags = git_failed_if_nonzero(git('tag', cwd=input_dir))[1].splitlines()
Expand Down
2 changes: 1 addition & 1 deletion src/poxy/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.19.3
0.19.4

0 comments on commit c9360a7

Please sign in to comment.