Skip to content

Commit 427c983

Browse files
remove import guards for typer (#110)
1 parent b2b3ca5 commit 427c983

File tree

4 files changed

+7
-22
lines changed

4 files changed

+7
-22
lines changed

src/pyscript/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from pathlib import Path
44

55
import platformdirs
6+
import rich_click.typer as typer
67
from rich.console import Console
78

89
LATEST_PYSCRIPT_VERSION = "2023.05.1"
@@ -31,13 +32,6 @@
3132
except ImportError: # pragma: no cover
3233
import importlib_metadata as metadata # type: ignore
3334

34-
35-
try:
36-
import rich_click.typer as typer
37-
except ImportError: # pragma: no cover
38-
import typer # type: ignore
39-
40-
4135
try:
4236
__version__ = metadata.version("pyscript")
4337
except metadata.PackageNotFoundError: # pragma: no cover

src/pyscript/plugins/create.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1+
import rich_click.typer as typer
2+
13
from pyscript import LATEST_PYSCRIPT_VERSION, app, cli, plugins
24
from pyscript._generator import create_project
35

4-
try:
5-
import rich_click.typer as typer
6-
except ImportError: # pragma: no cover
7-
import typer # type: ignore
8-
96

107
@app.command()
118
def create(

src/pyscript/plugins/run.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@
77
from http.server import SimpleHTTPRequestHandler
88
from pathlib import Path
99

10-
from pyscript import app, cli, console, plugins
10+
import rich_click.typer as typer
1111

12-
try:
13-
import rich_click.typer as typer
14-
except ImportError: # pragma: no cover
15-
import typer # type: ignore
12+
from pyscript import app, cli, console, plugins
1613

1714

1815
def get_folder_based_http_request_handler(

src/pyscript/plugins/wrap.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
from pathlib import Path
44
from typing import Optional
55

6+
import rich_click.typer as typer
7+
68
from pyscript import LATEST_PYSCRIPT_VERSION, app, cli, console, plugins
79
from pyscript._generator import file_to_html, string_to_html
810

9-
try:
10-
import rich_click.typer as typer
11-
except ImportError: # pragma: no cover
12-
import typer # type: ignore
13-
1411

1512
@app.command()
1613
def wrap(

0 commit comments

Comments
 (0)