Skip to content

Commit ca976f0

Browse files
committed
🐛 Fix the python error appearing from python > 3.11
1 parent 4213c0f commit ca976f0

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

continuous_delivery_scripts/spdx_report/spdx_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
logger = logging.getLogger(__name__)
3434

3535
# Copyright similar to the regex defined in flake8-copyright
36-
COPYRIGHT_PATTERN = r"(?i)Copyright.*$"
37-
COPYRIGHT_REGEX_PATTERN = re.compile(COPYRIGHT_PATTERN, re.MULTILINE)
36+
COPYRIGHT_PATTERN = r"Copyright.*$"
37+
COPYRIGHT_REGEX_PATTERN = re.compile(COPYRIGHT_PATTERN, flags=re.MULTILINE | re.IGNORECASE)
3838
# Specification of the identifier based on https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b
3939
# and https://spdx.org/ids-how
4040
SPDX_LICENCE_IDENTIFIER_PATTERN = r"SPDX-License-Identifier: ([\.\w+\-\(\)\s]+)[\*]?$"

continuous_delivery_scripts/spdx_report/spdx_summary.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ def _generate_template_arguments(self) -> Dict[str, Any]:
6363
"name": self.project.name,
6464
"compliance": global_compliance,
6565
"compliance_details": (
66-
f"Project [{self.project.name}]'s licence is compliant: {self.project.licence}."
67-
"All its dependencies are also compliant licence-wise."
68-
)
69-
if global_compliance
70-
else f"Project [{self.project.name}] or one, at least, of its dependencies has a non compliant licence",
66+
(
67+
f"Project [{self.project.name}]'s licence is compliant: {self.project.licence}."
68+
"All its dependencies are also compliant licence-wise."
69+
)
70+
if global_compliance
71+
else f"Project [{self.project.name}] or one, at least, of its dependencies has a non compliant licence"
72+
),
7173
}
7274
arguments["packages"] = description_list
7375
arguments["render_time"] = datetime.datetime.now()
@@ -105,12 +107,14 @@ def _generate_description_for_one_package(
105107
"licence": p.licence,
106108
"is_compliant": is_compliant,
107109
"mark_as_problematic": not is_licence_compliant,
108-
"licence_compliance_details": "Licence is compliant."
109-
if is_licence_compliant
110-
else (
111-
f"Package's licence manually checked: {manual_check_details}"
112-
if package_manually_checked
113-
else "Licence is not compliant according to project's configuration."
110+
"licence_compliance_details": (
111+
"Licence is compliant."
112+
if is_licence_compliant
113+
else (
114+
f"Package's licence manually checked: {manual_check_details}"
115+
if package_manually_checked
116+
else "Licence is not compliant according to project's configuration."
117+
)
114118
),
115119
}
116120

news/20250109163919.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:bug: Fix the python error appearing from python > 3.11

0 commit comments

Comments
 (0)