smheidrich/py-json-stream-rs-tokenizer

Import error when attempting benchmark

daggaz opened this issue · 1 comments

When installing from pypi, the benchmark module fails because of missing dependencies:

python -m json_stream_rs_tokenizer.benchmark
ModuleNotFoundError: No module named 'typer'

Or:

In [1]: from json_stream_rs_tokenizer.benchmark import app
ModuleNotFoundError: No module named 'contexttimer'

Perhaps output an explicit error message instructing the user to install the benchmark optional or directing them to the readme?

As an aside, the readme says to run pip install json_stream_rs_tokenizer[benchmark], but that will fail on sh-based shells (bash, zsh, etc) because []s are special. Needs to be pip install 'json-stream-rs-tokenizer[benchmark]', which will work on all platforms I can think of.

Good points, thanks! Should be fixed in 0.4.10.