There was an error while loading. Please reload this page.
1 parent 82131f2 commit 4f121faCopy full SHA for 4f121fa
backend/src/hatchling/cli/version/__init__.py
@@ -1,7 +1,7 @@
1
from __future__ import annotations
2
3
import argparse
4
-from typing import Any, cast
+from typing import Any
5
6
7
def version_impl(
@@ -21,11 +21,11 @@ def version_impl(
21
plugin_manager = PluginManager()
22
metadata = ProjectMetadata(root, plugin_manager)
23
24
- if 'version' in metadata.config.get('project', {}):
+ static_version = metadata.core.version
25
+ if static_version is not None:
26
if desired_version:
27
app.abort('Cannot set version when it is statically defined by the `project.version` field')
28
else:
- static_version = cast(str, metadata.core.version)
29
app.display(static_version)
30
return
31
0 commit comments