]> Nutra Git (v2) - gamesguru/getmyancestors.git/commitdiff
wip mypy
authorShane <30691680+gamesguru@users.noreply.github.com>
Tue, 9 Sep 2025 17:58:31 +0000 (13:58 -0400)
committerShane <30691680+gamesguru@users.noreply.github.com>
Tue, 9 Sep 2025 17:58:31 +0000 (13:58 -0400)
.requirements-lint.txt
getmyancestors/classes/constants.py
getmyancestors/getmyancestors.py
setup.cfg

index 7a118799241b3d233f3d7d25e76caf9ebf6836a4..5bf45707360ef2fa8c8f9ed9e30ed021a1473312 100644 (file)
@@ -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
+
index a5088f445c98f8cb6eecb88f2452f758989bb803..cc0286628191e802d7eae471cd331d078d171608 100644 (file)
@@ -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()}
 
 
index 6b535fb541a9f8fde7e9cb00081234894fab20a0..640d6eeb256e2f7a73a793d052a3dae80dd64160 100644 (file)
@@ -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 != "<stdout>":
 
-        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()
index b2604c12355cc4314e78531865accb8670351ae3..05ee34d7628d33e32f7410578ddd285b1e31ecd3 100644 (file)
--- 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