Skip to content

Commit

Permalink
feat!: make cli optional
Browse files Browse the repository at this point in the history
  • Loading branch information
afuetterer committed Aug 9, 2023
1 parent 1430bad commit 5a48609
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ packages = ["src/services_test4"]

[tool.hatch.envs.default]
dependencies = [
"services-test4[cli]",
"pytest",
"pytest-cov",
"pytest-mock",
Expand Down
8 changes: 8 additions & 0 deletions src/services_test4/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
import sys

try:
import typer # noqa: F401
except ImportError:
print("Please install 'services-test4[cli]' to use this command.")
sys.exit(0)

from services_test4.cli import app

app(prog_name="services-test4")

0 comments on commit 5a48609

Please sign in to comment.