File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
backend/src/hatchling/metadata Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -962,7 +962,7 @@ def classifiers(self) -> list[str]:
962
962
message = 'Field `project.classifiers` must be an array'
963
963
raise TypeError (message )
964
964
965
- verify_classifiers = not os .environ .get ("HATCH_NO_VERIFY_TROVE_CLASSIFIERS" )
965
+ verify_classifiers = not os .environ .get ('HATCH_METADATA_CLASSIFIERS_NO_VERIFY' )
966
966
if verify_classifiers :
967
967
import trove_classifiers
968
968
@@ -979,7 +979,11 @@ def classifiers(self) -> list[str]:
979
979
message = f'Classifier #{ i } of field `project.classifiers` must be a string'
980
980
raise TypeError (message )
981
981
982
- if not self .__classifier_is_private (classifier ) and verify_classifiers and classifier not in known_classifiers :
982
+ if (
983
+ not self .__classifier_is_private (classifier )
984
+ and verify_classifiers
985
+ and classifier not in known_classifiers
986
+ ):
983
987
message = f'Unknown classifier in field `project.classifiers`: { classifier } '
984
988
raise ValueError (message )
985
989
Original file line number Diff line number Diff line change @@ -899,14 +899,14 @@ def test_entry_not_string(self, isolation):
899
899
_ = metadata .core .classifiers
900
900
901
901
def test_entry_unknown (self , isolation , monkeypatch ):
902
- monkeypatch .delenv ("HATCH_NO_VERIFY_TROVE_CLASSIFIERS" , False )
902
+ monkeypatch .delenv ('HATCH_METADATA_CLASSIFIERS_NO_VERIFY' , False )
903
903
metadata = ProjectMetadata (str (isolation ), None , {'project' : {'classifiers' : ['foo' ]}})
904
904
905
905
with pytest .raises (ValueError , match = 'Unknown classifier in field `project.classifiers`: foo' ):
906
906
_ = metadata .core .classifiers
907
907
908
908
def test_entry_unknown_no_verify (self , isolation , monkeypatch ):
909
- monkeypatch .setenv ("HATCH_NO_VERIFY_TROVE_CLASSIFIERS" , "1" )
909
+ monkeypatch .setenv ('HATCH_METADATA_CLASSIFIERS_NO_VERIFY' , '1' )
910
910
classifiers = [
911
911
'Programming Language :: Python :: 3.11' ,
912
912
'Programming Language :: Python :: 3.11' ,
You can’t perform that action at this time.
0 commit comments