From: Shane <30691680+gamesguru@users.noreply.github.com> Date: Tue, 9 Sep 2025 17:58:31 +0000 (-0400) Subject: wip mypy X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=0d43449eefbd3959a6c54cdb573c40b25efc39d5;p=gamesguru%2Fgetmyancestors.git wip mypy --- diff --git a/.requirements-lint.txt b/.requirements-lint.txt index 7a11879..5bf4570 100644 --- a/.requirements-lint.txt +++ b/.requirements-lint.txt @@ -1,5 +1,7 @@ +black==25.1.0 flake8==7.3.0 isort==6.0.1 mypy==1.17.1 pylint==3.3.8 -black==25.1.0 +types-requests==2.32.4.20250809 + diff --git a/getmyancestors/classes/constants.py b/getmyancestors/classes/constants.py index a5088f4..cc02866 100644 --- a/getmyancestors/classes/constants.py +++ b/getmyancestors/classes/constants.py @@ -46,7 +46,7 @@ ORDINANCES_STATUS = { # mergemyancestors constants and functions -def reversed_dict(d): +def reversed_dict(d: dict) -> dict: return {val: key for key, val in d.items()} diff --git a/getmyancestors/getmyancestors.py b/getmyancestors/getmyancestors.py index 6b535fb..640d6ee 100644 --- a/getmyancestors/getmyancestors.py +++ b/getmyancestors/getmyancestors.py @@ -14,7 +14,7 @@ from getmyancestors.classes.session import Session from getmyancestors.classes.tree import Tree -def main(): +def main() -> int: parser = argparse.ArgumentParser( description="Retrieve GEDCOM data from FamilySearch Tree (4 Jul 2016)", add_help=False, @@ -147,7 +147,7 @@ def main(): # Report settings used when getmyancestors is executed if args.save_settings and args.outfile.name != "": - def parse_action(act): + def parse_action(act) -> str: if not args.show_password and act.dest == "password": return "******" value = getattr(args, act.dest) @@ -173,7 +173,7 @@ def main(): # initialize a FamilySearch session and a family tree object print("Login to FamilySearch...", file=sys.stderr) - fs = Session( + fs = Session( # type: ignore args.username, args.password, args.client_id, @@ -185,7 +185,7 @@ def main(): if not fs.logged: sys.exit(2) _ = fs._ - tree = Tree(fs) + tree: Tree = Tree(fs) # type: ignore # check LDS account if args.get_ordinances: @@ -286,6 +286,8 @@ def main(): file=sys.stderr, ) + return 0 + if __name__ == "__main__": main() diff --git a/setup.cfg b/setup.cfg index b2604c1..05ee34d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -61,6 +61,7 @@ include_trailing_comma = True [mypy] show_error_codes = True +no_warn_no_return = True ;show_error_context = True ;pretty = True @@ -80,4 +81,6 @@ warn_unused_ignores = True warn_unused_configs = True warn_incomplete_stub = True -# Our tests, they don't return a value typically +# 3rd party packages missing types +[mypy-babelfish,diskcache] +ignore_missing_imports = True