-
Notifications
You must be signed in to change notification settings - Fork 2
Fix CI dependency drift #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8be1562
707f5fb
f7d9c0c
1abc7a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,5 +5,5 @@ __pycache__/ | |
| dist/ | ||
| build/ | ||
| .eggs/ | ||
| uv.lock | ||
| *.spec | ||
| .idea | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,10 @@ | |
|
|
||
| import difflib | ||
|
|
||
| import click | ||
| import typer | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reliance on private typer internals: The code imports |
||
|
|
||
| # typer >= 0.26 vendors click; TyperGroup raises the vendored UsageError. | ||
| from typer._click.exceptions import UsageError | ||
| from typer.core import TyperGroup | ||
|
|
||
| LOGO = r""" | ||
|
|
@@ -25,20 +28,20 @@ class HelpfulGroup(TyperGroup): | |
|
|
||
| def format_help(self, ctx, formatter): | ||
| if ctx.parent is None: | ||
| click.echo(LOGO) | ||
| typer.echo(LOGO) | ||
| super().format_help(ctx, formatter) | ||
|
|
||
| def resolve_command(self, ctx, args): | ||
| try: | ||
| return super().resolve_command(ctx, args) | ||
| except click.UsageError: | ||
| except UsageError: | ||
| cmd_name = args[0] if args else None | ||
| if cmd_name: | ||
| matches = difflib.get_close_matches(cmd_name, self.list_commands(ctx), n=3, cutoff=0.4) | ||
| if matches: | ||
| hint = ", ".join(f"'{m}'" for m in matches) | ||
| click.echo(f"Unknown command '{cmd_name}'. Did you mean: {hint}?\n", err=True) | ||
| typer.echo(f"Unknown command '{cmd_name}'. Did you mean: {hint}?\n", err=True) | ||
| else: | ||
| click.echo(f"Unknown command '{cmd_name}'.\n", err=True) | ||
| click.echo(ctx.get_help()) | ||
| typer.echo(f"Unknown command '{cmd_name}'.\n", err=True) | ||
| typer.echo(ctx.get_help()) | ||
| ctx.exit(2) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,7 +72,7 @@ def _build_filter_params( | |
| return params | ||
|
|
||
|
|
||
| def _do_list(client, path: str, resource: str, limit: int, offset: int, all_pages: bool, output: str, **filters): | ||
| def _do_list(client, path: str, resource: str, *, limit: int, offset: int, all_pages: bool, output: str, **filters): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keyword-only argument enforcement breaks callers: Added |
||
| """Shared list logic for all resources.""" | ||
| params = _build_filter_params(**filters) | ||
| if all_pages: | ||
|
|
@@ -120,6 +120,7 @@ def make_resource_app( | |
| name: str, | ||
| resource: str, | ||
| path: str, | ||
| *, | ||
| has_create: bool = True, | ||
| has_update: bool = True, | ||
| has_delete: bool = False, | ||
|
|
@@ -138,6 +139,7 @@ def make_resource_app( | |
|
|
||
| @app.command("list") | ||
| def list_cmd( | ||
| *, | ||
| limit: int = Limit, | ||
| offset: int = Offset, | ||
| all_pages: bool = AllPages, | ||
|
|
@@ -157,10 +159,10 @@ def list_cmd( | |
| client, | ||
| path, | ||
| resource, | ||
| limit, | ||
| offset, | ||
| all_pages, | ||
| output, | ||
| limit=limit, | ||
| offset=offset, | ||
| all_pages=all_pages, | ||
| output=output, | ||
| search=search, | ||
| status=status, | ||
| start_date=start_date, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,6 +101,7 @@ def _transaction_list( | |
| title: str, | ||
| counterparty_label: str, | ||
| counterparty_field: str, | ||
| *, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keyword-only arguments added to internal helpers: |
||
| show_due_date: bool = False, | ||
| show_paid: bool = False, | ||
| show_remaining: bool = False, | ||
|
|
@@ -162,6 +163,7 @@ def _transaction_detail( | |
| record_type: str, | ||
| counterparty_label: str, | ||
| counterparty_field: str, | ||
| *, | ||
| due_color: str = "green", | ||
| resource: str = "", | ||
| ): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change — typer floor version raised to 0.26: The constraint changed from
typer>=0.12,<1.0totyper>=0.26,<1.0. Typer 0.26 vendored click intotyper._clickand removed click as a transitive dependency. Any code importingclickdirectly will fail at runtime on typer >=0.26 because click is no longer installed. The codebase itself was updated (cli.py now imports fromtyper._click.exceptions), but grep the full codebase for any other imports ofclickin production code, tests, or management commands. If any exist, they will break on deploy.