Skip to content

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
maresb committed Dec 26, 2024
1 parent 2a29d6b commit c38af0f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions backend/src/hatchling/metadata/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import sys
from contextlib import suppress
from copy import deepcopy
from typing import TYPE_CHECKING, Any, Generic, cast
from functools import cached_property
from typing import TYPE_CHECKING, Any, Generic, cast

from hatchling.metadata.utils import (
format_dependency,
Expand Down Expand Up @@ -100,7 +100,7 @@ def core_raw_metadata(self) -> dict[str, Any]:
@cached_property
def dynamic(self) -> list[str]:
# Here we maintain a copy of the dynamic fields from `self.core raw metadata`.
# This property should never be mutated. In contrast, the fields in
# This property should never be mutated. In contrast, the fields in
# `self.core.dynamic` are depopulated on the first evaulation of `self.core`
# or `self.version` as the actual values are computed.
dynamic = self.core_raw_metadata.get('dynamic', [])
Expand Down Expand Up @@ -391,7 +391,7 @@ def name(self) -> str:
return normalize_project_name(self.raw_name)

@cached_property
def version(self) -> str:
def version(self) -> str | None:
"""
https://peps.python.org/pep-0621/#version
"""
Expand All @@ -404,6 +404,8 @@ def version(self) -> str:
'if `version` is in field `project.dynamic`'
)
raise ValueError(message)
else:
return None
else:
if 'version' in self.dynamic:
message = (
Expand Down Expand Up @@ -901,6 +903,7 @@ def classifiers(self) -> list[str]:
verify_classifiers = not os.environ.get('HATCH_METADATA_CLASSIFIERS_NO_VERIFY')
if verify_classifiers:
import bisect

import trove_classifiers

known_classifiers = trove_classifiers.classifiers | self._extra_classifiers
Expand Down

0 comments on commit c38af0f

Please sign in to comment.