hatch icon indicating copy to clipboard operation
hatch copied to clipboard

Running "hatchling version" should give more user friendly error message

Open tchiaspko opened this issue 1 year ago • 2 comments

Steps to reproduce

  1. python -m venv hatchling_venv
  2. source hatchling_venv/bin/activate
  3. python -m pip install hatchling
  4. hatchling version

<MB081>~ 🐍 3.9.18 pyenv:
❯ hatchling version
Traceback (most recent call last):
  File "/Users/tonychia/.pyenv/versions/3.9.18/bin/hatchling", line 8, in <module>
    sys.exit(hatchling())
  File "/Users/tonychia/.pyenv/versions/3.9.18/lib/python3.9/site-packages/hatchling/cli/__init__.py", line 26, in hatchling
    command(**kwargs)
  File "/Users/tonychia/.pyenv/versions/3.9.18/lib/python3.9/site-packages/hatchling/cli/version/__init__.py", line 31, in version_impl
    source = metadata.hatch.version.source
  File "/Users/tonychia/.pyenv/versions/3.9.18/lib/python3.9/site-packages/hatchling/metadata/core.py", line 1393, in version
    raise ValueError(message)
ValueError: Missing `tool.hatch.version` configuration

tchiaspko avatar Feb 25 '24 16:02 tchiaspko

The error means your project is misconfigured. How would you like the message to be improved? Also I'm curious, what use case do you have for using Hatchling directly rather than Hatch?

ofek avatar Feb 25 '24 17:02 ofek