Skip to content

Commit

Permalink
Slightly simplify CLI version logic
Browse files Browse the repository at this point in the history
  • Loading branch information
maresb committed Dec 27, 2024
1 parent 82131f2 commit c6838bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/hatchling/cli/version/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ def version_impl(
plugin_manager = PluginManager()
metadata = ProjectMetadata(root, plugin_manager)

if 'version' in metadata.config.get('project', {}):
static_version = metadata.core.version
if static_version is not None:
if desired_version:
app.abort('Cannot set version when it is statically defined by the `project.version` field')
else:
static_version = cast(str, metadata.core.version)
app.display(static_version)
return

Expand Down

0 comments on commit c6838bc

Please sign in to comment.