From f85c173079b44c41772fcdcc9e2d4e4367ed93c3 Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+SamuelMarks@users.noreply.github.com> Date: Sat, 7 Oct 2023 12:07:26 -0400 Subject: [PATCH] [cdd/tests/mocks/fastapi_routes.py] Add missing `type_params=[]` for Python 3.12 support ; [cdd/shared/pkg_utils.py] Increase doc coverage; [cdd/shared/pure_utils.py] Export `PY_GTE_3_12` for star import --- cdd/shared/pkg_utils.py | 5 ++++- cdd/shared/pure_utils.py | 1 + cdd/tests/mocks/fastapi_routes.py | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cdd/shared/pkg_utils.py b/cdd/shared/pkg_utils.py index 5a3638ce..99a22505 100644 --- a/cdd/shared/pkg_utils.py +++ b/cdd/shared/pkg_utils.py @@ -14,6 +14,9 @@ from sysconfig import get_python_version def is_virtual_environment(): + """ + Whether one is in a virtual environment + """ return sys.base_prefix != sys.prefix or hasattr(sys, "real_prefix") def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): @@ -63,7 +66,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): else: class DistutilsPlatformError(Exception): - pass + """DistutilsPlatformError""" raise DistutilsPlatformError( "I don't know where Python installs its library " diff --git a/cdd/shared/pure_utils.py b/cdd/shared/pure_utils.py index 7ff8ba9c..9ab565d3 100644 --- a/cdd/shared/pure_utils.py +++ b/cdd/shared/pure_utils.py @@ -1216,6 +1216,7 @@ def namespaced_upper_camelcase_to_pascal(s, sep="__"): "PY3_8", "PY_GTE_3_8", "PY_GTE_3_9", + "PY_GTE_3_12", "SetEncoder", "all_dunder_for_module", "append_to_dict", diff --git a/cdd/tests/mocks/fastapi_routes.py b/cdd/tests/mocks/fastapi_routes.py index 683f7c7b..cb3b54b8 100644 --- a/cdd/tests/mocks/fastapi_routes.py +++ b/cdd/tests/mocks/fastapi_routes.py @@ -154,6 +154,7 @@ async def create_config(config: Config): ], ) ], + type_params=[], lineno=None, returns=None, **maybe_type_comment