@@ -309,7 +309,7 @@ def _parse_list(cls, value, separator=','):
309309
310310 :param value:
311311 :param separator: List items separator character.
312- :rtype: tuple
312+ :rtype: list
313313 """
314314 if isinstance (value , list ): # _get_parser_compound case
315315 return value
@@ -387,15 +387,16 @@ def _parse_file(self, value, root_dir: StrPath | None):
387387 include_directive = 'file:'
388388
389389 if not isinstance (value , str ):
390- return _static . convert ( value )
390+ return value
391391
392392 if not value .startswith (include_directive ):
393393 return _static .Str (value )
394394
395395 spec = value [len (include_directive ) :]
396396 filepaths = [path .strip () for path in spec .split (',' )]
397397 self ._referenced_files .update (filepaths )
398- return _static .Str (expand .read_files (filepaths , root_dir )) # Too optimistic?
398+ # XXX: Is marking as static contents coming from files too optimistic?
399+ return _static .Str (expand .read_files (filepaths , root_dir ))
399400
400401 def _parse_attr (self , value , package_dir , root_dir : StrPath ):
401402 """Represents value as a module attribute.
@@ -473,7 +474,7 @@ def parse_section(self, section_options) -> None:
473474 for name , (_ , value ) in section_options .items ():
474475 with contextlib .suppress (KeyError ):
475476 # Keep silent for a new option may appear anytime.
476- self [name ] = _static . convert ( value )
477+ self [name ] = value
477478
478479 def parse (self ) -> None :
479480 """Parses configuration file items from one
@@ -548,22 +549,28 @@ def __init__(
548549 @property
549550 def parsers (self ):
550551 """Metadata item name to parser function mapping."""
551- parse_tuple_static = self ._get_parser_compound (self ._parse_list , _static .Tuple )
552- parse_dict_static = self ._get_parser_compound (self ._parse_dict , _static .Mapping )
552+ parse_list_static = self ._get_parser_compound (self ._parse_list , _static .List )
553+ parse_dict_static = self ._get_parser_compound (self ._parse_dict , _static .Dict )
553554 parse_file = partial (self ._parse_file , root_dir = self .root_dir )
554555 exclude_files_parser = self ._exclude_files_parser
555556
556557 return {
557- 'platforms' : parse_tuple_static ,
558- 'keywords' : parse_tuple_static ,
559- 'provides' : parse_tuple_static ,
560- 'obsoletes' : parse_tuple_static ,
561- 'classifiers' : self ._get_parser_compound (parse_file , parse_tuple_static ),
558+ 'author' : _static .Str ,
559+ 'author_email' : _static .Str ,
560+ 'maintainer' : _static .Str ,
561+ 'maintainer_email' : _static .Str ,
562+ 'platforms' : parse_list_static ,
563+ 'keywords' : parse_list_static ,
564+ 'provides' : parse_list_static ,
565+ 'obsoletes' : parse_list_static ,
566+ 'classifiers' : self ._get_parser_compound (parse_file , parse_list_static ),
562567 'license' : exclude_files_parser ('license' ),
563- 'license_files' : parse_tuple_static ,
568+ 'license_files' : parse_list_static ,
564569 'description' : parse_file ,
565570 'long_description' : parse_file ,
566- 'version' : self ._parse_version ,
571+ 'long_description_content_type' : _static .Str ,
572+ 'version' : self ._parse_version , # Cannot be marked as dynamic
573+ 'url' : _static .Str ,
567574 'project_urls' : parse_dict_static ,
568575 }
569576
@@ -620,7 +627,8 @@ def _parse_requirements_list(self, label: str, value: str):
620627 _warn_accidental_env_marker_misconfig (label , value , parsed )
621628 # Filter it to only include lines that are not comments. `parse_list`
622629 # will have stripped each line and filtered out empties.
623- return _static .Tuple (line for line in parsed if not line .startswith ("#" ))
630+ return _static .List (line for line in parsed if not line .startswith ("#" ))
631+ # ^-- Use `_static.List` to mark a non-`Dynamic` Core Metadata
624632
625633 @property
626634 def parsers (self ):
@@ -642,14 +650,14 @@ def parsers(self):
642650 "consider using implicit namespaces instead (PEP 420)." ,
643651 # TODO: define due date, see setuptools.dist:check_nsp.
644652 ),
645- 'install_requires' : partial (
653+ 'install_requires' : partial ( # Core Metadata
646654 self ._parse_requirements_list , "install_requires"
647655 ),
648656 'setup_requires' : self ._parse_list_semicolon ,
649657 'packages' : self ._parse_packages ,
650658 'entry_points' : self ._parse_file_in_root ,
651659 'py_modules' : parse_list ,
652- 'python_requires' : _static .SpeficierSet ,
660+ 'python_requires' : _static .SpeficierSet , # Core Metadata
653661 'cmdclass' : parse_cmdclass ,
654662 }
655663
@@ -726,7 +734,7 @@ def parse_section_exclude_package_data(self, section_options) -> None:
726734 """
727735 self ['exclude_package_data' ] = self ._parse_package_data (section_options )
728736
729- def parse_section_extras_require (self , section_options ) -> None :
737+ def parse_section_extras_require (self , section_options ) -> None : # Core Metadata
730738 """Parses `extras_require` configuration file section.
731739
732740 :param dict section_options:
@@ -736,7 +744,8 @@ def parse_section_extras_require(self, section_options) -> None:
736744 lambda k , v : self ._parse_requirements_list (f"extras_require[{ k } ]" , v ),
737745 )
738746
739- self ['extras_require' ] = _static .Mapping (parsed )
747+ self ['extras_require' ] = _static .Dict (parsed )
748+ # ^-- Use `_static.Dict` to mark a non-`Dynamic` Core Metadata
740749
741750 def parse_section_data_files (self , section_options ) -> None :
742751 """Parses `data_files` configuration file section.
0 commit comments