MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / get_os

Function get_os

fastdeploy/collect_env.py:439–467  ·  view source on GitHub ↗
(run_lambda)

Source from the content-addressed store, hash-verified

437
438
439def get_os(run_lambda):
440 from platform import machine
441
442 platform = get_platform()
443
444 if platform == "win32" or platform == "cygwin":
445 return get_windows_version(run_lambda)
446
447 if platform == "darwin":
448 version = get_mac_version(run_lambda)
449 if version is None:
450 return None
451 return "macOS {} ({})".format(version, machine())
452
453 if platform == "linux":
454 # Ubuntu/Debian based
455 desc = get_lsb_version(run_lambda)
456 if desc is not None:
457 return "{} ({})".format(desc, machine())
458
459 # Try reading /etc/*-release
460 desc = check_release_file(run_lambda)
461 if desc is not None:
462 return "{} ({})".format(desc, machine())
463
464 return "{} ({})".format(platform, machine())
465
466 # Unknown platform
467 return platform
468
469
470def get_python_platform():

Callers 1

get_env_infoFunction · 0.85

Calls 6

get_platformFunction · 0.85
get_windows_versionFunction · 0.85
get_mac_versionFunction · 0.85
get_lsb_versionFunction · 0.85
check_release_fileFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected