@@ -84,7 +84,7 @@ class StubtestSettings:
8484 ignore_missing_stub : bool
8585 supported_platforms : list [str ] | None # None means all platforms
8686 ci_platforms : list [str ]
87- stubtest_requirements : list [str ]
87+ stubtest_dependencies : list [str ]
8888 mypy_plugins : list [str ]
8989 mypy_plugins_config : dict [str , dict [str , Any ]]
9090
@@ -109,7 +109,7 @@ def read_stubtest_settings(distribution: str) -> StubtestSettings:
109109 ignore_missing_stub : object = data .get ("ignore_missing_stub" , False )
110110 supported_platforms : object = data .get ("supported_platforms" )
111111 ci_platforms : object = data .get ("ci_platforms" , DEFAULT_STUBTEST_PLATFORMS )
112- stubtest_requirements : object = data .get ("stubtest_requirements " , [])
112+ stubtest_dependencies : object = data .get ("stubtest_dependencies " , [])
113113 mypy_plugins : object = data .get ("mypy_plugins" , [])
114114 mypy_plugins_config : object = data .get ("mypy_plugins_config" , {})
115115
@@ -123,7 +123,7 @@ def read_stubtest_settings(distribution: str) -> StubtestSettings:
123123 assert _is_list_of_strings (brew_dependencies )
124124 assert _is_list_of_strings (choco_dependencies )
125125 assert _is_list_of_strings (extras )
126- assert _is_list_of_strings (stubtest_requirements )
126+ assert _is_list_of_strings (stubtest_dependencies )
127127 assert _is_list_of_strings (mypy_plugins )
128128 assert _is_nested_dict (mypy_plugins_config )
129129
@@ -151,7 +151,7 @@ def read_stubtest_settings(distribution: str) -> StubtestSettings:
151151 ignore_missing_stub = ignore_missing_stub ,
152152 supported_platforms = supported_platforms ,
153153 ci_platforms = ci_platforms ,
154- stubtest_requirements = stubtest_requirements ,
154+ stubtest_dependencies = stubtest_dependencies ,
155155 mypy_plugins = mypy_plugins ,
156156 mypy_plugins_config = mypy_plugins_config ,
157157 )
@@ -174,7 +174,7 @@ class StubMetadata:
174174
175175 distribution : Annotated [str , "The name of the distribution on PyPI" ]
176176 version_spec : Annotated [Specifier , "Upstream versions that the stubs are compatible with" ]
177- requires : Annotated [list [Requirement ], "The parsed requirements as listed in METADATA.toml" ]
177+ dependencies : Annotated [list [Requirement ], "The parsed dependencies as listed in METADATA.toml" ]
178178 extra_description : str | None
179179 stub_distribution : Annotated [str , "The name under which the distribution is uploaded to PyPI" ]
180180 upstream_repository : Annotated [str , "The URL of the upstream repository" ] | None
@@ -193,7 +193,7 @@ def is_obsolete(self) -> bool:
193193_KNOWN_METADATA_FIELDS : Final = frozenset (
194194 {
195195 "version" ,
196- "requires " ,
196+ "dependencies " ,
197197 "extra_description" ,
198198 "stub_distribution" ,
199199 "upstream_repository" ,
@@ -216,7 +216,7 @@ def is_obsolete(self) -> bool:
216216 "ignore_missing_stub" ,
217217 "supported_platforms" ,
218218 "ci_platforms" ,
219- "stubtest_requirements " ,
219+ "stubtest_dependencies " ,
220220 "mypy_plugins" ,
221221 "mypy_plugins_config" ,
222222 }
@@ -235,7 +235,7 @@ def read_metadata(distribution: str) -> StubMetadata:
235235 This function does some basic validation,
236236 but does no parsing, transforming or normalization of the metadata.
237237 Use `read_dependencies` if you need to parse the dependencies
238- given in the `requires ` field, for example.
238+ given in the `dependencies ` field, for example.
239239 """
240240 try :
241241 with metadata_path (distribution ).open ("rb" ) as f :
@@ -255,9 +255,9 @@ def read_metadata(distribution: str) -> StubMetadata:
255255 version_spec = Specifier (version )
256256 assert version_spec .operator in {"==" , "~=" }, f"Invalid 'version' field in METADATA.toml for { distribution !r} "
257257
258- requires_s : object = data .get ("requires " , []) # pyright: ignore[reportUnknownMemberType]
259- assert isinstance (requires_s , list )
260- requires = [parse_requires (distribution , req ) for req in requires_s ]
258+ dependencies_s : object = data .get ("dependencies " , []) # pyright: ignore[reportUnknownMemberType]
259+ assert isinstance (dependencies_s , list )
260+ dependencies = [parse_dependencies (distribution , dep ) for dep in dependencies_s ]
261261
262262 extra_description : object = data .get ("extra_description" ) # pyright: ignore[reportUnknownMemberType]
263263 assert isinstance (extra_description , (str , type (None )))
@@ -336,7 +336,7 @@ def read_metadata(distribution: str) -> StubMetadata:
336336 return StubMetadata (
337337 distribution = distribution ,
338338 version_spec = version_spec ,
339- requires = requires ,
339+ dependencies = dependencies ,
340340 extra_description = extra_description ,
341341 stub_distribution = stub_distribution ,
342342 upstream_repository = upstream_repository ,
@@ -366,7 +366,7 @@ def update_metadata(distribution: str, **new_values: object) -> tomlkit.TOMLDocu
366366 return data
367367
368368
369- def parse_requires (distribution : str , req : object ) -> Requirement :
369+ def parse_dependencies (distribution : str , req : object ) -> Requirement :
370370 assert isinstance (req , str ), f"Invalid requirement { req !r} for { distribution !r} "
371371 return Requirement (req )
372372
@@ -398,7 +398,7 @@ def read_dependencies(distribution: str) -> PackageDependencies:
398398 pypi_name_to_typeshed_name_mapping = get_pypi_name_to_typeshed_name_mapping ()
399399 typeshed : list [Requirement ] = []
400400 external : list [Requirement ] = []
401- for dependency in read_metadata (distribution ).requires :
401+ for dependency in read_metadata (distribution ).dependencies :
402402 if dependency .name in pypi_name_to_typeshed_name_mapping :
403403 req = Requirement (str (dependency )) # copy the requirement
404404 req .name = pypi_name_to_typeshed_name_mapping [dependency .name ]
0 commit comments