99import urllib .parse
1010import urllib .request
1111from collections import OrderedDict
12+ from typing import Any
1213
1314import toml
1415
1516
16- def get_pypi_source (name : str , version : str , hashes : list ) -> tuple :
17+ def get_pypi_source (
18+ name : str , version : str , hashes : list [str ]
19+ ) -> tuple [str , str ] | None :
1720 """Get the source information for a dependency.
1821
1922 Args:
@@ -65,7 +68,9 @@ def get_pypi_source(name: str, version: str, hashes: list) -> tuple:
6568 return matched
6669
6770
68- def get_module_sources (parsed_lockfile : dict , include_devel : bool = True ) -> list :
71+ def get_module_sources (
72+ parsed_lockfile : dict [str , Any ], include_devel : bool = True
73+ ) -> list [dict [str , str ]]:
6974 """Gets the list of sources from a toml parsed lockfile.
7075
7176 Args:
@@ -128,7 +133,9 @@ def get_module_sources(parsed_lockfile: dict, include_devel: bool = True) -> lis
128133 return sources
129134
130135
131- def get_dep_names (parsed_lockfile : dict , include_devel : bool = True ) -> list :
136+ def get_dep_names (
137+ parsed_lockfile : dict [str , Any ], include_devel : bool = True
138+ ) -> list [str ]:
132139 """Gets the list of dependency names.
133140
134141 Args:
@@ -156,7 +163,7 @@ def get_dep_names(parsed_lockfile: dict, include_devel: bool = True) -> list:
156163 return dep_names
157164
158165
159- def main ():
166+ def main () -> None :
160167 parser = argparse .ArgumentParser (description = "Flatpak Poetry generator" )
161168 parser .add_argument ("lockfile" , type = str )
162169 parser .add_argument (
@@ -182,7 +189,7 @@ def main():
182189 "--prefix=${FLATPAK_DEST}" ,
183190 " " .join (dep_names ),
184191 ]
185- main_module = OrderedDict (
192+ main_module : dict [ str , Any ] = OrderedDict (
186193 [
187194 ("name" , "poetry-deps" ),
188195 ("buildsystem" , "simple" ),
0 commit comments