pypa/hatch

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

Open

#2.069 aberto em 2 de out. de 2025

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

Métricas do repositório

Stars
 (4.451 stars)
Métricas de merge de PR
 (Mesclagem média 41d 22h) (20 fundiu PRs em 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

Guia do colaborador