Skip to content

Commit

Permalink
feat: make typer an optional dep in group cli
Browse files Browse the repository at this point in the history
  • Loading branch information
kod-kristoff committed Nov 22, 2024
1 parent d678472 commit 7b0d337
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ dev: install-dev

# setup development environment
install-dev:
uv sync --all-packages --dev
uv sync --all-packages --all-extras --dev

# setup production environment
install:
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ classifiers = [
# "Programming Language :: Python :: Implementation :: Stackless",
"Topic :: Utilities",
]
dependencies = [
"fastjsonschema>=2.19.1",
"typer>=0.12.3",
"json-arrays>=0.14.1",
]
dependencies = ["fastjsonschema>=2.19.1", "json-arrays>=0.14.1"]

[project.optional-dependencies]
cli = ["typer>=0.13.1"]

[project.urls]
"Bug Tracker" = "https://github.com/spraakbanken/python-json-tools/issues"
Expand All @@ -41,6 +40,7 @@ Homepage = "https://github.com/spraakbanken/python-json-tools"
[project.scripts]
jt = "sb_json_tools.cli:cli"


[dependency-groups]
dev = [
"pytest>=8.2.1",
Expand Down
9 changes: 6 additions & 3 deletions sb_json_tools/cli.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import sys
import json
import sys

import typer
try:
import typer
except ImportError:
raise RuntimeError("Please install with the 'cli' extra, 'pip install sb-json-tools[cli]'")

import json_arrays
from sb_json_tools import jt_val

from sb_json_tools import jt_val

__version__ = "0.10.2"

Expand Down
6 changes: 6 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7b0d337

Please sign in to comment.