Skip to content

Commit 4ad5a45

Browse files
authored
Merge pull request #975 from planetlabs/click-typing-update
Ignore type errors involving click decorators
2 parents a3b27c1 + a623948 commit 4ad5a45

File tree

6 files changed

+43
-42
lines changed

6 files changed

+43
-42
lines changed

planet/cli/auth.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
LOGGER = logging.getLogger(__name__)
2525

2626

27-
@click.group()
27+
@click.group() # type: ignore
2828
@click.pass_context
2929
@click.option('-u',
3030
'--base-url',
@@ -35,7 +35,7 @@ def auth(ctx, base_url):
3535
ctx.obj['BASE_URL'] = base_url
3636

3737

38-
@auth.command()
38+
@auth.command() # type: ignore
3939
@click.pass_context
4040
@translate_exceptions
4141
@click.option(
@@ -58,14 +58,14 @@ def init(ctx, email, password):
5858
click.echo(f'export {ENV_API_KEY}=$(planet auth value)')
5959

6060

61-
@auth.command()
61+
@auth.command() # type: ignore
6262
@translate_exceptions
6363
def value():
6464
"""Print the stored authentication information"""
6565
click.echo(planet.Auth.from_file().value)
6666

6767

68-
@auth.command()
68+
@auth.command() # type: ignore
6969
@translate_exceptions
7070
@click.argument('key')
7171
def store(key):

planet/cli/cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
LOGGER = logging.getLogger(__name__)
2626

2727

28-
@click.group()
28+
@click.group() # type: ignore
2929
@click.pass_context
3030
@click.option('--quiet',
3131
is_flag=True,
@@ -73,8 +73,8 @@ def _configure_logging(verbosity):
7373
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
7474

7575

76-
main.add_command(auth.auth)
77-
main.add_command(data.data)
78-
main.add_command(orders.orders)
79-
main.add_command(subscriptions.subscriptions)
80-
main.add_command(collect.collect)
76+
main.add_command(auth.auth) # type: ignore
77+
main.add_command(data.data) # type: ignore
78+
main.add_command(orders.orders) # type: ignore
79+
main.add_command(subscriptions.subscriptions) # type: ignore
80+
main.add_command(collect.collect) # type: ignore

planet/cli/data.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async def data_client(ctx):
4949
yield cl
5050

5151

52-
@click.group()
52+
@click.group() # type: ignore
5353
@click.pass_context
5454
@click.option('-u',
5555
'--base-url',
@@ -149,7 +149,7 @@ def _func(obj):
149149
return [_func(v) for v in values] if values else None
150150

151151

152-
@data.command()
152+
@data.command() # type: ignore
153153
@click.pass_context
154154
@translate_exceptions
155155
@click.option('--asset',
@@ -274,7 +274,7 @@ def filter(ctx,
274274
echo_json(filt, pretty)
275275

276276

277-
@data.command(epilog=valid_item_string)
277+
@data.command(epilog=valid_item_string) # type: ignore
278278
@click.pass_context
279279
@translate_exceptions
280280
@coro
@@ -318,7 +318,7 @@ async def search(ctx, item_types, filter, limit, name, sort, pretty):
318318
echo_json(item, pretty)
319319

320320

321-
@data.command(epilog=valid_item_string)
321+
@data.command(epilog=valid_item_string) # type: ignore
322322
@click.pass_context
323323
@translate_exceptions
324324
@coro
@@ -355,7 +355,7 @@ async def search_create(ctx, item_types, filter, name, daily_email, pretty):
355355
echo_json(items, pretty)
356356

357357

358-
@data.command()
358+
@data.command() # type: ignore
359359
@click.pass_context
360360
@translate_exceptions
361361
@coro
@@ -384,7 +384,7 @@ async def search_list(ctx, sort, search_type, limit, pretty):
384384
echo_json(item, pretty)
385385

386386

387-
@data.command()
387+
@data.command() # type: ignore
388388
@click.pass_context
389389
@translate_exceptions
390390
@coro
@@ -407,7 +407,7 @@ async def search_run(ctx, search_id, sort, limit, pretty):
407407
echo_json(item, pretty)
408408

409409

410-
@data.command(epilog=valid_item_string)
410+
@data.command(epilog=valid_item_string) # type: ignore
411411
@click.pass_context
412412
@translate_exceptions
413413
@coro
@@ -438,7 +438,7 @@ async def stats(ctx, item_types, filter, interval):
438438
echo_json(items)
439439

440440

441-
@data.command()
441+
@data.command() # type: ignore
442442
@click.pass_context
443443
@translate_exceptions
444444
@coro
@@ -455,7 +455,7 @@ async def search_get(ctx, search_id, pretty):
455455
echo_json(items, pretty)
456456

457457

458-
@data.command()
458+
@data.command() # type: ignore
459459
@click.pass_context
460460
@translate_exceptions
461461
@coro
@@ -467,7 +467,7 @@ async def search_delete(ctx, search_id):
467467
await cl.delete_search(search_id)
468468

469469

470-
@data.command(epilog=valid_item_string)
470+
@data.command(epilog=valid_item_string) # type: ignore
471471
@click.pass_context
472472
@translate_exceptions
473473
@coro
@@ -510,7 +510,7 @@ async def search_update(ctx,
510510
echo_json(items, pretty)
511511

512512

513-
@data.command(epilog=valid_item_string)
513+
@data.command(epilog=valid_item_string) # type: ignore
514514
@click.pass_context
515515
@translate_exceptions
516516
@coro
@@ -572,7 +572,7 @@ async def asset_download(ctx,
572572
cl.validate_checksum(asset, path)
573573

574574

575-
@data.command(epilog=valid_item_string)
575+
@data.command(epilog=valid_item_string) # type: ignore
576576
@click.pass_context
577577
@translate_exceptions
578578
@coro
@@ -586,7 +586,7 @@ async def asset_activate(ctx, item_type, item_id, asset_type):
586586
await cl.activate_asset(asset)
587587

588588

589-
@data.command(epilog=valid_item_string)
589+
@data.command(epilog=valid_item_string) # type: ignore
590590
@click.pass_context
591591
@translate_exceptions
592592
@coro

planet/cli/options.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
default=100,
2121
show_default=True,
2222
help="""Maximum number of results to return. When set to 0, no maximum is
23-
applied.""")
23+
applied.""") # type: ignore
2424

25-
pretty = click.option('--pretty', is_flag=True, help='Format JSON output.')
25+
pretty = click.option('--pretty', is_flag=True,
26+
help='Format JSON output.') # type: ignore

planet/cli/orders.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async def orders_client(ctx):
3737
yield cl
3838

3939

40-
@click.group()
40+
@click.group() # type: ignore
4141
@click.pass_context
4242
@click.option('-u',
4343
'--base-url',
@@ -48,7 +48,7 @@ def orders(ctx, base_url):
4848
ctx.obj['BASE_URL'] = base_url
4949

5050

51-
@orders.command()
51+
@orders.command() # type: ignore
5252
@click.pass_context
5353
@translate_exceptions
5454
@coro
@@ -72,7 +72,7 @@ async def list(ctx, state, limit, pretty):
7272
echo_json(o, pretty)
7373

7474

75-
@orders.command()
75+
@orders.command() # type: ignore
7676
@click.pass_context
7777
@translate_exceptions
7878
@coro
@@ -89,7 +89,7 @@ async def get(ctx, order_id, pretty):
8989
echo_json(order, pretty)
9090

9191

92-
@orders.command()
92+
@orders.command() # type: ignore
9393
@click.pass_context
9494
@translate_exceptions
9595
@coro
@@ -106,7 +106,7 @@ async def cancel(ctx, order_id):
106106
click.echo(json_resp)
107107

108108

109-
@orders.command()
109+
@orders.command() # type: ignore
110110
@click.pass_context
111111
@translate_exceptions
112112
@coro
@@ -158,7 +158,7 @@ async def wait(ctx, order_id, delay, max_attempts, state):
158158
click.echo(state)
159159

160160

161-
@orders.command()
161+
@orders.command() # type: ignore
162162
@click.pass_context
163163
@translate_exceptions
164164
@coro
@@ -200,7 +200,7 @@ async def download(ctx, order_id, overwrite, directory, checksum):
200200
cl.validate_checksum(Path(directory, str(order_id)), checksum)
201201

202202

203-
@orders.command()
203+
@orders.command() # type: ignore
204204
@click.pass_context
205205
@translate_exceptions
206206
@coro
@@ -221,7 +221,7 @@ async def create(ctx, request: str, pretty):
221221
echo_json(order, pretty)
222222

223223

224-
@orders.command()
224+
@orders.command() # type: ignore
225225
@click.pass_context
226226
@translate_exceptions
227227
@coro

planet/cli/subscriptions.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async def subscriptions_client(ctx):
4646
yield cl
4747

4848

49-
@click.group()
49+
@click.group() # type: ignore
5050
@click.pass_context
5151
@click.option('-u',
5252
'--base-url',
@@ -60,7 +60,7 @@ def subscriptions(ctx, base_url):
6060
# We want our command to be known as "list" on the command line but
6161
# don't want to clobber Python's built-in "list". We'll define the
6262
# command function as "list_subscriptions".
63-
@subscriptions.command(name="list")
63+
@subscriptions.command(name="list") # type: ignore
6464
@pretty
6565
@click.option(
6666
'--status',
@@ -87,7 +87,7 @@ async def list_subscriptions_cmd(ctx, status, limit, pretty):
8787
echo_json(sub, pretty)
8888

8989

90-
@subscriptions.command(name='create')
90+
@subscriptions.command(name='create') # type: ignore
9191
@click.argument('request', type=types.JSON())
9292
@pretty
9393
@click.pass_context
@@ -107,7 +107,7 @@ async def create_subscription_cmd(ctx, request, pretty):
107107
echo_json(sub, pretty)
108108

109109

110-
@subscriptions.command(name='cancel')
110+
@subscriptions.command(name='cancel') # type: ignore
111111
@click.argument('subscription_id')
112112
@pretty
113113
@click.pass_context
@@ -119,7 +119,7 @@ async def cancel_subscription_cmd(ctx, subscription_id, pretty):
119119
_ = await client.cancel_subscription(subscription_id)
120120

121121

122-
@subscriptions.command(name='update')
122+
@subscriptions.command(name='update') # type: ignore
123123
@click.argument('subscription_id')
124124
@click.argument('request', type=types.JSON())
125125
@pretty
@@ -140,7 +140,7 @@ async def update_subscription_cmd(ctx, subscription_id, request, pretty):
140140
echo_json(sub, pretty)
141141

142142

143-
@subscriptions.command(name='get')
143+
@subscriptions.command(name='get') # type: ignore
144144
@click.argument('subscription_id')
145145
@pretty
146146
@click.pass_context
@@ -153,7 +153,7 @@ async def get_subscription_cmd(ctx, subscription_id, pretty):
153153
echo_json(sub, pretty)
154154

155155

156-
@subscriptions.command(name='results')
156+
@subscriptions.command(name='results') # type: ignore
157157
@click.argument('subscription_id')
158158
@pretty
159159
@click.option(
@@ -187,7 +187,7 @@ async def list_subscription_results_cmd(ctx,
187187
echo_json(result, pretty)
188188

189189

190-
@subscriptions.command()
190+
@subscriptions.command() # type: ignore
191191
@translate_exceptions
192192
@click.option('--name',
193193
required=True,
@@ -220,7 +220,7 @@ def request(name, source, delivery, notifications, tools, pretty):
220220
echo_json(res, pretty)
221221

222222

223-
@subscriptions.command(epilog=valid_item_string)
223+
@subscriptions.command(epilog=valid_item_string) # type: ignore
224224
@translate_exceptions
225225
@click.option('--item-types',
226226
required=True,

0 commit comments

Comments
 (0)