continuous-delivery-scripts 4.4.1__tar.gz → 4.4.3__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-4.4.1/continuous_delivery_scripts.egg-info → continuous_delivery_scripts-4.4.3}/PKG-INFO +5 -5
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/README.md +2 -2
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/_version.py +3 -3
- continuous_delivery_scripts-4.4.3/continuous_delivery_scripts/check_licence_compliance.py +129 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/generate_news.py +53 -1
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/plugins/GOLAND.MD +8 -1
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/plugins/PYTHON.MD +4 -2
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/plugins/basic.py +1 -1
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/plugins/ci.py +1 -1
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/plugins/docker.py +1 -1
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/plugins/golang.py +132 -39
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/plugins/noop.py +1 -1
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/plugins/python.py +1 -1
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/report_third_party_ip.py +14 -3
- continuous_delivery_scripts-4.4.3/continuous_delivery_scripts/spdx_report/spdx_dependency.py +63 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/spdx_report/spdx_document.py +78 -56
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/spdx_report/spdx_file.py +16 -16
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/spdx_report/spdx_helpers.py +31 -1
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/spdx_report/spdx_package.py +26 -37
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/spdx_report/spdx_project.py +3 -2
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/configuration.py +3 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/language_specifics_base.py +1 -1
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/package_helpers.py +6 -1
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3/continuous_delivery_scripts.egg-info}/PKG-INFO +5 -5
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts.egg-info/SOURCES.txt +3 -2
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts.egg-info/requires.txt +2 -2
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/setup.py +2 -3
- continuous_delivery_scripts-4.4.3/spdx-tmp/GitPython.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/Jinja2.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/Mako.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/Markdown.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/MarkupSafe.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/PyYAML.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/Pygments.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/SecretStorage.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/beartype.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/boolean.py.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/boto3.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/botocore.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/bracex.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/certifi.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/cffi.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/charset-normalizer.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/click.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/continuous-delivery-scripts.spdx +732 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/cryptography.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/detect-secrets.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/docutils.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/gibberish-detector.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/gitdb.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/id.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/idna.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/jaraco.classes.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/jaraco.context.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/jaraco.functools.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/jeepney.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/jellyfish.spdx +29 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/jmespath.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/keyring.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/license-expression.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/licenseheaders.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/markdown-it-py.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/mdurl.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/more-itertools.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/nh3.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/packaging.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/pdoc3.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/ply.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/pyautoversion.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/pycparser.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/pyparsing.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/python-dateutil.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/python-dotenv.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/rdflib.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/readme_renderer.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/regex.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/requests-toolbelt.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/requests.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/rfc3986.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/rich.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/s3transfer.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/semantic-version.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/semver.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/setuptools.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/six.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/smmap.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/spdx-tools.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/toml.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/towncrier.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/twine.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/uritools.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/urllib3.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/wcmatch.spdx +30 -0
- continuous_delivery_scripts-4.4.3/spdx-tmp/xmltodict.spdx +30 -0
- continuous_delivery_scripts-4.4.1/continuous_delivery_scripts/check_licence_compliance.py +0 -68
- continuous_delivery_scripts-4.4.1/continuous_delivery_scripts/spdx_report/spdx_dependency.py +0 -46
- continuous_delivery_scripts-4.4.1/spdx-tmp/GitPython.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/Incremental.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/Jinja2.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/Mako.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/Markdown.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/MarkupSafe.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/PyYAML.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/Pygments.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/SecretStorage.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/boolean.py.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/boto3.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/botocore.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/bracex.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/certifi.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/cffi.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/charset-normalizer.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/click-default-group.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/click.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/continuous-delivery-scripts.spdx +0 -916
- continuous_delivery_scripts-4.4.1/spdx-tmp/cryptography.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/detect-secrets.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/docutils.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/gibberish-detector.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/gitdb.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/id.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/idna.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/jaraco.classes.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/jaraco.context.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/jaraco.functools.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/jeepney.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/jellyfish.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/jmespath.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/keyring.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/license-expression.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/licenseheaders.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/markdown-it-py.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/mdurl.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/more-itertools.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/nh3.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/packaging.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/pdoc3.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/ply.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/pyautoversion.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/pycparser.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/pyparsing.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/python-dateutil.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/python-dotenv.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/rdflib.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/readme_renderer.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/regex.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/requests-toolbelt.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/requests.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/rfc3986.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/rich.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/s3transfer.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/semver.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/setuptools.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/six.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/smmap.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/spdx-tools.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/toml.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/towncrier.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/twine.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/urllib3.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/wcmatch.spdx +0 -50
- continuous_delivery_scripts-4.4.1/spdx-tmp/xmltodict.spdx +0 -50
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/LICENSE +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/MANIFEST.in +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/__init__.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/assert_news.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/create_news_file.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/detect_secrets.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/generate_docs.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/get_config.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/get_version.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/language_specifics.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/license_files.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/plugins/BASIC.MD +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/plugins/CI.MD +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/plugins/GITHUB_ACTIONS.MD +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/plugins/NOOP.MD +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/plugins/__init__.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/plugins/github_actions.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/spdx_report/__init__.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/spdx_report/data/licence_assessment.toml +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/spdx_report/licence_assessment.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/spdx_report/scancode_licence_db.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/spdx_report/spdx_summary.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/spdx_report/templates/third_party_IP_report.csv.jinja2 +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/spdx_report/templates/third_party_IP_report.html.jinja2 +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/spdx_report/templates/third_party_IP_report.txt.jinja2 +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/tag_and_release.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/update_secrets_registry.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/__init__.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/aws_helpers.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/definitions.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/filesystem_helpers.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/git_helpers.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/hash_helpers.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/logging.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/news_file.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/noop/__init__.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/noop/package_helpers.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/python/__init__.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/python/package_helpers.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/python/python_helpers.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/string_helpers.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/third_party_licences.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts/utils/versioning.py +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts.egg-info/dependency_links.txt +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts.egg-info/entry_points.txt +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/continuous_delivery_scripts.egg-info/top_level.txt +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/pyproject.toml +0 -0
- {continuous_delivery_scripts-4.4.1 → continuous_delivery_scripts-4.4.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: continuous-delivery-scripts
|
|
3
|
-
Version: 4.4.
|
|
3
|
+
Version: 4.4.3
|
|
4
4
|
Summary: Git-based CI/CD tools for releases, changelogs, SPDX SBOMs and licence reporting
|
|
5
5
|
Home-page: https://github.com/ARMmbed/continuous-delivery-scripts
|
|
6
6
|
Author: Arm
|
|
@@ -27,7 +27,7 @@ Description-Content-Type: text/markdown
|
|
|
27
27
|
License-File: LICENSE
|
|
28
28
|
Requires-Dist: setuptools
|
|
29
29
|
Requires-Dist: gitpython
|
|
30
|
-
Requires-Dist: towncrier==
|
|
30
|
+
Requires-Dist: towncrier==26.9.0
|
|
31
31
|
Requires-Dist: pyautoversion~=1.2.0
|
|
32
32
|
Requires-Dist: pdoc3==0.11.6
|
|
33
33
|
Requires-Dist: toml
|
|
@@ -38,7 +38,7 @@ Requires-Dist: boto3
|
|
|
38
38
|
Requires-Dist: detect-secrets[gibberish]==1.5.0
|
|
39
39
|
Requires-Dist: packaging
|
|
40
40
|
Requires-Dist: licenseheaders<0.8.9
|
|
41
|
-
Requires-Dist: spdx-tools==0.
|
|
41
|
+
Requires-Dist: spdx-tools==0.8.5
|
|
42
42
|
Requires-Dist: license-expression
|
|
43
43
|
Requires-Dist: wcmatch
|
|
44
44
|
Requires-Dist: jellyfish
|
|
@@ -246,8 +246,8 @@ same commands whichever CI system the team chooses.
|
|
|
246
246
|
| [`cd-get-config`](./guides/reading-project-configuration.md) | Prints a project configuration value. | Either `--key` (`-k`) or `--config-variable` (`-c`) | Developer or CI |
|
|
247
247
|
| [`cd-tag-and-release`](./guides/automating-releases.md) | Runs the release flow, including documentation, licensing summaries, Git tagging, packaging and publication through the selected [language plugin](./continuous_delivery_scripts/plugins). | Required `--release-type` (`-t`); optional `--current-branch` (`-b`) | CI release flow |
|
|
248
248
|
| [`cd-generate-docs`](./guides/generating-code-documentation.md) | Generates code documentation in the configured output directory (or one specified on the command line). | `--output_directory` | Developer preview or CI |
|
|
249
|
-
| [`cd-generate-spdx`](./guides/generating-an-spdx-sbom.md) | Generates SPDX documents and third-party licence summaries, then checks licence compliance when project metadata is available. | Required `--output-dir` (`-o`); optional `--lookup-scancode` | CI audit; developer review also possible |
|
|
250
|
-
| [`cd-check-licence-compliance`](./guides/checking-licence-compliance.md) | Checks project and dependency licences without creating SPDX documents; optionally writes third-party IP summaries. | Optional `--output-dir` (`-o`) for reports, `--lookup-scancode` | CI gate or developer review |
|
|
249
|
+
| [`cd-generate-spdx`](./guides/generating-an-spdx-sbom.md) | Generates SPDX documents and third-party licence summaries, then checks licence compliance when project metadata is available. | Required `--output-dir` (`-o`); optional `--lookup-scancode`, `--skip-dependency-download` | CI audit; developer review also possible |
|
|
250
|
+
| [`cd-check-licence-compliance`](./guides/checking-licence-compliance.md) | Checks project and dependency licences without creating SPDX documents; optionally writes third-party IP summaries. | Optional `--output-dir` (`-o`) for reports, `--lookup-scancode`, `--skip-dependency-download` | CI gate or developer review |
|
|
251
251
|
| [`cd-license-files`](./guides/licence-header-management.md) | Adds or updates source-file licence and copyright headers when the language plugin supports them. | `--verbose` (`-v`) | Developer or CI |
|
|
252
252
|
| [`cd-record-secrets`](./guides/recording-secrets.md) | Records accepted findings in the project's [detect-secrets](https://github.com/Yelp/detect-secrets) registry. | `--registry-file` (`-r`); defaults to the configured registry | Developer (registry maintenance) |
|
|
253
253
|
| [`cd-detect-secrets`](./guides/checking-for-secrets.md) | Checks Git-tracked files against that registry and fails if new secrets are found. | `--registry-file` (`-r`); defaults to the configured registry | CI; developer checks also possible |
|
|
@@ -185,8 +185,8 @@ same commands whichever CI system the team chooses.
|
|
|
185
185
|
| [`cd-get-config`](./guides/reading-project-configuration.md) | Prints a project configuration value. | Either `--key` (`-k`) or `--config-variable` (`-c`) | Developer or CI |
|
|
186
186
|
| [`cd-tag-and-release`](./guides/automating-releases.md) | Runs the release flow, including documentation, licensing summaries, Git tagging, packaging and publication through the selected [language plugin](./continuous_delivery_scripts/plugins). | Required `--release-type` (`-t`); optional `--current-branch` (`-b`) | CI release flow |
|
|
187
187
|
| [`cd-generate-docs`](./guides/generating-code-documentation.md) | Generates code documentation in the configured output directory (or one specified on the command line). | `--output_directory` | Developer preview or CI |
|
|
188
|
-
| [`cd-generate-spdx`](./guides/generating-an-spdx-sbom.md) | Generates SPDX documents and third-party licence summaries, then checks licence compliance when project metadata is available. | Required `--output-dir` (`-o`); optional `--lookup-scancode` | CI audit; developer review also possible |
|
|
189
|
-
| [`cd-check-licence-compliance`](./guides/checking-licence-compliance.md) | Checks project and dependency licences without creating SPDX documents; optionally writes third-party IP summaries. | Optional `--output-dir` (`-o`) for reports, `--lookup-scancode` | CI gate or developer review |
|
|
188
|
+
| [`cd-generate-spdx`](./guides/generating-an-spdx-sbom.md) | Generates SPDX documents and third-party licence summaries, then checks licence compliance when project metadata is available. | Required `--output-dir` (`-o`); optional `--lookup-scancode`, `--skip-dependency-download` | CI audit; developer review also possible |
|
|
189
|
+
| [`cd-check-licence-compliance`](./guides/checking-licence-compliance.md) | Checks project and dependency licences without creating SPDX documents; optionally writes third-party IP summaries. | Optional `--output-dir` (`-o`) for reports, `--lookup-scancode`, `--skip-dependency-download` | CI gate or developer review |
|
|
190
190
|
| [`cd-license-files`](./guides/licence-header-management.md) | Adds or updates source-file licence and copyright headers when the language plugin supports them. | `--verbose` (`-v`) | Developer or CI |
|
|
191
191
|
| [`cd-record-secrets`](./guides/recording-secrets.md) | Records accepted findings in the project's [detect-secrets](https://github.com/Yelp/detect-secrets) registry. | `--registry-file` (`-r`); defaults to the configured registry | Developer (registry maintenance) |
|
|
192
192
|
| [`cd-detect-secrets`](./guides/checking-for-secrets.md) | Checks Git-tracked files against that registry and fails if new secrets are found. | `--registry-file` (`-r`); defaults to the configured registry | CI; developer checks also possible |
|
|
@@ -11,8 +11,8 @@ References
|
|
|
11
11
|
This file is autogenerated, do not modify by hand.
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
|
-
__version__ = "4.4.
|
|
15
|
-
COMMIT = "
|
|
14
|
+
__version__ = "4.4.3"
|
|
15
|
+
COMMIT = "70dbd3301aab00d8e264da9869bee9df0ed7da25"
|
|
16
16
|
MAJOR = 4
|
|
17
17
|
MINOR = 4
|
|
18
|
-
PATCH =
|
|
18
|
+
PATCH = 3
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
#
|
|
5
|
+
"""Check project and dependency licences without generating SPDX documents."""
|
|
6
|
+
|
|
7
|
+
import argparse
|
|
8
|
+
import logging
|
|
9
|
+
import sys
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from typing import TYPE_CHECKING
|
|
12
|
+
|
|
13
|
+
from continuous_delivery_scripts.language_specifics import get_language_specifics
|
|
14
|
+
from continuous_delivery_scripts.spdx_report.licence_assessment import LicenceAssessment
|
|
15
|
+
from continuous_delivery_scripts.spdx_report.spdx_summary import _configured_licence_policy
|
|
16
|
+
from continuous_delivery_scripts.utils.configuration import configuration, ConfigurationVariable
|
|
17
|
+
from continuous_delivery_scripts.utils.logging import log_exception, set_log_level
|
|
18
|
+
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
|
|
21
|
+
|
|
22
|
+
logger = logging.getLogger(__name__)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _log_assessment_details(project: "SpdxProject") -> None:
|
|
26
|
+
"""Log per-dependency assessment details for statuses that need attention."""
|
|
27
|
+
if not logger.isEnabledFor(logging.WARNING):
|
|
28
|
+
return
|
|
29
|
+
attention = [
|
|
30
|
+
(name, result)
|
|
31
|
+
for name, result in sorted(project.licence_assessments.items())
|
|
32
|
+
if result.status in (LicenceAssessment.REVIEW, LicenceAssessment.UNKNOWN, LicenceAssessment.DENY)
|
|
33
|
+
]
|
|
34
|
+
if not attention:
|
|
35
|
+
return
|
|
36
|
+
logger.warning("Dependencies needing attention:")
|
|
37
|
+
for name, result in attention:
|
|
38
|
+
discovered = result.discovered_licence or result.dependency_licence
|
|
39
|
+
details = [
|
|
40
|
+
f"status={result.status.value}",
|
|
41
|
+
f"discovered_licence={discovered}",
|
|
42
|
+
f"assessed_licence={result.dependency_licence}",
|
|
43
|
+
f"rule={result.rule}",
|
|
44
|
+
f"reason={result.reason}",
|
|
45
|
+
]
|
|
46
|
+
if result.selected_licence:
|
|
47
|
+
details.append(f"selected_licence={result.selected_licence}")
|
|
48
|
+
logger.warning("- %s: %s", name, "; ".join(details))
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _print_policy_summary(project: "SpdxProject") -> None:
|
|
52
|
+
"""Print a human-readable summary of the configured licence policy and outcome."""
|
|
53
|
+
counts = {
|
|
54
|
+
status.value: sum(result.status is status for result in project.licence_assessments.values())
|
|
55
|
+
for status in LicenceAssessment
|
|
56
|
+
}
|
|
57
|
+
accepted = _configured_licence_policy()
|
|
58
|
+
fail_on = sorted(status.value for status in project.licence_assessor.policy.fail_on)
|
|
59
|
+
fail_on_incomplete = bool(configuration.get_value(ConfigurationVariable.FAIL_ON_INCOMPLETE_LICENCE_AUDIT))
|
|
60
|
+
dependency_count = len(project.dependency_documents)
|
|
61
|
+
policy_result = "PASS"
|
|
62
|
+
policy_error = None
|
|
63
|
+
try:
|
|
64
|
+
project.check_licence_compliance()
|
|
65
|
+
except Exception as error:
|
|
66
|
+
policy_result = "FAIL"
|
|
67
|
+
policy_error = error
|
|
68
|
+
|
|
69
|
+
print(f"Dependencies screened: {dependency_count}")
|
|
70
|
+
print("Accepted third-party licences: " + (", ".join(accepted) if accepted else "<none configured>"))
|
|
71
|
+
print("Assessment fail-on statuses: " + (", ".join(fail_on) if fail_on else "<disabled>"))
|
|
72
|
+
print(f"Fail on incomplete licence audit: {'enabled' if fail_on_incomplete else 'disabled'}")
|
|
73
|
+
print("Dependency licence assessment: " + ", ".join(f"{name}: {count}" for name, count in counts.items()))
|
|
74
|
+
print(f"Compliance with configured licence policy: {policy_result}")
|
|
75
|
+
if policy_error:
|
|
76
|
+
raise policy_error
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def main() -> int:
|
|
80
|
+
"""Check licence compliance and optionally write third-party IP summaries."""
|
|
81
|
+
parser = argparse.ArgumentParser(description="Check project and dependency licence compliance.")
|
|
82
|
+
parser.add_argument(
|
|
83
|
+
"-o",
|
|
84
|
+
"--output-dir",
|
|
85
|
+
type=Path,
|
|
86
|
+
help="Write third-party IP summaries to this existing directory (no SPDX documents).",
|
|
87
|
+
)
|
|
88
|
+
parser.add_argument(
|
|
89
|
+
"--lookup-scancode",
|
|
90
|
+
action="store_true",
|
|
91
|
+
help="Consult ScanCode LicenseDB for unclassified licences or missing assessment rules.",
|
|
92
|
+
)
|
|
93
|
+
parser.add_argument(
|
|
94
|
+
"--skip-dependency-download",
|
|
95
|
+
action="store_true",
|
|
96
|
+
help="Skip automatic dependency downloads before licence checks and SPDX dependency analysis.",
|
|
97
|
+
)
|
|
98
|
+
parser.add_argument("-v", "--verbose", action="count", default=0, help="Increase logging verbosity.")
|
|
99
|
+
args = parser.parse_args()
|
|
100
|
+
set_log_level(args.verbose)
|
|
101
|
+
|
|
102
|
+
try:
|
|
103
|
+
plugin = get_language_specifics()
|
|
104
|
+
if not plugin.can_get_project_metadata():
|
|
105
|
+
raise ValueError("The selected language plugin cannot provide metadata for licence compliance checks.")
|
|
106
|
+
project = plugin.get_current_spdx_project(skip_dependency_download=args.skip_dependency_download)
|
|
107
|
+
if project is None:
|
|
108
|
+
raise ValueError("The selected language plugin did not return a project for licence compliance checks.")
|
|
109
|
+
if args.lookup_scancode:
|
|
110
|
+
project.enable_scancode_lookup()
|
|
111
|
+
if args.output_dir is not None:
|
|
112
|
+
project.generate_licensing_summary(args.output_dir)
|
|
113
|
+
_print_policy_summary(project)
|
|
114
|
+
_log_assessment_details(project)
|
|
115
|
+
if args.lookup_scancode:
|
|
116
|
+
for name, result in project.licence_assessments.items():
|
|
117
|
+
for info in result.scancode_licences:
|
|
118
|
+
print(f"{name}: ScanCode LicenseDB: {info.identifier} ({info.category}): {info.url}")
|
|
119
|
+
if args.lookup_scancode:
|
|
120
|
+
for warning in project.scancode_follow_up_warnings():
|
|
121
|
+
print(f"WARNING: {warning}", file=sys.stderr)
|
|
122
|
+
return 0
|
|
123
|
+
except Exception as error:
|
|
124
|
+
log_exception(logger, error)
|
|
125
|
+
return 1
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
if __name__ == "__main__":
|
|
129
|
+
sys.exit(main())
|
|
@@ -9,7 +9,9 @@ import sys
|
|
|
9
9
|
import argparse
|
|
10
10
|
import logging
|
|
11
11
|
import os
|
|
12
|
+
import re
|
|
12
13
|
import subprocess
|
|
14
|
+
from pathlib import Path
|
|
13
15
|
from continuous_delivery_scripts.utils.versioning import calculate_version, determine_version_string
|
|
14
16
|
from typing import Optional, Tuple, Dict
|
|
15
17
|
|
|
@@ -20,6 +22,9 @@ from continuous_delivery_scripts.utils.logging import log_exception, set_log_lev
|
|
|
20
22
|
|
|
21
23
|
logger = logging.getLogger(__name__)
|
|
22
24
|
|
|
25
|
+
_MARKDOWN_CHANGELOG_SUFFIXES = {".md", ".markdown"}
|
|
26
|
+
_RELEASE_TITLE_PATTERN = re.compile(r'^"?[vV]?\d+\.\d+\.\d+[^\n]*$')
|
|
27
|
+
|
|
23
28
|
|
|
24
29
|
def version_project(commit_type: CommitType) -> Tuple[bool, Optional[str], Dict[str, str]]:
|
|
25
30
|
"""Versions the project.
|
|
@@ -50,7 +55,54 @@ def _generate_changelog(version: Optional[str], use_news_files: bool) -> None:
|
|
|
50
55
|
logger.info(":: Generating a new changelog")
|
|
51
56
|
project_config_path = configuration.get_value(ConfigurationVariable.PROJECT_CONFIG)
|
|
52
57
|
with cd(os.path.dirname(project_config_path)):
|
|
53
|
-
subprocess.check_call(["towncrier", "build", "--yes",
|
|
58
|
+
subprocess.check_call(["towncrier", "build", "--yes", "--name", "", "--version", str(version)])
|
|
59
|
+
# FIXME: Remove this workaround when https://github.com/twisted/towncrier/issues/758 is fixed.
|
|
60
|
+
_normalise_markdown_release_headings(version)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def _normalise_markdown_release_headings(version: Optional[str]) -> None:
|
|
64
|
+
"""Promote the latest markdown release title to a heading when Towncrier omits it.
|
|
65
|
+
|
|
66
|
+
Recent Towncrier markdown output renders the release title as plain text but
|
|
67
|
+
still emits section headings with leading `#`. Promote the newest release
|
|
68
|
+
title to a markdown heading and demote its section headings by one level so
|
|
69
|
+
GitHub renders the release block hierarchy correctly.
|
|
70
|
+
"""
|
|
71
|
+
if not version:
|
|
72
|
+
return
|
|
73
|
+
|
|
74
|
+
changelog_path = Path(str(configuration.get_value(ConfigurationVariable.CHANGELOG_FILE_PATH)))
|
|
75
|
+
if changelog_path.suffix.lower() not in _MARKDOWN_CHANGELOG_SUFFIXES or not changelog_path.exists():
|
|
76
|
+
return
|
|
77
|
+
|
|
78
|
+
original = changelog_path.read_text(encoding="utf8")
|
|
79
|
+
lines = original.splitlines()
|
|
80
|
+
version_index = next(
|
|
81
|
+
(index for index, line in enumerate(lines) if line.startswith(f"{version} ") and not line.startswith("#")),
|
|
82
|
+
None,
|
|
83
|
+
)
|
|
84
|
+
if version_index is None:
|
|
85
|
+
return
|
|
86
|
+
|
|
87
|
+
next_release_index = next(
|
|
88
|
+
(
|
|
89
|
+
index
|
|
90
|
+
for index in range(version_index + 1, len(lines))
|
|
91
|
+
if _RELEASE_TITLE_PATTERN.match(lines[index]) and not lines[index].startswith("#")
|
|
92
|
+
),
|
|
93
|
+
len(lines),
|
|
94
|
+
)
|
|
95
|
+
section_indexes = [index for index in range(version_index + 1, next_release_index) if lines[index].startswith("# ")]
|
|
96
|
+
if not section_indexes:
|
|
97
|
+
return
|
|
98
|
+
|
|
99
|
+
lines[version_index] = f"# {lines[version_index]}"
|
|
100
|
+
for index in section_indexes:
|
|
101
|
+
lines[index] = f"#{lines[index]}"
|
|
102
|
+
|
|
103
|
+
rendered = "\n".join(lines) + ("\n" if original.endswith("\n") else "")
|
|
104
|
+
if rendered != original:
|
|
105
|
+
changelog_path.write_text(rendered, encoding="utf8")
|
|
54
106
|
|
|
55
107
|
|
|
56
108
|
def main() -> None:
|
|
@@ -20,6 +20,13 @@ usable `go-licenses` binary on `PATH` before installing
|
|
|
20
20
|
must be available; an installed binary can also be located under `GOBIN` or
|
|
21
21
|
the first `GOPATH` entry's `bin` directory.
|
|
22
22
|
|
|
23
|
+
For licence and SPDX analysis, the plugin also runs `go mod download all` for
|
|
24
|
+
each detected Go module by default so callers do not need a separate dependency
|
|
25
|
+
prefetch step. If your environment already downloads dependencies and you want
|
|
26
|
+
to skip that work, use `--skip-dependency-download` on
|
|
27
|
+
`cd-check-licence-compliance` or `cd-generate-spdx`, or set
|
|
28
|
+
`SKIP_DEPENDENCY_DOWNLOAD_FOR_LICENSING = true` in configuration.
|
|
29
|
+
|
|
23
30
|
Set `PROGRAMMING_LANGUAGE = "golang"`, `PROJECT_NAME`, `PROJECT_ROOT` and
|
|
24
31
|
`SOURCE_DIR` in `[ProjectConfig]`. Put a `go.mod` under the source or project
|
|
25
32
|
root; `go.work` modules and nested Go modules are also considered. Supply
|
|
@@ -27,7 +34,7 @@ root; `go.work` modules and nested Go modules are also considered. Supply
|
|
|
27
34
|
and `[spdx]` namespace fields as explained in the
|
|
28
35
|
[SPDX configuration guide](../../DEVELOPMENT.md#spdx-document-identity).
|
|
29
36
|
|
|
30
|
-
With the project
|
|
37
|
+
With the project available, run:
|
|
31
38
|
|
|
32
39
|
```bash
|
|
33
40
|
mkdir -p licensing
|
|
@@ -17,8 +17,10 @@ The plugin uses [pdoc](https://pdoc3.github.io/pdoc/) to generate the code refer
|
|
|
17
17
|
|
|
18
18
|
The Python plugin reads metadata from the **installed** project distribution and
|
|
19
19
|
walks its `Requires-Dist` entries to find installed, transitive dependencies.
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
Install the dependencies you intend to audit, then run the audit in that
|
|
21
|
+
environment; the plugin does not install packages itself. This is deliberate:
|
|
22
|
+
Python projects can define dependencies in many different ways, so CDS cannot
|
|
23
|
+
reliably infer and reproduce the intended audit environment automatically.
|
|
22
24
|
|
|
23
25
|
> **Warning — platform limitation:** The audit only sees dependencies installed
|
|
24
26
|
> for the current platform and Python version. It does **not** inspect
|
|
@@ -51,6 +51,6 @@ class Basic(BaseLanguage):
|
|
|
51
51
|
"""States whether project metadata can be retrieved."""
|
|
52
52
|
return False
|
|
53
53
|
|
|
54
|
-
def get_current_spdx_project(self) -> Optional["SpdxProject"]:
|
|
54
|
+
def get_current_spdx_project(self, skip_dependency_download: bool = False) -> Optional["SpdxProject"]:
|
|
55
55
|
"""Basic."""
|
|
56
56
|
return None
|
|
@@ -61,7 +61,7 @@ class CI(BaseLanguage):
|
|
|
61
61
|
"""States whether project metadata can be retrieved."""
|
|
62
62
|
return False
|
|
63
63
|
|
|
64
|
-
def get_current_spdx_project(self) -> Optional["SpdxProject"]:
|
|
64
|
+
def get_current_spdx_project(self, skip_dependency_download: bool = False) -> Optional["SpdxProject"]:
|
|
65
65
|
"""Gets current SPDX description."""
|
|
66
66
|
# TODO
|
|
67
67
|
return None
|
|
@@ -53,7 +53,7 @@ class Docker(BaseLanguage):
|
|
|
53
53
|
"""States whether project metadata can be retrieved."""
|
|
54
54
|
return False
|
|
55
55
|
|
|
56
|
-
def get_current_spdx_project(self) -> Optional["SpdxProject"]:
|
|
56
|
+
def get_current_spdx_project(self, skip_dependency_download: bool = False) -> Optional["SpdxProject"]:
|
|
57
57
|
"""Gets current SPDX description."""
|
|
58
58
|
# TODO
|
|
59
59
|
return None
|
|
@@ -10,10 +10,11 @@ import json
|
|
|
10
10
|
import logging
|
|
11
11
|
import os
|
|
12
12
|
import shutil
|
|
13
|
+
from contextlib import contextmanager
|
|
13
14
|
from pathlib import Path
|
|
14
|
-
from subprocess import check_call, check_output
|
|
15
|
+
from subprocess import check_call, check_output, run, CalledProcessError
|
|
15
16
|
from tempfile import TemporaryDirectory
|
|
16
|
-
from typing import Optional, List, Dict, MutableMapping
|
|
17
|
+
from typing import Optional, List, Dict, MutableMapping, Iterator
|
|
17
18
|
|
|
18
19
|
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
|
|
19
20
|
from continuous_delivery_scripts.utils.configuration import (
|
|
@@ -43,15 +44,18 @@ ROOT_DIR = Path(str(configuration.get_value(ConfigurationVariable.PROJECT_ROOT))
|
|
|
43
44
|
ENVVAR_GORELEASER_GIT_TOKEN = "GITHUB_TOKEN"
|
|
44
45
|
ENVVAR_GORELEASER_CUSTOMISED_TAG = "GORELEASER_CURRENT_TAG"
|
|
45
46
|
ENVVAR_GO_MOD = "GO111MODULE"
|
|
47
|
+
ENVVAR_GO_WORK = "GOWORK"
|
|
46
48
|
GO_MOD_ON_VALUE = "on"
|
|
49
|
+
GO_WORK_OFF_VALUE = "off"
|
|
47
50
|
# go-licenses report --template receives Name, Version, LicenseURL and LicenseName for each library.
|
|
48
51
|
# https://github.com/google/go-licenses/blob/master/README.md#reports-with-custom-templates
|
|
49
52
|
GO_LICENSES_TEMPLATE = "{{range .}}{{.Name}}\t{{.Version}}\t{{.LicenseURL}}\t{{.LicenseName}}\n{{end}}"
|
|
53
|
+
LICENCE_FILE_PREFIXES = ("LICENSE", "LICENCE", "COPYING")
|
|
50
54
|
|
|
51
55
|
|
|
52
|
-
def _generate_doc2go_command_list(output_directory: Path, module: str) -> List[str]:
|
|
56
|
+
def _generate_doc2go_command_list(executable: str, output_directory: Path, module: str) -> List[str]:
|
|
53
57
|
return [
|
|
54
|
-
|
|
58
|
+
executable,
|
|
55
59
|
"-out",
|
|
56
60
|
str(output_directory),
|
|
57
61
|
f"{module}",
|
|
@@ -129,10 +133,35 @@ def _go_licence_module_directories() -> List[Path]:
|
|
|
129
133
|
|
|
130
134
|
def _go_module_name(module_dir: Path, env: MutableMapping[str, str]) -> str:
|
|
131
135
|
"""Read the import path declared by a Go module."""
|
|
132
|
-
|
|
136
|
+
# `go list -m -json` emits one JSON document per main module when a go.work
|
|
137
|
+
# workspace is active. Disable workspace mode here so CDS always reads the
|
|
138
|
+
# module declared by `module_dir` rather than the whole workspace.
|
|
139
|
+
module_env = dict(env)
|
|
140
|
+
module_env[ENVVAR_GO_WORK] = GO_WORK_OFF_VALUE
|
|
141
|
+
module = json.loads(check_output(["go", "list", "-m", "-json"], cwd=module_dir, env=module_env, encoding="utf8"))
|
|
133
142
|
return str(module["Path"])
|
|
134
143
|
|
|
135
144
|
|
|
145
|
+
def _download_go_module_dependencies(module_directories: List[Path], env: MutableMapping[str, str]) -> None:
|
|
146
|
+
"""Download Go dependencies for each detected module.
|
|
147
|
+
|
|
148
|
+
`go-licenses` expects the module graph to be available locally. Fetching the
|
|
149
|
+
dependencies here means callers do not need a separate CI step before
|
|
150
|
+
running `cd-check-licence-compliance` or `cd-generate-spdx`.
|
|
151
|
+
"""
|
|
152
|
+
for module_directory in module_directories:
|
|
153
|
+
logger.info("Downloading Go module dependencies in [%s].", module_directory)
|
|
154
|
+
check_call(["go", "mod", "download", "all"], cwd=module_directory, env=env)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
def _should_download_go_module_dependencies() -> bool:
|
|
158
|
+
"""Return whether Go module dependencies should be prefetched automatically."""
|
|
159
|
+
configured = configuration.get_value_or_default(ConfigurationVariable.SKIP_DEPENDENCY_DOWNLOAD_FOR_LICENSING, False)
|
|
160
|
+
if isinstance(configured, str):
|
|
161
|
+
configured = configured.strip().lower() in ("true", "1", "yes", "on")
|
|
162
|
+
return not bool(configured)
|
|
163
|
+
|
|
164
|
+
|
|
136
165
|
def _parse_go_licences(output: str) -> List[PackageMetadata]:
|
|
137
166
|
"""Translate go-licenses template output into shared package metadata."""
|
|
138
167
|
packages = []
|
|
@@ -156,18 +185,88 @@ def _parse_go_licences(output: str) -> List[PackageMetadata]:
|
|
|
156
185
|
return packages
|
|
157
186
|
|
|
158
187
|
|
|
188
|
+
def _log_go_licenses_stderr(module_dir: Path, stderr_output: str) -> None:
|
|
189
|
+
"""Report go-licenses diagnostics through CDS logging instead of leaking raw stderr."""
|
|
190
|
+
diagnostics = stderr_output.strip()
|
|
191
|
+
if not diagnostics:
|
|
192
|
+
return
|
|
193
|
+
logger.warning(
|
|
194
|
+
"go-licenses emitted diagnostics while scanning [%s]. Re-run with -vv for the captured stderr.",
|
|
195
|
+
module_dir,
|
|
196
|
+
)
|
|
197
|
+
logger.info("go-licenses stderr for [%s]:\n%s", module_dir, diagnostics)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def _run_go_licenses_report(
|
|
201
|
+
executable: str, module_dir: Path, template_path: Path, env: MutableMapping[str, str]
|
|
202
|
+
) -> str:
|
|
203
|
+
"""Run go-licenses with captured stderr so CDS controls when diagnostics are shown."""
|
|
204
|
+
result = run(
|
|
205
|
+
[executable, "report", "./...", "--template", str(template_path)],
|
|
206
|
+
cwd=module_dir,
|
|
207
|
+
env=env,
|
|
208
|
+
encoding="utf8",
|
|
209
|
+
capture_output=True,
|
|
210
|
+
check=False,
|
|
211
|
+
)
|
|
212
|
+
_log_go_licenses_stderr(module_dir, result.stderr)
|
|
213
|
+
if result.returncode != 0:
|
|
214
|
+
error_message = result.stderr.strip() or result.stdout.strip() or f"exit code {result.returncode}"
|
|
215
|
+
raise CalledProcessError(result.returncode, result.args, output=result.stdout, stderr=error_message)
|
|
216
|
+
return result.stdout
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def _find_licence_file(directory: Path) -> Optional[Path]:
|
|
220
|
+
"""Return the first recognised licence file in a directory."""
|
|
221
|
+
for path in sorted(directory.iterdir()):
|
|
222
|
+
if path.is_file() and path.name.upper().startswith(LICENCE_FILE_PREFIXES):
|
|
223
|
+
return path
|
|
224
|
+
return None
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
@contextmanager
|
|
228
|
+
def _stage_root_licence_files_for_modules(module_directories: List[Path]) -> Iterator[None]:
|
|
229
|
+
"""Temporarily copy the root licence into module directories that do not already have one."""
|
|
230
|
+
root_licence_file = _find_licence_file(ROOT_DIR)
|
|
231
|
+
if not root_licence_file:
|
|
232
|
+
yield
|
|
233
|
+
return
|
|
234
|
+
|
|
235
|
+
staged_files: List[Path] = []
|
|
236
|
+
try:
|
|
237
|
+
for module_directory in module_directories:
|
|
238
|
+
if module_directory == ROOT_DIR or _find_licence_file(module_directory):
|
|
239
|
+
continue
|
|
240
|
+
# go-licenses only searches for licence files up to the module root, so
|
|
241
|
+
# nested modules cannot see a repository-level LICENSE on their own.
|
|
242
|
+
destination = module_directory / root_licence_file.name
|
|
243
|
+
shutil.copy2(root_licence_file, destination)
|
|
244
|
+
staged_files.append(destination)
|
|
245
|
+
yield
|
|
246
|
+
finally:
|
|
247
|
+
# Remove only the temporary copies we created so existing module-specific
|
|
248
|
+
# licence files remain untouched and the worktree stays clean.
|
|
249
|
+
for staged_file in staged_files:
|
|
250
|
+
staged_file.unlink(missing_ok=True)
|
|
251
|
+
|
|
252
|
+
|
|
159
253
|
class GoProjectMetadataFetcher(ProjectMetadataFetcher):
|
|
160
254
|
"""Retrieve Go dependency licences for the shared SPDX and compliance report."""
|
|
161
255
|
|
|
162
|
-
def __init__(self) -> None:
|
|
256
|
+
def __init__(self, skip_dependency_download: bool = False) -> None:
|
|
163
257
|
"""Initialise with the configured project name."""
|
|
164
258
|
super().__init__(str(configuration.get_value(ConfigurationVariable.PROJECT_NAME)))
|
|
259
|
+
self._skip_dependency_download = skip_dependency_download
|
|
165
260
|
|
|
166
261
|
def fetch_project_metadata(self) -> ProjectMetadata:
|
|
167
262
|
"""Collect module dependencies using go-licenses without replacing shared policy checks."""
|
|
168
263
|
module_directories = _go_licence_module_directories()
|
|
169
264
|
env = os.environ.copy()
|
|
170
265
|
env[ENVVAR_GO_MOD] = GO_MOD_ON_VALUE
|
|
266
|
+
if not self._skip_dependency_download and _should_download_go_module_dependencies():
|
|
267
|
+
_download_go_module_dependencies(module_directories, env)
|
|
268
|
+
else:
|
|
269
|
+
logger.info("Skipping Go module dependency downloads before licence analysis by configuration.")
|
|
171
270
|
executable = _ensure_go_tool_installed(
|
|
172
271
|
tool_name="go-licenses",
|
|
173
272
|
version_command=["go-licenses", "report", "--help"],
|
|
@@ -185,29 +284,25 @@ class GoProjectMetadataFetcher(ProjectMetadataFetcher):
|
|
|
185
284
|
with TemporaryDirectory() as temporary_dir:
|
|
186
285
|
template_path = Path(temporary_dir) / "go-licenses.tpl"
|
|
187
286
|
template_path.write_text(GO_LICENSES_TEMPLATE, encoding="utf8")
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
licence_evidence=existing.licence_evidence + package.licence_evidence,
|
|
208
|
-
)
|
|
209
|
-
elif existing is None:
|
|
210
|
-
dependencies[package.name] = package
|
|
287
|
+
with _stage_root_licence_files_for_modules(module_directories):
|
|
288
|
+
for module_dir, _ in modules:
|
|
289
|
+
output = _run_go_licenses_report(executable, module_dir, template_path, env)
|
|
290
|
+
for package in _parse_go_licences(output):
|
|
291
|
+
if any(package.name == name or package.name.startswith(f"{name}/") for _, name in modules):
|
|
292
|
+
continue
|
|
293
|
+
existing = dependencies.get(package.name)
|
|
294
|
+
if existing and (existing.version, existing.licence) != (package.version, package.licence):
|
|
295
|
+
candidates = existing.licence_candidates or [existing.licence]
|
|
296
|
+
dependencies[package.name] = PackageMetadata.from_fields(
|
|
297
|
+
name=package.name,
|
|
298
|
+
version=UNKNOWN if existing.version != package.version else package.version,
|
|
299
|
+
licence=UNKNOWN,
|
|
300
|
+
licence_source=LicenceSource.UNKNOWN,
|
|
301
|
+
licence_candidates=sorted(set(candidates + [package.licence])),
|
|
302
|
+
licence_evidence=existing.licence_evidence + package.licence_evidence,
|
|
303
|
+
)
|
|
304
|
+
elif existing is None:
|
|
305
|
+
dependencies[package.name] = package
|
|
211
306
|
for dependency in dependencies.values():
|
|
212
307
|
project.add_dependency_metadata(dependency)
|
|
213
308
|
return project
|
|
@@ -238,7 +333,7 @@ def _call_doc2go(output_directory: Path, module: str) -> None:
|
|
|
238
333
|
"""Call doc2go for generating the docs."""
|
|
239
334
|
env = os.environ
|
|
240
335
|
env[ENVVAR_GO_MOD] = GO_MOD_ON_VALUE
|
|
241
|
-
_ensure_go_tool_installed(
|
|
336
|
+
executable = _ensure_go_tool_installed(
|
|
242
337
|
tool_name="doc2go",
|
|
243
338
|
version_command=["doc2go", "-version"],
|
|
244
339
|
install_command=_install_doc2go_command_list(),
|
|
@@ -246,13 +341,11 @@ def _call_doc2go(output_directory: Path, module: str) -> None:
|
|
|
246
341
|
)
|
|
247
342
|
logger.info("Creating Code documentation.")
|
|
248
343
|
logger.info("Running doc2go over [%s] in [%s].", module, SRC_DIR)
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
# )
|
|
255
|
-
logger.warning("Currently not running doc2go")
|
|
344
|
+
check_call(
|
|
345
|
+
_generate_doc2go_command_list(executable, output_directory, module),
|
|
346
|
+
cwd=str(SRC_DIR),
|
|
347
|
+
env=env,
|
|
348
|
+
)
|
|
256
349
|
|
|
257
350
|
|
|
258
351
|
def _call_goreleaser_check(version: str) -> None:
|
|
@@ -401,9 +494,9 @@ class Go(BaseLanguage):
|
|
|
401
494
|
(r"^\.github[\\/]workflows[\\/].*"),
|
|
402
495
|
]
|
|
403
496
|
|
|
404
|
-
def get_current_spdx_project(self) -> Optional[SpdxProject]:
|
|
497
|
+
def get_current_spdx_project(self, skip_dependency_download: bool = False) -> Optional[SpdxProject]:
|
|
405
498
|
"""Gets current SPDX description."""
|
|
406
|
-
return SpdxProject(GoProjectMetadataFetcher())
|
|
499
|
+
return SpdxProject(GoProjectMetadataFetcher(skip_dependency_download=skip_dependency_download))
|
|
407
500
|
|
|
408
501
|
def should_clean_before_packaging(self) -> bool:
|
|
409
502
|
"""States whether the repository must be cleaned before packaging happens."""
|
|
@@ -53,7 +53,7 @@ class NoOp(BaseLanguage):
|
|
|
53
53
|
"""States whether project metadata can be retrieved."""
|
|
54
54
|
return False
|
|
55
55
|
|
|
56
|
-
def get_current_spdx_project(self) -> Optional["SpdxProject"]:
|
|
56
|
+
def get_current_spdx_project(self, skip_dependency_download: bool = False) -> Optional["SpdxProject"]:
|
|
57
57
|
"""No Op."""
|
|
58
58
|
return None
|
|
59
59
|
|
|
@@ -198,6 +198,6 @@ class Python(BaseLanguage):
|
|
|
198
198
|
# FIXME Comment out SPDX package as no longer working
|
|
199
199
|
return False
|
|
200
200
|
|
|
201
|
-
def get_current_spdx_project(self) -> Optional["SpdxProject"]:
|
|
201
|
+
def get_current_spdx_project(self, skip_dependency_download: bool = False) -> Optional["SpdxProject"]:
|
|
202
202
|
"""Gets the current SPDX description."""
|
|
203
203
|
return _get_current_spdx_project()
|
|
@@ -36,9 +36,11 @@ def generate_spdx_project_reports(project: "SpdxProject", output_directory: Path
|
|
|
36
36
|
return project
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
def generate_spdx_reports(
|
|
39
|
+
def generate_spdx_reports(
|
|
40
|
+
output_directory: Path, lookup_scancode: bool = False, skip_dependency_download: bool = False
|
|
41
|
+
) -> Optional["SpdxProject"]:
|
|
40
42
|
"""Generates all the SPDX reports for the current project."""
|
|
41
|
-
project = get_language_specifics().get_current_spdx_project()
|
|
43
|
+
project = get_language_specifics().get_current_spdx_project(skip_dependency_download=skip_dependency_download)
|
|
42
44
|
if not project:
|
|
43
45
|
return None
|
|
44
46
|
if lookup_scancode:
|
|
@@ -66,6 +68,11 @@ def main() -> int:
|
|
|
66
68
|
action="store_true",
|
|
67
69
|
help="Consult ScanCode LicenseDB for unclassified licences or missing assessment rules.",
|
|
68
70
|
)
|
|
71
|
+
parser.add_argument(
|
|
72
|
+
"--skip-dependency-download",
|
|
73
|
+
action="store_true",
|
|
74
|
+
help="Skip automatic dependency downloads before licence checks and SPDX dependency analysis.",
|
|
75
|
+
)
|
|
69
76
|
|
|
70
77
|
parser.add_argument(
|
|
71
78
|
"-v",
|
|
@@ -79,7 +86,11 @@ def main() -> int:
|
|
|
79
86
|
|
|
80
87
|
try:
|
|
81
88
|
if get_language_specifics().can_get_project_metadata():
|
|
82
|
-
project = generate_spdx_reports(
|
|
89
|
+
project = generate_spdx_reports(
|
|
90
|
+
args.output_dir,
|
|
91
|
+
lookup_scancode=args.lookup_scancode,
|
|
92
|
+
skip_dependency_download=args.skip_dependency_download,
|
|
93
|
+
)
|
|
83
94
|
if project:
|
|
84
95
|
project.check_licence_compliance()
|
|
85
96
|
if args.lookup_scancode:
|