Skip to content

Commit

Permalink
Merge pull request #1313 from exarkun/4045.typechecks-vs-click
Browse files Browse the repository at this point in the history
suppress the new click type checking errors

Also address an importlib_resources / towncrier incompatibility.

Fixes: ticket:4045
  • Loading branch information
exarkun committed Jul 12, 2023
2 parents f354b3a + c06e3e1 commit c6daeaf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/allmydata/cli/grid_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from allmydata.util import jsonbytes as json


@click.group()
@click.group() # type: ignore[arg-type]
@click.option(
'--config', '-c',
type=click.Path(),
Expand Down Expand Up @@ -71,7 +71,7 @@ def grid_manager(self):
ctx.obj = Config()


@grid_manager.command()
@grid_manager.command() # type: ignore[attr-defined]
@click.pass_context
def create(ctx):
"""
Expand All @@ -91,7 +91,7 @@ def create(ctx):
)


@grid_manager.command()
@grid_manager.command() # type: ignore[attr-defined]
@click.pass_obj
def public_identity(config):
"""
Expand All @@ -103,7 +103,7 @@ def public_identity(config):
click.echo(config.grid_manager.public_identity())


@grid_manager.command()
@grid_manager.command() # type: ignore[arg-type, attr-defined]
@click.argument("name")
@click.argument("public_key", type=click.STRING)
@click.pass_context
Expand Down Expand Up @@ -132,7 +132,7 @@ def add(ctx, name, public_key):
return 0


@grid_manager.command()
@grid_manager.command() # type: ignore[arg-type, attr-defined]
@click.argument("name")
@click.pass_context
def remove(ctx, name):
Expand All @@ -155,7 +155,8 @@ def remove(ctx, name):
save_grid_manager(fp, ctx.obj.grid_manager, create=False)


@grid_manager.command() # noqa: F811
@grid_manager.command() # type: ignore[attr-defined]
# noqa: F811
@click.pass_context
def list(ctx):
"""
Expand All @@ -175,7 +176,7 @@ def list(ctx):
click.echo("expired {} ({})".format(cert.expires, abbreviate_time(delta)))


@grid_manager.command()
@grid_manager.command() # type: ignore[arg-type, attr-defined]
@click.argument("name")
@click.argument(
"expiry_days",
Expand Down
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ deps =
# Pin a specific version so we get consistent outcomes; update this
# occasionally:
ruff == 0.0.263
# towncrier doesn't work with importlib_resources 6.0.0
# https://github.com/twisted/towncrier/issues/528
importlib_resources < 6.0.0
towncrier
# On macOS, git inside of towncrier needs $HOME.
passenv = HOME
Expand Down

0 comments on commit c6daeaf

Please sign in to comment.