Skip to content

Commit 78e1607

Browse files
authored
Merge pull request #40 from sw360/39-deleting-a-project-is-breaking-client-because-of-empty-body-in-response
39 deleting a project is breaking client because of empty body in response
2 parents 8047b05 + 75ce0df commit 78e1607

File tree

14 files changed

+482
-591
lines changed

14 files changed

+482
-591
lines changed

ChangeLog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55

66
# SW360 Base Library for Python
77

8+
## V1.8.1
9+
10+
* `delete_project` now works properly. Before it could have happened the you get a `JSONDecodeError`.
11+
All delete methods have been checked and made more resilient.
12+
* dependency updates.
13+
814
## V1.8.0
915

1016
* Update `get_all_releases` to include `isNewClearingWithSourceAvailable` parameter:

Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
# SPDX-FileCopyrightText: (c) 2019-2024 Siemens
2+
# SPDX-FileCopyrightText: (c) 2019-2025 Siemens
33
# SPDX-License-Identifier: MIT
44
-->
55

@@ -100,7 +100,7 @@ of a given project on SW360. This requires colorama>=0.4.1.
100100

101101
## License
102102

103-
Copyright 2019-2024 Siemens
103+
Copyright 2019-2025 Siemens
104104

105105
The project is licensed under the MIT license.
106106
SPDX-License-Identifier: MIT

SBOM/sbom.cdx.json

Lines changed: 201 additions & 344 deletions
Large diffs are not rendered by default.

poetry.lock

Lines changed: 232 additions & 225 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# SPDX-FileCopyrightText: (c) 2018-2024 Siemens
1+
# SPDX-FileCopyrightText: (c) 2018-2025 Siemens
22
# SPDX-License-Identifier: MIT
33

44
[tool.poetry]
55
name = "sw360"
6-
version = "1.8.0"
6+
version = "1.8.1"
77
description = "Python interface to the SW360 software component catalogue"
88
authors = ["Thomas Graf <thomas.graf@siemens.com>",
99
"Gernot Hillier <gernot.hillier@siemens.com>"]
@@ -73,3 +73,4 @@ no_implicit_reexport = true
7373

7474
[tool.codespell]
7575
skip = "test_all_components.json,test_all_releases.json,./htmlcov/*,./__internal__/*,./docs/_static/*,./docs/searchindex.js,./docs/objects.inv"
76+
ignore-words-list = "visbility"

sw360/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# -------------------------------------------------------------------------------
2-
# Copyright (c) 2019-2024 Siemens
2+
# Copyright (c) 2019-2025 Siemens
33
# All Rights Reserved.
44
# Author: thomas.graf@siemens.com
55
#
66
# Licensed under the MIT license.
77
# SPDX-License-Identifier: MIT
88
# -------------------------------------------------------------------------------
99

10-
__version__ = (1, 8, 0)
10+
__version__ = (1, 8, 1)
1111

1212
from .sw360_api import SW360
1313
from .sw360error import SW360Error

sw360/components.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -------------------------------------------------------------------------------
2-
# Copyright (c) 2019-2024 Siemens
2+
# Copyright (c) 2019-2025 Siemens
33
# Copyright (c) 2022 BMW CarIT GmbH
44
# All Rights Reserved.
55
# Authors: thomas.graf@siemens.com, gernot.hillier@siemens.com
@@ -313,7 +313,8 @@ def delete_component(self, component_id: str) -> Optional[Dict[str, Any]]:
313313
response = self.api_delete(url)
314314
if response is not None:
315315
if response.ok:
316-
return response.json()
316+
if response.text:
317+
return response.json()
317318
return None
318319

319320
def get_users_of_component(self, component_id: str) -> Optional[Dict[str, Any]]:

sw360/license.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -------------------------------------------------------------------------------
2-
# Copyright (c) 2019-2022 Siemens
2+
# Copyright (c) 2019-2025 Siemens
33
# Copyright (c) 2022 BMW CarIT GmbH
44
# All Rights Reserved.
55
# Authors: thomas.graf@siemens.com, gernot.hillier@siemens.com
@@ -68,6 +68,8 @@ def delete_license(self, license_shortname: str) -> Optional[bool]:
6868
:raises SW360Error: if there is a negative HTTP response
6969
"""
7070

71+
# 2025-01-23: returns 500 - internal server error
72+
7173
if not license_shortname:
7274
raise SW360Error(message="No license shortname provided!")
7375

sw360/project.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,8 @@ def delete_project(self, project_id: str) -> Optional[Dict[str, Any]]:
437437
response = self.api_delete(url)
438438
if response is not None:
439439
if response.ok:
440-
return response.json()
440+
if response.text:
441+
return response.json()
441442
return None
442443

443444
def get_users_of_project(self, project_id: str) -> Optional[Dict[str, Any]]:

sw360/releases.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -------------------------------------------------------------------------------
2-
# Copyright (c) 2019-2024 Siemens
2+
# Copyright (c) 2019-2025 Siemens
33
# Copyright (c) 2022 BMW CarIT GmbH
44
# All Rights Reserved.
55
# Authors: thomas.graf@siemens.com, gernot.hillier@siemens.com
@@ -239,7 +239,8 @@ def delete_release(self, release_id: str) -> Optional[Dict[str, Any]]:
239239
response = self.api_delete(url)
240240
if response is not None:
241241
if response.ok:
242-
return response.json()
242+
if response.text:
243+
return response.json()
243244
return None
244245

245246
def get_users_of_release(self, release_id: str) -> Optional[Dict[str, Any]]:

0 commit comments

Comments
 (0)