pypa/hatch

`hatch version` doesn't work on a `setuptools-scm` project unless `hatch-vcs` is installed

Open

#2,069 opened on Oct 2, 2025

View on GitHub
 (15 comments) (0 reactions) (0 assignees)Python (240 forks)batch import
buggood first issue

Repository metrics

Stars
 (4,451 stars)
PR merge metrics
 (Avg merge 71d 21h) (10 merged PRs in 30d)

Description

I get a traceback like this when I try:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/glyph/Library/Application Support/hatch/env/virtual/automat/rI8sZPBT/automat-build/lib/python3.13/site-packages/hatchling/__main__.py", line 6, in <module>
    sys.exit(hatchling())
             ~~~~~~~~~^^
  File "/Users/glyph/Library/Application Support/hatch/env/virtual/automat/rI8sZPBT/automat-build/lib/python3.13/site-packages/hatchling/cli/__init__.py", line 26, in hatchling
    command(**kwargs)
    ~~~~~~~^^^^^^^^^^
  File "/Users/glyph/Library/Application Support/hatch/env/virtual/automat/rI8sZPBT/automat-build/lib/python3.13/site-packages/hatchling/cli/version/__init__.py", line 31, in version_impl
    source = metadata.hatch.version.source
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/glyph/Library/Application Support/hatch/env/virtual/automat/rI8sZPBT/automat-build/lib/python3.13/site-packages/hatchling/metadata/core.py", line 1503, in source
    raise UnknownPluginError(message)
hatchling.plugin.exceptions.UnknownPluginError: Unknown version source: vcs

see this conversation https://github.com/glyph/automat/commit/643f7ce4ff0dfbe0269d57e0611b24fd5a149d93#r163303552

Contributor guide