diff --git a/sdk/python/core/keeper_secrets_manager_core/core.py b/sdk/python/core/keeper_secrets_manager_core/core.py index efec20f9..fb80f3b3 100644 --- a/sdk/python/core/keeper_secrets_manager_core/core.py +++ b/sdk/python/core/keeper_secrets_manager_core/core.py @@ -17,7 +17,6 @@ import requests import sys from base64 import urlsafe_b64decode -from distutils.util import strtobool from http import HTTPStatus from typing import List, Tuple, Optional @@ -35,7 +34,7 @@ from keeper_secrets_manager_core.storage import FileKeyValueStorage, KeyValueStorage, InMemoryKeyValueStorage from keeper_secrets_manager_core.utils import base64_to_bytes, dict_to_json, \ url_safe_str_to_bytes, bytes_to_base64, generate_random_bytes, now_milliseconds, string_to_bytes, json_to_dict, \ - bytes_to_string + bytes_to_string, strtobool def find_secrets_by_title(record_title, records): diff --git a/sdk/python/core/keeper_secrets_manager_core/utils.py b/sdk/python/core/keeper_secrets_manager_core/utils.py index f96dc0be..873b0186 100644 --- a/sdk/python/core/keeper_secrets_manager_core/utils.py +++ b/sdk/python/core/keeper_secrets_manager_core/utils.py @@ -22,11 +22,10 @@ import time from json import JSONDecodeError from sys import platform as _platform -from typing import Optional, Tuple +from typing import Optional from urllib import parse import subprocess import stat -from distutils.util import strtobool from keeper_secrets_manager_core.keeper_globals import logger_name @@ -36,6 +35,22 @@ DEFAULT_PASSWORD_LENGTH = 32 +def strtobool(val): + """Convert a string representation of truth to true (1) or false (0). + + True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values + are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if + 'val' is anything else. + """ + val = val.lower() + if val in ('y', 'yes', 't', 'true', 'on', '1'): + return 1 + elif val in ('n', 'no', 'f', 'false', 'off', '0'): + return 0 + else: + raise ValueError("invalid truth value {!r}".format(val)) + + def get_os(): if _platform.lower().startswith("linux"): return "linux" diff --git a/sdk/python/core/setup.cfg b/sdk/python/core/setup.cfg index 224a7795..0f94f377 100644 --- a/sdk/python/core/setup.cfg +++ b/sdk/python/core/setup.cfg @@ -1,2 +1,2 @@ [metadata] -description-file = README.md \ No newline at end of file +description_file = README.md \ No newline at end of file diff --git a/sdk/python/core/setup.py b/sdk/python/core/setup.py index f77c050b..e9b161cb 100644 --- a/sdk/python/core/setup.py +++ b/sdk/python/core/setup.py @@ -48,6 +48,9 @@ "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Security", ], ) diff --git a/sdk/python/helper/setup.py b/sdk/python/helper/setup.py index 429b9b34..d851286c 100644 --- a/sdk/python/helper/setup.py +++ b/sdk/python/helper/setup.py @@ -47,6 +47,9 @@ "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Security", ] ) diff --git a/sdk/python/storage/setup.cfg b/sdk/python/storage/setup.cfg index 224a7795..0f94f377 100644 --- a/sdk/python/storage/setup.cfg +++ b/sdk/python/storage/setup.cfg @@ -1,2 +1,2 @@ [metadata] -description-file = README.md \ No newline at end of file +description_file = README.md \ No newline at end of file diff --git a/sdk/python/storage/setup.py b/sdk/python/storage/setup.py index 6f6e21c7..d9d795a8 100644 --- a/sdk/python/storage/setup.py +++ b/sdk/python/storage/setup.py @@ -44,6 +44,9 @@ "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Security", ] )