INNER CODE UNIT · Python

_get_latest_version

alexal1/Insomniac · insomniac/__init__.py:54

def _get_latest_version(package):
    latest_version = None
    code, body, _ = network.get(f"https://pypi.python.org/pypi/{package}/json")
    if code == HTTP_OK and body is not None:
        json_package = json.loads(body)
        latest_version = json_package['info']['version']
    return latest_version


def get_arg_value(arg_name, conf_path):
    arg_from_cli = get_arg_value_from_cli(arg_name)

    if arg_from_cli is not None:
        return arg_from_cli

    return get_arg_value_from_config_file(arg_name, conf_path)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…