diff --git a/pyproject.toml b/pyproject.toml index ffbc272..902968f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,15 +17,15 @@ namespaces = true # ----------------------------------------- Project Metadata ------------------------------------- # [project] -version = "0.0.0.dev6" +version = "0.0.0.dev7" name = "LicenseMan" requires-python = ">=3.10" dependencies = [ - "LoggerMan == 0.0.0.dev50", - "PyLinks == 0.0.0.dev34", - "PkgData", - "PySerials == 0.0.0.dev24", - "MDit == 0.0.0.dev21", - "ExceptionMan == 0.0.0.dev21", + "LoggerMan == 0.0.0.dev51", + "PyLinks == 0.0.0.dev35", + "PkgData == 0.0.0.dev5", + "PySerials == 0.0.0.dev25", + "MDit == 0.0.0.dev22", + "ExceptionMan == 0.0.0.dev22", "platformdirs >= 4.3, < 5", ] diff --git a/requirements.txt b/requirements.txt index 731477d..fb3ec52 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -LoggerMan == 0.0.0.dev50 -PyLinks == 0.0.0.dev34 -PkgData -PySerials == 0.0.0.dev24 -MDit == 0.0.0.dev21 -ExceptionMan == 0.0.0.dev21 +LoggerMan == 0.0.0.dev51 +PyLinks == 0.0.0.dev35 +PkgData == 0.0.0.dev5 +PySerials == 0.0.0.dev25 +MDit == 0.0.0.dev22 +ExceptionMan == 0.0.0.dev22 platformdirs >= 4.3, < 5 \ No newline at end of file diff --git a/src/licenseman/spdx/entry.py b/src/licenseman/spdx/entry.py index 5982848..7b3885b 100644 --- a/src/licenseman/spdx/entry.py +++ b/src/licenseman/spdx/entry.py @@ -391,5 +391,5 @@ def _xml_str(element: _ElementTree.Element): return _ElementTree.tostring( optional_copy, encoding='unicode', - xml_declaration=False, + xml_declaration=True, ) \ No newline at end of file diff --git a/src/licenseman/spdx/expression.py b/src/licenseman/spdx/expression.py index c949252..00e3968 100644 --- a/src/licenseman/spdx/expression.py +++ b/src/licenseman/spdx/expression.py @@ -59,7 +59,7 @@ def exception_ids(expression: str) -> tuple[list[str], list[str]]: def _get_ids(expression: str, exception: bool): list_ = _spdx._get_global_exception_list() if exception else _spdx._get_global_license_list() - ids = list_.ids + ids = sorted(list_.ids, key=len, reverse=True) # Sort by length to match longest IDs first, e.g. 'GPL-3.0-only' before 'GPL-3.0' registered = _re.findall( rf"({'|'.join(_re.escape(exception_id) for exception_id in ids)})", expression