|
| 1 | +from typing import cast |
1 | 2 | from pathlib import Path |
2 | | -from typing import Optional, cast |
3 | 3 |
|
4 | 4 | import click |
5 | 5 | from noneprompt import Choice, ListPrompt, InputPrompt, ConfirmPrompt, CancelledError |
@@ -105,7 +105,7 @@ async def list_(include_unpublished: bool = False): |
105 | 105 | ) |
106 | 106 | @click.argument("name", nargs=1, required=False, default=None) |
107 | 107 | @run_async |
108 | | -async def search(name: Optional[str], include_unpublished: bool = False): |
| 108 | +async def search(name: str | None, include_unpublished: bool = False): |
109 | 109 | if name is None: |
110 | 110 | name = await InputPrompt(_("Plugin name to search:")).prompt_async( |
111 | 111 | style=CLI_DEFAULT_STYLE |
@@ -138,8 +138,8 @@ async def search(name: Optional[str], include_unpublished: bool = False): |
138 | 138 | async def install( |
139 | 139 | ctx: click.Context, |
140 | 140 | no_restrict_version: bool, |
141 | | - name: Optional[str], |
142 | | - pip_args: Optional[list[str]], |
| 141 | + name: str | None, |
| 142 | + pip_args: list[str] | None, |
143 | 143 | include_unpublished: bool = False, |
144 | 144 | ): |
145 | 145 | try: |
@@ -208,8 +208,8 @@ async def install( |
208 | 208 | @click.argument("pip_args", nargs=-1, default=None) |
209 | 209 | @run_async |
210 | 210 | async def update( |
211 | | - name: Optional[str], |
212 | | - pip_args: Optional[list[str]], |
| 211 | + name: str | None, |
| 212 | + pip_args: list[str] | None, |
213 | 213 | include_unpublished: bool = False, |
214 | 214 | ): |
215 | 215 | try: |
@@ -258,7 +258,7 @@ async def update( |
258 | 258 | @click.argument("name", nargs=1, required=False, default=None) |
259 | 259 | @click.argument("pip_args", nargs=-1, default=None) |
260 | 260 | @run_async |
261 | | -async def uninstall(name: Optional[str], pip_args: Optional[list[str]]): |
| 261 | +async def uninstall(name: str | None, pip_args: list[str] | None): |
262 | 262 | try: |
263 | 263 | plugin = await find_exact_package( |
264 | 264 | _("Plugin name to uninstall:"), |
@@ -301,10 +301,10 @@ async def uninstall(name: Optional[str], pip_args: Optional[list[str]]): |
301 | 301 | @run_async |
302 | 302 | async def create( |
303 | 303 | ctx: click.Context, |
304 | | - name: Optional[str], |
305 | | - sub_plugin: Optional[bool], |
306 | | - output_dir: Optional[str], |
307 | | - template: Optional[str], |
| 304 | + name: str | None, |
| 305 | + sub_plugin: bool | None, |
| 306 | + output_dir: str | None, |
| 307 | + template: str | None, |
308 | 308 | ): |
309 | 309 | if name is None: |
310 | 310 | try: |
|
0 commit comments