continuous-delivery-scripts 3.2.6__tar.gz → 3.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {continuous_delivery_scripts-3.2.6/continuous_delivery_scripts.egg-info → continuous_delivery_scripts-3.3.0}/PKG-INFO +3 -2
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/README.md +1 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/__init__.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/_version.py +6 -5
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/assert_news.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/create_news_file.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/generate_docs.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/generate_news.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/get_config.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/get_version.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/language_specifics.py +1 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/license_files.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/plugins/GOLAND.MD +1 -2
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/plugins/__init__.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/plugins/basic.py +11 -5
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/plugins/ci.py +15 -6
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/plugins/docker.py +11 -5
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/plugins/github_actions.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/plugins/golang.py +95 -38
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/plugins/noop.py +11 -5
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/plugins/python.py +34 -13
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/report_third_party_ip.py +20 -7
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/spdx_report/__init__.py +1 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/spdx_report/spdx_dependency.py +9 -4
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/spdx_report/spdx_document.py +40 -19
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/spdx_report/spdx_file.py +23 -13
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/spdx_report/spdx_helpers.py +39 -8
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/spdx_report/spdx_package.py +29 -19
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/spdx_report/spdx_project.py +21 -9
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/spdx_report/spdx_summary.py +30 -12
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/tag_and_release.py +33 -9
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/__init__.py +1 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/aws_helpers.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/configuration.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/definitions.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/filesystem_helpers.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/git_helpers.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/hash_helpers.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/language_specifics_base.py +10 -5
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/logging.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/news_file.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/noop/__init__.py +1 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/noop/package_helpers.py +1 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/package_helpers.py +18 -15
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/python/__init__.py +1 -1
- continuous_delivery_scripts-3.3.0/continuous_delivery_scripts/utils/python/package_helpers.py +147 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/python/python_helpers.py +1 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/string_helpers.py +2 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/third_party_licences.py +25 -7
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/utils/versioning.py +1 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0/continuous_delivery_scripts.egg-info}/PKG-INFO +3 -2
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts.egg-info/requires.txt +1 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/pyproject.toml +1 -1
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/setup.py +4 -1
- continuous_delivery_scripts-3.2.6/continuous_delivery_scripts/utils/python/package_helpers.py +0 -87
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/LICENSE +0 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/MANIFEST.in +0 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/plugins/BASIC.MD +0 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/plugins/CI.MD +0 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/plugins/GITHUB_ACTIONS.MD +0 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/plugins/NOOP.MD +0 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/plugins/PYTHON.MD +0 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/spdx_report/templates/third_party_IP_report.csv.jinja2 +0 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/spdx_report/templates/third_party_IP_report.html.jinja2 +0 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts/spdx_report/templates/third_party_IP_report.txt.jinja2 +0 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts.egg-info/SOURCES.txt +0 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts.egg-info/dependency_links.txt +0 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts.egg-info/entry_points.txt +0 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/continuous_delivery_scripts.egg-info/top_level.txt +0 -0
- {continuous_delivery_scripts-3.2.6 → continuous_delivery_scripts-3.3.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: continuous-delivery-scripts
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3.0
|
|
4
4
|
Summary: Continuous Delivery scripts to increase automation
|
|
5
5
|
Home-page: https://github.com/ARMmbed/continuous-delivery-scripts
|
|
6
6
|
Author: CMSIS team
|
|
@@ -19,6 +19,7 @@ Classifier: Topic :: Software Development :: Build Tools
|
|
|
19
19
|
Requires-Python: >=3.8,<4
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
|
+
Requires-Dist: setuptools
|
|
22
23
|
Requires-Dist: gitpython
|
|
23
24
|
Requires-Dist: towncrier==22.12.0
|
|
24
25
|
Requires-Dist: pyautoversion~=1.2.0
|
|
@@ -51,7 +52,7 @@ Dynamic: requires-python
|
|
|
51
52
|
Dynamic: summary
|
|
52
53
|
|
|
53
54
|
<!--
|
|
54
|
-
Copyright (C) 2020-
|
|
55
|
+
Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
55
56
|
SPDX-License-Identifier: Apache-2.0
|
|
56
57
|
-->
|
|
57
58
|
# Automation Scripts for CI/CD
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
Copyright (C) 2020-
|
|
2
|
+
Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
-->
|
|
5
5
|
# Automation Scripts for CI/CD
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Scripts and utilities used by the CI pipeline."""
|
|
6
|
+
|
|
6
7
|
from continuous_delivery_scripts._version import __version__ # noqa: F401
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""The version number is based on semantic versioning.
|
|
@@ -10,8 +10,9 @@ References
|
|
|
10
10
|
|
|
11
11
|
This file is autogenerated, do not modify by hand.
|
|
12
12
|
"""
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
|
|
14
|
+
__version__ = "3.3.0"
|
|
15
|
+
COMMIT = "0bb13bc2abd9af0d72e709afd285d977cc06d8ba"
|
|
15
16
|
MAJOR = 3
|
|
16
|
-
MINOR =
|
|
17
|
-
PATCH =
|
|
17
|
+
MINOR = 3
|
|
18
|
+
PATCH = 0
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Checks if valid news files are created for changes in the project."""
|
|
6
|
+
|
|
6
7
|
import argparse
|
|
7
8
|
import logging
|
|
8
9
|
import pathlib
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Easy news files generation.
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
Usage:
|
|
8
8
|
create-news-file "Fixed a bug" --type bugfix
|
|
9
9
|
"""
|
|
10
|
+
|
|
10
11
|
import argparse
|
|
11
12
|
import logging
|
|
12
13
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Generates documentation."""
|
|
6
|
+
|
|
6
7
|
import argparse
|
|
7
8
|
import logging
|
|
8
9
|
import os
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Handles usage of towncrier for automated changelog generation and pyautoversion for versioning."""
|
|
6
|
+
|
|
6
7
|
import sys
|
|
7
8
|
|
|
8
9
|
import argparse
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Retrieves configuration values."""
|
|
6
|
+
|
|
6
7
|
import argparse
|
|
7
8
|
import sys
|
|
8
9
|
import logging
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Determine the project new version."""
|
|
6
|
+
|
|
6
7
|
import sys
|
|
7
8
|
|
|
8
9
|
from typing import Optional
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Language plugins Loader."""
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Apply copyright and licensing to all source files present in a project.
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
This is to comply with OpenChain certification;
|
|
8
8
|
https://github.com/OpenChain-Project/Curriculum/blob/master/guides/reusing_software.md#2-include-a-copyright-notice-and-license-in-each-file
|
|
9
9
|
"""
|
|
10
|
+
|
|
10
11
|
import argparse
|
|
11
12
|
import logging
|
|
12
13
|
import subprocess
|
|
@@ -9,5 +9,4 @@ The plugin leverages [goreleaser](https://goreleaser.com/) to package and releas
|
|
|
9
9
|
Therefore, a `.goreleaser.yml` file must be present in the go source directory i.e. where the mod file lies.
|
|
10
10
|
|
|
11
11
|
## Documentation
|
|
12
|
-
The plugin uses [
|
|
13
|
-
It currently uses version 0.4.1 as later versions comprise [an issue](https://github.com/go101/golds/issues/26)
|
|
12
|
+
The plugin uses [doc2go](https://abhinav.github.io/doc2go) to generate the code reference documentation.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Language specific actions."""
|
|
6
|
+
|
|
6
7
|
import glob
|
|
7
8
|
from pathlib import Path
|
|
8
9
|
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Basic plugin."""
|
|
6
|
+
|
|
6
7
|
import logging
|
|
7
8
|
from pathlib import Path
|
|
8
|
-
from typing import Optional
|
|
9
|
+
from typing import TYPE_CHECKING, Optional
|
|
9
10
|
|
|
10
|
-
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
|
|
11
11
|
from continuous_delivery_scripts.utils.definitions import CommitType
|
|
12
|
-
from continuous_delivery_scripts.utils.language_specifics_base import
|
|
12
|
+
from continuous_delivery_scripts.utils.language_specifics_base import (
|
|
13
|
+
BaseLanguage,
|
|
14
|
+
get_language_from_file_name,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
if TYPE_CHECKING:
|
|
18
|
+
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
|
|
13
19
|
|
|
14
20
|
logger = logging.getLogger(__name__)
|
|
15
21
|
|
|
@@ -45,6 +51,6 @@ class Basic(BaseLanguage):
|
|
|
45
51
|
"""States whether project metadata can be retrieved."""
|
|
46
52
|
return False
|
|
47
53
|
|
|
48
|
-
def get_current_spdx_project(self) -> Optional[SpdxProject]:
|
|
54
|
+
def get_current_spdx_project(self) -> Optional["SpdxProject"]:
|
|
49
55
|
"""Basic."""
|
|
50
56
|
return None
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Plugin for CI projects."""
|
|
6
|
+
|
|
6
7
|
import logging
|
|
7
8
|
from pathlib import Path
|
|
8
|
-
from typing import Optional
|
|
9
|
+
from typing import TYPE_CHECKING, Optional
|
|
9
10
|
|
|
10
|
-
from continuous_delivery_scripts.
|
|
11
|
-
|
|
11
|
+
from continuous_delivery_scripts.utils.configuration import (
|
|
12
|
+
configuration,
|
|
13
|
+
ConfigurationVariable,
|
|
14
|
+
)
|
|
12
15
|
from continuous_delivery_scripts.utils.definitions import CommitType
|
|
13
|
-
from continuous_delivery_scripts.utils.language_specifics_base import
|
|
16
|
+
from continuous_delivery_scripts.utils.language_specifics_base import (
|
|
17
|
+
BaseLanguage,
|
|
18
|
+
get_language_from_file_name,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
if TYPE_CHECKING:
|
|
22
|
+
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
|
|
14
23
|
|
|
15
24
|
logger = logging.getLogger(__name__)
|
|
16
25
|
|
|
@@ -52,7 +61,7 @@ class CI(BaseLanguage):
|
|
|
52
61
|
"""States whether project metadata can be retrieved."""
|
|
53
62
|
return False
|
|
54
63
|
|
|
55
|
-
def get_current_spdx_project(self) -> Optional[SpdxProject]:
|
|
64
|
+
def get_current_spdx_project(self) -> Optional["SpdxProject"]:
|
|
56
65
|
"""Gets current SPDX description."""
|
|
57
66
|
# TODO
|
|
58
67
|
return None
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Plugin for Docker projects."""
|
|
6
|
+
|
|
6
7
|
import logging
|
|
7
8
|
from pathlib import Path
|
|
8
|
-
from typing import Optional
|
|
9
|
+
from typing import TYPE_CHECKING, Optional
|
|
9
10
|
|
|
10
|
-
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
|
|
11
11
|
from continuous_delivery_scripts.utils.definitions import CommitType
|
|
12
|
-
from continuous_delivery_scripts.utils.language_specifics_base import
|
|
12
|
+
from continuous_delivery_scripts.utils.language_specifics_base import (
|
|
13
|
+
BaseLanguage,
|
|
14
|
+
get_language_from_file_name,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
if TYPE_CHECKING:
|
|
18
|
+
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
|
|
13
19
|
|
|
14
20
|
logger = logging.getLogger(__name__)
|
|
15
21
|
|
|
@@ -47,7 +53,7 @@ class Docker(BaseLanguage):
|
|
|
47
53
|
"""States whether project metadata can be retrieved."""
|
|
48
54
|
return False
|
|
49
55
|
|
|
50
|
-
def get_current_spdx_project(self) -> Optional[SpdxProject]:
|
|
56
|
+
def get_current_spdx_project(self) -> Optional["SpdxProject"]:
|
|
51
57
|
"""Gets current SPDX description."""
|
|
52
58
|
# TODO
|
|
53
59
|
return None
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Plugin for CI projects."""
|
|
6
|
+
|
|
6
7
|
import logging
|
|
7
8
|
import os
|
|
8
9
|
from pathlib import Path
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Plugin for Golang projects."""
|
|
6
|
+
|
|
6
7
|
import logging
|
|
7
8
|
import os
|
|
9
|
+
import shutil
|
|
8
10
|
from pathlib import Path
|
|
9
|
-
from subprocess import check_call
|
|
10
|
-
from typing import Optional, List, Dict
|
|
11
|
+
from subprocess import check_call, check_output
|
|
12
|
+
from typing import TYPE_CHECKING, Optional, List, Dict, MutableMapping
|
|
11
13
|
|
|
12
|
-
from continuous_delivery_scripts.
|
|
13
|
-
|
|
14
|
+
from continuous_delivery_scripts.utils.configuration import (
|
|
15
|
+
configuration,
|
|
16
|
+
ConfigurationVariable,
|
|
17
|
+
)
|
|
14
18
|
from continuous_delivery_scripts.utils.definitions import CommitType
|
|
15
|
-
from continuous_delivery_scripts.utils.git_helpers import
|
|
16
|
-
|
|
19
|
+
from continuous_delivery_scripts.utils.git_helpers import (
|
|
20
|
+
LocalProjectRepository,
|
|
21
|
+
GitWrapper,
|
|
22
|
+
)
|
|
23
|
+
from continuous_delivery_scripts.utils.language_specifics_base import (
|
|
24
|
+
BaseLanguage,
|
|
25
|
+
get_language_from_file_name,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
if TYPE_CHECKING:
|
|
29
|
+
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
|
|
17
30
|
|
|
18
31
|
logger = logging.getLogger(__name__)
|
|
19
32
|
|
|
@@ -25,14 +38,11 @@ ENVVAR_GO_MOD = "GO111MODULE"
|
|
|
25
38
|
GO_MOD_ON_VALUE = "on"
|
|
26
39
|
|
|
27
40
|
|
|
28
|
-
def
|
|
41
|
+
def _generate_doc2go_command_list(output_directory: Path, module: str) -> List[str]:
|
|
29
42
|
return [
|
|
30
|
-
"
|
|
31
|
-
"-
|
|
32
|
-
|
|
33
|
-
"-only-list-exporteds",
|
|
34
|
-
f"-dir={str(output_directory)}",
|
|
35
|
-
"-nouses",
|
|
43
|
+
"doc2go",
|
|
44
|
+
"-out",
|
|
45
|
+
str(output_directory),
|
|
36
46
|
f"{module}",
|
|
37
47
|
]
|
|
38
48
|
|
|
@@ -54,12 +64,12 @@ def _generate_goreleaser_check_command_list() -> List[str]:
|
|
|
54
64
|
]
|
|
55
65
|
|
|
56
66
|
|
|
57
|
-
def
|
|
67
|
+
def _install_doc2go_command_list() -> List[str]:
|
|
58
68
|
return [
|
|
59
69
|
"go",
|
|
60
70
|
"install",
|
|
61
|
-
"
|
|
62
|
-
]
|
|
71
|
+
"go.abhg.dev/doc2go@latest",
|
|
72
|
+
]
|
|
63
73
|
|
|
64
74
|
|
|
65
75
|
def _install_syft_command_list() -> List[str]:
|
|
@@ -70,29 +80,63 @@ def _install_goreleaser_command_list() -> List[str]:
|
|
|
70
80
|
return ["go", "install", "github.com/goreleaser/goreleaser/v2@latest"]
|
|
71
81
|
|
|
72
82
|
|
|
73
|
-
def
|
|
74
|
-
|
|
75
|
-
|
|
83
|
+
def _ensure_go_tool_installed(
|
|
84
|
+
tool_name: str,
|
|
85
|
+
version_command: List[str],
|
|
86
|
+
install_command: List[str],
|
|
87
|
+
env: MutableMapping[str, str],
|
|
88
|
+
) -> None:
|
|
89
|
+
"""Ensure a Go-based tool is available on PATH before use."""
|
|
90
|
+
tool_path = shutil.which(tool_name)
|
|
91
|
+
if tool_path:
|
|
92
|
+
try:
|
|
93
|
+
check_output(version_command, env=env)
|
|
94
|
+
logger.info("Using %s from PATH: %s", tool_name, tool_path)
|
|
95
|
+
return
|
|
96
|
+
except Exception as exception:
|
|
97
|
+
logger.warning("Could not use %s from PATH: %s", tool_name, exception)
|
|
98
|
+
|
|
99
|
+
logger.info("Installing %s with go install.", tool_name)
|
|
100
|
+
check_call(install_command, env=env)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def _call_doc2go(output_directory: Path, module: str) -> None:
|
|
104
|
+
"""Call doc2go for generating the docs."""
|
|
76
105
|
env = os.environ
|
|
77
106
|
env[ENVVAR_GO_MOD] = GO_MOD_ON_VALUE
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
logger.warning(
|
|
84
|
-
"Currently not running golds because there is an issue with latest versions: "
|
|
85
|
-
+ "https://github.com/go101/golds/issues/26"
|
|
107
|
+
_ensure_go_tool_installed(
|
|
108
|
+
tool_name="doc2go",
|
|
109
|
+
version_command=["doc2go", "-version"],
|
|
110
|
+
install_command=_install_doc2go_command_list(),
|
|
111
|
+
env=env,
|
|
86
112
|
)
|
|
113
|
+
logger.info("Creating Code documentation.")
|
|
114
|
+
logger.info("Running doc2go over [%s] in [%s].", module, SRC_DIR)
|
|
115
|
+
# FIXME enable doc2go when fully tested
|
|
116
|
+
# check_call(
|
|
117
|
+
# _generate_doc2go_command_list(output_directory, module),
|
|
118
|
+
# cwd=str(SRC_DIR),
|
|
119
|
+
# env=env,
|
|
120
|
+
# )
|
|
121
|
+
logger.warning("Currently not running doc2go")
|
|
87
122
|
|
|
88
123
|
|
|
89
124
|
def _call_goreleaser_check(version: str) -> None:
|
|
90
125
|
"""Calls go releaser check to verify configuration."""
|
|
91
|
-
logger.info("Installing GoReleaser if missing.")
|
|
92
126
|
env = os.environ
|
|
93
127
|
env[ENVVAR_GO_MOD] = GO_MOD_ON_VALUE
|
|
94
|
-
|
|
95
|
-
|
|
128
|
+
_ensure_go_tool_installed(
|
|
129
|
+
tool_name="syft",
|
|
130
|
+
version_command=["syft", "--version"],
|
|
131
|
+
install_command=_install_syft_command_list(),
|
|
132
|
+
env=env,
|
|
133
|
+
)
|
|
134
|
+
_ensure_go_tool_installed(
|
|
135
|
+
tool_name="goreleaser",
|
|
136
|
+
version_command=["goreleaser", "--version"],
|
|
137
|
+
install_command=_install_goreleaser_command_list(),
|
|
138
|
+
env=env,
|
|
139
|
+
)
|
|
96
140
|
logger.info("Checking GoReleaser configuration.")
|
|
97
141
|
env[ENVVAR_GORELEASER_CUSTOMISED_TAG] = version
|
|
98
142
|
env[ENVVAR_GORELEASER_GIT_TOKEN] = configuration.get_value(ConfigurationVariable.GIT_TOKEN)
|
|
@@ -124,7 +168,7 @@ class Go(BaseLanguage):
|
|
|
124
168
|
|
|
125
169
|
def get_related_language(self) -> str:
|
|
126
170
|
"""Gets the related language."""
|
|
127
|
-
return get_language_from_file_name(__file__)
|
|
171
|
+
return str(get_language_from_file_name(__file__))
|
|
128
172
|
|
|
129
173
|
def get_version_tag(self, version: str) -> str:
|
|
130
174
|
"""Gets tag based on version."""
|
|
@@ -149,7 +193,7 @@ class Go(BaseLanguage):
|
|
|
149
193
|
def generate_code_documentation(self, output_directory: Path, module_to_document: str) -> None:
|
|
150
194
|
"""Generates the code documentation."""
|
|
151
195
|
super().generate_code_documentation(output_directory, module_to_document)
|
|
152
|
-
|
|
196
|
+
_call_doc2go(output_directory, module_to_document if module_to_document else "./...")
|
|
153
197
|
|
|
154
198
|
def can_add_licence_headers(self) -> bool:
|
|
155
199
|
"""States that licence headers can be added."""
|
|
@@ -159,7 +203,7 @@ class Go(BaseLanguage):
|
|
|
159
203
|
"""States whether project metadata can be retrieved."""
|
|
160
204
|
return False
|
|
161
205
|
|
|
162
|
-
def get_current_spdx_project(self) -> Optional[SpdxProject]:
|
|
206
|
+
def get_current_spdx_project(self) -> Optional["SpdxProject"]:
|
|
163
207
|
"""Gets current SPDX description."""
|
|
164
208
|
# TODO
|
|
165
209
|
return None
|
|
@@ -177,11 +221,20 @@ class Go(BaseLanguage):
|
|
|
177
221
|
|
|
178
222
|
def _call_goreleaser_release(self, version: str) -> None:
|
|
179
223
|
"""Calls go releaser release to upload packages."""
|
|
180
|
-
logger.info("Installing GoReleaser if missing.")
|
|
181
224
|
env = os.environ
|
|
182
225
|
env[ENVVAR_GO_MOD] = GO_MOD_ON_VALUE
|
|
183
|
-
|
|
184
|
-
|
|
226
|
+
_ensure_go_tool_installed(
|
|
227
|
+
tool_name="syft",
|
|
228
|
+
version_command=["syft", "--version"],
|
|
229
|
+
install_command=_install_syft_command_list(),
|
|
230
|
+
env=env,
|
|
231
|
+
)
|
|
232
|
+
_ensure_go_tool_installed(
|
|
233
|
+
tool_name="goreleaser",
|
|
234
|
+
version_command=["goreleaser", "--version"],
|
|
235
|
+
install_command=_install_goreleaser_command_list(),
|
|
236
|
+
env=env,
|
|
237
|
+
)
|
|
185
238
|
tag = self.get_version_tag(version)
|
|
186
239
|
# The tag of the release must be retrieved
|
|
187
240
|
# See https://github.com/goreleaser/goreleaser/discussions/1426
|
|
@@ -194,4 +247,8 @@ class Go(BaseLanguage):
|
|
|
194
247
|
changelogPath = configuration.get_value(ConfigurationVariable.CHANGELOG_FILE_PATH)
|
|
195
248
|
env[ENVVAR_GORELEASER_CUSTOMISED_TAG] = tag
|
|
196
249
|
env[ENVVAR_GORELEASER_GIT_TOKEN] = configuration.get_value(ConfigurationVariable.GIT_TOKEN)
|
|
197
|
-
check_call(
|
|
250
|
+
check_call(
|
|
251
|
+
_generate_goreleaser_release_command_list(changelogPath),
|
|
252
|
+
cwd=ROOT_DIR,
|
|
253
|
+
env=env,
|
|
254
|
+
)
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""No Operation plugin."""
|
|
6
|
+
|
|
6
7
|
import logging
|
|
7
8
|
from pathlib import Path
|
|
8
|
-
from typing import Optional, Dict
|
|
9
|
+
from typing import TYPE_CHECKING, Optional, Dict
|
|
9
10
|
|
|
10
|
-
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
|
|
11
11
|
from continuous_delivery_scripts.utils.definitions import CommitType
|
|
12
12
|
from continuous_delivery_scripts.utils.git_helpers import GitWrapper
|
|
13
|
-
from continuous_delivery_scripts.utils.language_specifics_base import
|
|
13
|
+
from continuous_delivery_scripts.utils.language_specifics_base import (
|
|
14
|
+
BaseLanguage,
|
|
15
|
+
get_language_from_file_name,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
|
|
14
20
|
|
|
15
21
|
logger = logging.getLogger(__name__)
|
|
16
22
|
|
|
@@ -47,7 +53,7 @@ class NoOp(BaseLanguage):
|
|
|
47
53
|
"""States whether project metadata can be retrieved."""
|
|
48
54
|
return False
|
|
49
55
|
|
|
50
|
-
def get_current_spdx_project(self) -> Optional[SpdxProject]:
|
|
56
|
+
def get_current_spdx_project(self) -> Optional["SpdxProject"]:
|
|
51
57
|
"""No Op."""
|
|
52
58
|
return None
|
|
53
59
|
|
|
@@ -1,27 +1,36 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright (C) 2020-
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
#
|
|
5
5
|
"""Plugin for Python projects."""
|
|
6
|
+
|
|
6
7
|
import logging
|
|
7
8
|
import shutil
|
|
8
9
|
import sys
|
|
9
10
|
from pathlib import Path
|
|
10
11
|
from subprocess import check_call
|
|
11
|
-
from typing import List, Optional
|
|
12
|
+
from typing import TYPE_CHECKING, List, Optional
|
|
12
13
|
|
|
13
|
-
from continuous_delivery_scripts.
|
|
14
|
-
|
|
14
|
+
from continuous_delivery_scripts.utils.configuration import (
|
|
15
|
+
configuration,
|
|
16
|
+
ConfigurationVariable,
|
|
17
|
+
)
|
|
15
18
|
from continuous_delivery_scripts.utils.definitions import CommitType
|
|
16
19
|
from continuous_delivery_scripts.utils.filesystem_helpers import TemporaryDirectory
|
|
17
20
|
from continuous_delivery_scripts.utils.filesystem_helpers import cd
|
|
18
|
-
from continuous_delivery_scripts.utils.language_specifics_base import
|
|
21
|
+
from continuous_delivery_scripts.utils.language_specifics_base import (
|
|
22
|
+
BaseLanguage,
|
|
23
|
+
get_language_from_file_name,
|
|
24
|
+
)
|
|
19
25
|
from continuous_delivery_scripts.utils.logging import log_exception
|
|
20
26
|
from continuous_delivery_scripts.utils.python.package_helpers import (
|
|
21
27
|
CurrentPythonProjectMetadataFetcher,
|
|
22
28
|
generate_package_info,
|
|
23
29
|
)
|
|
24
30
|
|
|
31
|
+
if TYPE_CHECKING:
|
|
32
|
+
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
|
|
33
|
+
|
|
25
34
|
ENVVAR_TWINE_USERNAME = "TWINE_USERNAME"
|
|
26
35
|
ENVVAR_TWINE_PASSWORD = "TWINE_PASSWORD"
|
|
27
36
|
OUTPUT_DIRECTORY = "release-dist"
|
|
@@ -109,15 +118,25 @@ def _generate_pdoc_in_correct_structure(module_to_document: str, output_director
|
|
|
109
118
|
Pdoc nests its docs output in a folder with the module's name.
|
|
110
119
|
This process removes this unwanted folder.
|
|
111
120
|
"""
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
temp_directory = TemporaryDirectory()
|
|
122
|
+
if hasattr(temp_directory, "__enter__") and hasattr(temp_directory, "__exit__"):
|
|
123
|
+
with temp_directory as temp_dir:
|
|
124
|
+
_call_pdoc(temp_dir, module_to_document)
|
|
125
|
+
docs_contents_dir = temp_dir.joinpath(module_to_document)
|
|
126
|
+
if docs_contents_dir.exists() and docs_contents_dir.is_dir():
|
|
127
|
+
for element in docs_contents_dir.iterdir():
|
|
128
|
+
shutil.move(str(element), str(output_directory))
|
|
129
|
+
return
|
|
130
|
+
|
|
131
|
+
temp_dir = Path(str(temp_directory))
|
|
132
|
+
_call_pdoc(temp_dir, module_to_document)
|
|
133
|
+
docs_contents_dir = temp_dir.joinpath(module_to_document)
|
|
134
|
+
if docs_contents_dir.exists() and docs_contents_dir.is_dir():
|
|
135
|
+
for element in docs_contents_dir.iterdir():
|
|
136
|
+
shutil.move(str(element), str(output_directory))
|
|
118
137
|
|
|
119
138
|
|
|
120
|
-
def _get_current_spdx_project() -> SpdxProject:
|
|
139
|
+
def _get_current_spdx_project() -> "SpdxProject":
|
|
121
140
|
"""Gets information about the current project/package."""
|
|
122
141
|
logger.info("Generating package information.")
|
|
123
142
|
try:
|
|
@@ -125,6 +144,8 @@ def _get_current_spdx_project() -> SpdxProject:
|
|
|
125
144
|
generate_package_info()
|
|
126
145
|
except Exception as e:
|
|
127
146
|
log_exception(logger, e)
|
|
147
|
+
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
|
|
148
|
+
|
|
128
149
|
return SpdxProject(CurrentPythonProjectMetadataFetcher())
|
|
129
150
|
|
|
130
151
|
|
|
@@ -173,6 +194,6 @@ class Python(BaseLanguage):
|
|
|
173
194
|
# FIXME Comment out SPDX package as no longer working
|
|
174
195
|
return False
|
|
175
196
|
|
|
176
|
-
def get_current_spdx_project(self) -> Optional[SpdxProject]:
|
|
197
|
+
def get_current_spdx_project(self) -> Optional["SpdxProject"]:
|
|
177
198
|
"""Gets the current SPDX description."""
|
|
178
199
|
return _get_current_spdx_project()
|