Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

20 lines
443 B

# Copyright (c) 2025 The Linux Foundation
#
# SPDX-License-Identifier: Apache-2.0
from packaging.version import Version
SPDX_VERSION_2_2 = Version("2.2")
SPDX_VERSION_2_3 = Version("2.3")
SUPPORTED_SPDX_VERSIONS = [
SPDX_VERSION_2_2,
SPDX_VERSION_2_3,
]
def parse(version_str):
v = Version(version_str)
if v not in SUPPORTED_SPDX_VERSIONS:
raise ValueError(f"Unsupported SPDX version: {version_str}")
return v