4
4
import sys
5
5
from contextlib import suppress
6
6
from copy import deepcopy
7
- from typing import TYPE_CHECKING , Any , Generic , cast
8
7
from functools import cached_property
8
+ from typing import TYPE_CHECKING , Any , Generic , cast
9
9
10
10
from hatchling .metadata .utils import (
11
11
format_dependency ,
@@ -100,7 +100,7 @@ def core_raw_metadata(self) -> dict[str, Any]:
100
100
@cached_property
101
101
def dynamic (self ) -> list [str ]:
102
102
# Here we maintain a copy of the dynamic fields from `self.core raw metadata`.
103
- # This property should never be mutated. In contrast, the fields in
103
+ # This property should never be mutated. In contrast, the fields in
104
104
# `self.core.dynamic` are depopulated on the first evaulation of `self.core`
105
105
# or `self.version` as the actual values are computed.
106
106
dynamic = self .core_raw_metadata .get ('dynamic' , [])
@@ -391,7 +391,7 @@ def name(self) -> str:
391
391
return normalize_project_name (self .raw_name )
392
392
393
393
@cached_property
394
- def version (self ) -> str :
394
+ def version (self ) -> str | None :
395
395
"""
396
396
https://peps.python.org/pep-0621/#version
397
397
"""
@@ -404,6 +404,7 @@ def version(self) -> str:
404
404
'if `version` is in field `project.dynamic`'
405
405
)
406
406
raise ValueError (message )
407
+ return None
407
408
else :
408
409
if 'version' in self .dynamic :
409
410
message = (
@@ -901,6 +902,7 @@ def classifiers(self) -> list[str]:
901
902
verify_classifiers = not os .environ .get ('HATCH_METADATA_CLASSIFIERS_NO_VERIFY' )
902
903
if verify_classifiers :
903
904
import bisect
905
+
904
906
import trove_classifiers
905
907
906
908
known_classifiers = trove_classifiers .classifiers | self ._extra_classifiers
0 commit comments