Handle better the current horrible output and provide user-friendly message.
This happens when package with that name doesn't exist on PyPI (possibly misspelled?)
$ pyp2spec python-click
Generating configuration file
Assuming 'python-click' is a package name
Traceback (most recent call last):
File "/home/ksurma/tmp/ppy/venv/bin/pyp2spec", line 8, in <module>
sys.exit(main())
File "/home/ksurma/tmp/ppy/venv/lib64/python3.10/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/home/ksurma/tmp/ppy/venv/lib64/python3.10/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/ksurma/tmp/ppy/venv/lib64/python3.10/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/ksurma/tmp/ppy/venv/lib64/python3.10/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/ksurma/tmp/ppy/venv/lib64/python3.10/site-packages/pyp2spec/pyp2spec.py", line 54, in main
config_file = create_config(options)
File "/home/ksurma/tmp/ppy/venv/lib64/python3.10/site-packages/pyp2spec/pyp2conf.py", line 234, in create_config
contents = create_config_contents(
File "/home/ksurma/tmp/ppy/venv/lib64/python3.10/site-packages/pyp2spec/pyp2conf.py", line 168, in create_config_contents
pkg = PypiPackage(package, session)
File "/home/ksurma/tmp/ppy/venv/lib64/python3.10/site-packages/pyp2spec/pyp2conf.py", line 16, in __init__
self.package_data = self.get_package_metadata(session)
File "/home/ksurma/tmp/ppy/venv/lib64/python3.10/site-packages/pyp2spec/pyp2conf.py", line 26, in get_package_metadata
return response.json()
File "/home/ksurma/tmp/ppy/venv/lib64/python3.10/site-packages/requests/models.py", line 910, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib64/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 7 column 1 (char 6)
Handle better the current horrible output and provide user-friendly message. This happens when package with that name doesn't exist on PyPI (possibly misspelled?)