continuous-delivery-scripts 4.5.0__tar.gz → 4.6.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-4.5.0 → continuous_delivery_scripts-4.6.0}/LICENSE +27 -0
- {continuous_delivery_scripts-4.5.0/continuous_delivery_scripts.egg-info → continuous_delivery_scripts-4.6.0}/PKG-INFO +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/_version.py +3 -3
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/check_licence_compliance.py +6 -0
- continuous_delivery_scripts-4.6.0/continuous_delivery_scripts/describe_licence_obligations.py +34 -0
- continuous_delivery_scripts-4.6.0/continuous_delivery_scripts/spdx_report/project_licensing.py +469 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/spdx_report/spdx_helpers.py +1 -2
- continuous_delivery_scripts-4.6.0/continuous_delivery_scripts/spdx_report/templates/licence_obligations_report.txt.jinja2 +24 -0
- continuous_delivery_scripts-4.6.0/continuous_delivery_scripts/sync_project_licence.py +41 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/configuration.py +3 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/third_party_licences.py +6 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0/continuous_delivery_scripts.egg-info}/PKG-INFO +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts.egg-info/SOURCES.txt +4 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts.egg-info/entry_points.txt +2 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/setup.py +2 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/GitPython.spdx +5 -5
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/Jinja2.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/Mako.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/Markdown.spdx +4 -4
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/MarkupSafe.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/PyYAML.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/Pygments.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/SecretStorage.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/beartype.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/boolean.py.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/boto3.spdx +4 -4
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/botocore.spdx +4 -4
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/bracex.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/certifi.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/cffi.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/charset-normalizer.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/click.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/continuous-delivery-scripts.spdx +118 -82
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/cryptography.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/detect-secrets.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/docutils.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/gibberish-detector.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/gitdb.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/id.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/idna.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/jaraco.classes.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/jaraco.context.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/jaraco.functools.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/jeepney.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/jellyfish.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/jmespath.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/keyring.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/license-expression.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/licenseheaders.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/markdown-it-py.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/mdurl.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/more-itertools.spdx +4 -4
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/nh3.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/packaging.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/pdoc3.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/ply.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/pyautoversion.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/pycparser.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/pyparsing.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/python-dateutil.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/python-dotenv.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/rdflib.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/readme_renderer.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/regex.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/requests-toolbelt.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/requests.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/rfc3986.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/rich.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/s3transfer.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/semantic-version.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/semver.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/setuptools.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/six.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/smmap.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/spdx-tools.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/toml.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/towncrier.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/twine.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/uritools.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/urllib3.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/wcmatch.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/spdx-tmp/xmltodict.spdx +1 -1
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/MANIFEST.in +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/README.md +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/__init__.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/assert_news.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/create_news_file.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/detect_secrets.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/generate_docs.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/generate_news.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/get_config.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/get_version.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/language_specifics.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/license_files.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/plugins/BASIC.MD +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/plugins/CI.MD +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/plugins/GITHUB_ACTIONS.MD +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/plugins/GOLAND.MD +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/plugins/NOOP.MD +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/plugins/PYTHON.MD +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/plugins/__init__.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/plugins/basic.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/plugins/ci.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/plugins/docker.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/plugins/github_actions.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/plugins/golang.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/plugins/noop.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/plugins/python.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/report_third_party_ip.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/spdx_report/__init__.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/spdx_report/data/licence_assessment.toml +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/spdx_report/licence_assessment.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/spdx_report/scancode_licence_db.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/spdx_report/spdx_dependency.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/spdx_report/spdx_document.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/spdx_report/spdx_file.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/spdx_report/spdx_package.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/spdx_report/spdx_project.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/spdx_report/spdx_summary.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/spdx_report/templates/third_party_IP_report.csv.jinja2 +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/spdx_report/templates/third_party_IP_report.html.jinja2 +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/spdx_report/templates/third_party_IP_report.txt.jinja2 +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/tag_and_release.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/templates/documentation_landing.html.jinja2 +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/templates/documentation_page.html.jinja2 +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/templates/llms-full.txt.jinja2 +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/templates/llms.txt.jinja2 +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/templates/robots.txt.jinja2 +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/update_secrets_registry.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/__init__.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/aws_helpers.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/changelog.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/definitions.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/documentation_discovery.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/documentation_templates.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/filesystem_helpers.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/git_helpers.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/github_helpers.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/hash_helpers.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/language_specifics_base.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/logging.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/news_file.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/noop/__init__.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/noop/package_helpers.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/package_helpers.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/python/__init__.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/python/package_helpers.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/python/python_helpers.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/string_helpers.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts/utils/versioning.py +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts.egg-info/dependency_links.txt +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts.egg-info/requires.txt +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/continuous_delivery_scripts.egg-info/top_level.txt +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/pyproject.toml +0 -0
- {continuous_delivery_scripts-4.5.0 → continuous_delivery_scripts-4.6.0}/setup.cfg +0 -0
|
@@ -172,3 +172,30 @@
|
|
|
172
172
|
defend, and hold each Contributor harmless for any liability
|
|
173
173
|
incurred by, or claims asserted against, such Contributor by reason
|
|
174
174
|
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -11,8 +11,8 @@ References
|
|
|
11
11
|
This file is autogenerated, do not modify by hand.
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
|
-
__version__ = "4.
|
|
15
|
-
COMMIT = "
|
|
14
|
+
__version__ = "4.6.0"
|
|
15
|
+
COMMIT = "307ede6cfe5aa47c08855bd156d2496109cecdb6"
|
|
16
16
|
MAJOR = 4
|
|
17
|
-
MINOR =
|
|
17
|
+
MINOR = 6
|
|
18
18
|
PATCH = 0
|
|
@@ -12,6 +12,10 @@ from typing import TYPE_CHECKING
|
|
|
12
12
|
|
|
13
13
|
from continuous_delivery_scripts.language_specifics import get_language_specifics
|
|
14
14
|
from continuous_delivery_scripts.spdx_report.licence_assessment import LicenceAssessment
|
|
15
|
+
from continuous_delivery_scripts.spdx_report.project_licensing import (
|
|
16
|
+
ensure_project_licence_file_conforms,
|
|
17
|
+
has_single_project_licence_identifier,
|
|
18
|
+
)
|
|
15
19
|
from continuous_delivery_scripts.spdx_report.spdx_summary import _configured_licence_policy
|
|
16
20
|
from continuous_delivery_scripts.utils.configuration import configuration, ConfigurationVariable
|
|
17
21
|
from continuous_delivery_scripts.utils.logging import log_exception, set_log_level
|
|
@@ -100,6 +104,8 @@ def main() -> int:
|
|
|
100
104
|
set_log_level(args.verbose)
|
|
101
105
|
|
|
102
106
|
try:
|
|
107
|
+
if has_single_project_licence_identifier():
|
|
108
|
+
ensure_project_licence_file_conforms(create_if_missing=False)
|
|
103
109
|
plugin = get_language_specifics()
|
|
104
110
|
if not plugin.can_get_project_metadata():
|
|
105
111
|
raise ValueError("The selected language plugin cannot provide metadata for licence compliance checks.")
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
"""Describe project licence obligations from public SPDX and OSADL sources."""
|
|
6
|
+
|
|
7
|
+
import argparse
|
|
8
|
+
import logging
|
|
9
|
+
import sys
|
|
10
|
+
|
|
11
|
+
from continuous_delivery_scripts.spdx_report.project_licensing import (
|
|
12
|
+
describe_licence_obligations,
|
|
13
|
+
)
|
|
14
|
+
from continuous_delivery_scripts.utils.logging import log_exception, set_log_level
|
|
15
|
+
|
|
16
|
+
logger = logging.getLogger(__name__)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def main() -> int:
|
|
20
|
+
"""Create a CLI for describing project licence obligations."""
|
|
21
|
+
parser = argparse.ArgumentParser(description="Describe licence obligations from SPDX and OSADL data.")
|
|
22
|
+
parser.add_argument("-v", "--verbose", action="count", default=0, help="Increase logging verbosity.")
|
|
23
|
+
args = parser.parse_args()
|
|
24
|
+
set_log_level(args.verbose)
|
|
25
|
+
try:
|
|
26
|
+
print(describe_licence_obligations(), end="")
|
|
27
|
+
return 0
|
|
28
|
+
except Exception as error:
|
|
29
|
+
log_exception(logger, error)
|
|
30
|
+
return 1
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
if __name__ == "__main__":
|
|
34
|
+
sys.exit(main())
|
continuous_delivery_scripts-4.6.0/continuous_delivery_scripts/spdx_report/project_licensing.py
ADDED
|
@@ -0,0 +1,469 @@
|
|
|
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
|
+
"""Project-level licence fetching, validation, and obligations reporting.
|
|
6
|
+
|
|
7
|
+
References:
|
|
8
|
+
- SPDX licence list and JSON details: https://spdx.org/licenses/
|
|
9
|
+
- SPDX licence expression guidance: https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/
|
|
10
|
+
- SPDX matching guidance: https://spdx.github.io/spdx-spec/v2.3/license-matching-guidelines-and-templates/
|
|
11
|
+
- ScanCode LicenseDB: https://scancode-licensedb.aboutcode.org/
|
|
12
|
+
- GitHub licences API: https://docs.github.com/en/rest/licenses/licenses
|
|
13
|
+
- choosealicense.com: https://choosealicense.com/
|
|
14
|
+
- OSADL licence obligations checklists: https://www.osadl.org/License-Checklists.oss-compliance-lists.0.html
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
import html
|
|
18
|
+
import json
|
|
19
|
+
import jinja2
|
|
20
|
+
import logging
|
|
21
|
+
import re
|
|
22
|
+
from difflib import unified_diff
|
|
23
|
+
from dataclasses import dataclass
|
|
24
|
+
from pathlib import Path
|
|
25
|
+
from typing import Dict, Iterable, Optional, cast
|
|
26
|
+
from urllib.error import HTTPError, URLError
|
|
27
|
+
from urllib.request import Request, urlopen
|
|
28
|
+
|
|
29
|
+
from continuous_delivery_scripts.spdx_report.scancode_licence_db import ScanCodeLicenceDB
|
|
30
|
+
from continuous_delivery_scripts.utils.configuration import ConfigurationVariable, configuration
|
|
31
|
+
from continuous_delivery_scripts.utils.third_party_licences import (
|
|
32
|
+
LICENSE_REF_PROPRIETARY,
|
|
33
|
+
OPENSOURCE_LICENCES,
|
|
34
|
+
is_proprietary_licence,
|
|
35
|
+
normalise_proprietary_licence,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
logger = logging.getLogger(__name__)
|
|
39
|
+
|
|
40
|
+
REQUEST_TIMEOUT = 10
|
|
41
|
+
MAX_RESPONSE_SIZE = 4 * 1024 * 1024
|
|
42
|
+
USER_AGENT = "continuous-delivery-scripts"
|
|
43
|
+
SCANCODE_DB = ScanCodeLicenceDB()
|
|
44
|
+
JINJA_TEMPLATE_LICENCE_OBLIGATIONS_TEXT = "licence_obligations_report.txt.jinja2"
|
|
45
|
+
SCANCODE_TEXT_KEY = "text"
|
|
46
|
+
SPDX_NAME_KEY = "name"
|
|
47
|
+
SPDX_IS_OSI_APPROVED_KEY = "isOsiApproved"
|
|
48
|
+
SPDX_LICENSE_TEXT_KEY = "licenseText"
|
|
49
|
+
GITHUB_BODY_KEY = "body"
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@dataclass(frozen=True)
|
|
53
|
+
class RetrievedProjectLicenceText:
|
|
54
|
+
"""Text fetched for a project licence file from a public source.
|
|
55
|
+
|
|
56
|
+
The text may come from ScanCode LicenseDB, SPDX.org, the GitHub licences
|
|
57
|
+
API, or choosealicense.com.
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
identifier: str
|
|
61
|
+
text: str
|
|
62
|
+
source: str
|
|
63
|
+
url: str
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@dataclass(frozen=True)
|
|
67
|
+
class ChooseALicenseMetadata:
|
|
68
|
+
"""Summary information exposed by choosealicense.com.
|
|
69
|
+
|
|
70
|
+
Reference: https://choosealicense.com/
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
summary: Optional[str]
|
|
74
|
+
permissions: tuple[str, ...]
|
|
75
|
+
conditions: tuple[str, ...]
|
|
76
|
+
limitations: tuple[str, ...]
|
|
77
|
+
text: Optional[str]
|
|
78
|
+
url: Optional[str]
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def get_project_licence_identifier(identifier: Optional[str] = None) -> str:
|
|
82
|
+
"""Return the project's single SPDX licence identifier.
|
|
83
|
+
|
|
84
|
+
This helper accepts one exact SPDX identifier only. Compound expressions are
|
|
85
|
+
intentionally rejected for commands whose output assumes one canonical text
|
|
86
|
+
or one obligations profile.
|
|
87
|
+
|
|
88
|
+
References:
|
|
89
|
+
- https://spdx.org/licenses/
|
|
90
|
+
- https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/
|
|
91
|
+
"""
|
|
92
|
+
raw_identifier: str = identifier or str(configuration.get_value(ConfigurationVariable.FILE_LICENCE_IDENTIFIER))
|
|
93
|
+
normalised_identifier: str = normalise_proprietary_licence(raw_identifier.strip())
|
|
94
|
+
if is_proprietary_licence(raw_identifier):
|
|
95
|
+
return normalised_identifier
|
|
96
|
+
if not has_single_project_licence_identifier(raw_identifier):
|
|
97
|
+
raise ValueError(
|
|
98
|
+
"This command only covers one exact SPDX licence identifier and does not cover "
|
|
99
|
+
"compound licence expressions such as AND, OR, or WITH."
|
|
100
|
+
)
|
|
101
|
+
licence = OPENSOURCE_LICENCES.get_licence(normalised_identifier, allow_fuzzy=False)
|
|
102
|
+
if not licence or licence.identifier != normalised_identifier:
|
|
103
|
+
raise ValueError(f"'{normalised_identifier}' is not a recognised SPDX licence identifier.")
|
|
104
|
+
return normalised_identifier
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def has_single_project_licence_identifier(identifier: Optional[str] = None) -> bool:
|
|
108
|
+
"""Return whether the configured project licence is one exact identifier.
|
|
109
|
+
|
|
110
|
+
This excludes compound SPDX expressions such as ``AND``, ``OR``, and
|
|
111
|
+
``WITH`` because the project-level licence-file and obligations workflows
|
|
112
|
+
in this module only cover one canonical licence at a time.
|
|
113
|
+
"""
|
|
114
|
+
raw_identifier: str = identifier or str(configuration.get_value(ConfigurationVariable.FILE_LICENCE_IDENTIFIER))
|
|
115
|
+
normalised_identifier: str = normalise_proprietary_licence(raw_identifier.strip())
|
|
116
|
+
if is_proprietary_licence(raw_identifier):
|
|
117
|
+
return True
|
|
118
|
+
return not any(token in normalised_identifier for token in (" AND ", " OR ", " WITH ", "(", ")"))
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def get_project_licence_file_path() -> Path:
|
|
122
|
+
"""Resolve the configured path of the project licence file.
|
|
123
|
+
|
|
124
|
+
The default configuration is ``LICENSE`` at the project root.
|
|
125
|
+
"""
|
|
126
|
+
configured_path = Path(str(configuration.get_value(ConfigurationVariable.LICENCE_FILE_PATH)).strip())
|
|
127
|
+
if configured_path.is_absolute():
|
|
128
|
+
return configured_path
|
|
129
|
+
return Path(str(configuration.get_value(ConfigurationVariable.PROJECT_ROOT))).joinpath(configured_path)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def normalise_licence_text(text: str) -> str:
|
|
133
|
+
"""Normalise licence text while preserving meaningful formatting.
|
|
134
|
+
|
|
135
|
+
This is a lightweight normalization step used before comparison against
|
|
136
|
+
canonical public licence texts. It is intentionally simpler than the full
|
|
137
|
+
SPDX matching guidelines.
|
|
138
|
+
|
|
139
|
+
Reference:
|
|
140
|
+
- https://spdx.github.io/spdx-spec/v2.3/license-matching-guidelines-and-templates/
|
|
141
|
+
"""
|
|
142
|
+
lines = [line.rstrip() for line in html.unescape(text).replace("\r\n", "\n").replace("\r", "\n").split("\n")]
|
|
143
|
+
while lines and not lines[0].strip():
|
|
144
|
+
lines.pop(0)
|
|
145
|
+
while lines and not lines[-1].strip():
|
|
146
|
+
lines.pop()
|
|
147
|
+
return "\n".join(lines)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def fetch_project_licence_text(identifier: str) -> Optional[RetrievedProjectLicenceText]:
|
|
151
|
+
"""Fetch canonical licence text for one SPDX identifier from public sources.
|
|
152
|
+
|
|
153
|
+
Source order:
|
|
154
|
+
1. ScanCode LicenseDB
|
|
155
|
+
2. SPDX.org
|
|
156
|
+
3. GitHub licences API
|
|
157
|
+
4. choosealicense.com
|
|
158
|
+
"""
|
|
159
|
+
for fetcher in (
|
|
160
|
+
_fetch_scancode_licence_text,
|
|
161
|
+
_fetch_spdx_licence_text,
|
|
162
|
+
_fetch_github_licence_text,
|
|
163
|
+
_fetch_choosealicense_licence_text,
|
|
164
|
+
):
|
|
165
|
+
try:
|
|
166
|
+
result = fetcher(identifier)
|
|
167
|
+
except Exception as error:
|
|
168
|
+
logger.debug("Could not fetch %s from %s: %s", identifier, fetcher.__name__, error)
|
|
169
|
+
continue
|
|
170
|
+
if result and result.text.strip():
|
|
171
|
+
return result
|
|
172
|
+
return None
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def fetch_spdx_licence_details(identifier: str) -> Optional[Dict[str, object]]:
|
|
176
|
+
"""Fetch SPDX licence metadata for one identifier.
|
|
177
|
+
|
|
178
|
+
Reference: https://spdx.org/licenses/
|
|
179
|
+
"""
|
|
180
|
+
try:
|
|
181
|
+
return _read_json(f"https://spdx.org/licenses/{identifier}.json")
|
|
182
|
+
except Exception as error:
|
|
183
|
+
logger.debug("SPDX licence details unavailable for %s: %s", identifier, error)
|
|
184
|
+
return None
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def fetch_osadl_obligations(identifier: str) -> Optional[str]:
|
|
188
|
+
"""Fetch the OSADL checklist text for one identifier when available.
|
|
189
|
+
|
|
190
|
+
Reference: https://www.osadl.org/License-Checklists.oss-compliance-lists.0.html
|
|
191
|
+
"""
|
|
192
|
+
try:
|
|
193
|
+
return normalise_licence_text(
|
|
194
|
+
_read_text(f"https://www.osadl.org/fileadmin/checklists/unreflicenses/{identifier}.txt")
|
|
195
|
+
)
|
|
196
|
+
except Exception as error:
|
|
197
|
+
logger.debug("OSADL obligations unavailable for %s: %s", identifier, error)
|
|
198
|
+
return None
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def fetch_choosealicense_metadata(identifier: str) -> Optional[ChooseALicenseMetadata]:
|
|
202
|
+
"""Fetch descriptive choosealicense.com metadata when supported.
|
|
203
|
+
|
|
204
|
+
This is used for the user-facing permissions/conditions/limitations summary.
|
|
205
|
+
|
|
206
|
+
Reference: https://choosealicense.com/
|
|
207
|
+
"""
|
|
208
|
+
for slug in _choosealicense_slugs(identifier):
|
|
209
|
+
url = f"https://choosealicense.com/licenses/{slug}/"
|
|
210
|
+
try:
|
|
211
|
+
page = _read_text(url)
|
|
212
|
+
return ChooseALicenseMetadata(
|
|
213
|
+
summary=_extract_choosealicense_summary(page),
|
|
214
|
+
permissions=tuple(_extract_choosealicense_list(page, "license-permissions")),
|
|
215
|
+
conditions=tuple(_extract_choosealicense_list(page, "license-conditions")),
|
|
216
|
+
limitations=tuple(_extract_choosealicense_list(page, "license-limitations")),
|
|
217
|
+
text=_extract_choosealicense_text(page),
|
|
218
|
+
url=url,
|
|
219
|
+
)
|
|
220
|
+
except Exception as error:
|
|
221
|
+
logger.debug("choosealicense.com metadata unavailable for %s at %s: %s", identifier, url, error)
|
|
222
|
+
return None
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def ensure_project_licence_file_conforms(create_if_missing: bool, update_if_mismatched: bool = False) -> Path:
|
|
226
|
+
"""Ensure the configured project licence file exists and matches the configured SPDX identifier.
|
|
227
|
+
|
|
228
|
+
For non-proprietary single-identifier projects, the file content is checked
|
|
229
|
+
against canonical public licence text fetched from the supported services.
|
|
230
|
+
For proprietary projects, this helper only verifies presence because CDS has
|
|
231
|
+
no public canonical reference text to compare against.
|
|
232
|
+
"""
|
|
233
|
+
identifier = get_project_licence_identifier()
|
|
234
|
+
licence_file = get_project_licence_file_path()
|
|
235
|
+
if is_proprietary_licence(identifier):
|
|
236
|
+
if licence_file.exists() and licence_file.is_file():
|
|
237
|
+
return licence_file
|
|
238
|
+
raise ValueError(f"The project uses a proprietary licence. The author must provide {licence_file} manually.")
|
|
239
|
+
fetched = fetch_project_licence_text(identifier)
|
|
240
|
+
if not fetched:
|
|
241
|
+
raise ValueError(
|
|
242
|
+
f"Could not fetch licence text for {identifier} from ScanCode LicenseDB, SPDX.org, "
|
|
243
|
+
"GitHub API, or choosealicense.com."
|
|
244
|
+
)
|
|
245
|
+
if licence_file.exists():
|
|
246
|
+
if not licence_file.is_file():
|
|
247
|
+
raise ValueError(f"Configured licence path exists but is not a file: {licence_file}")
|
|
248
|
+
actual_text = licence_file.read_text(encoding="utf8")
|
|
249
|
+
if _normalise_licence_text_for_comparison(actual_text) != _normalise_licence_text_for_comparison(fetched.text):
|
|
250
|
+
_log_licence_text_diff(actual_text, fetched.text, licence_file, fetched.source)
|
|
251
|
+
if update_if_mismatched:
|
|
252
|
+
licence_file.write_text(fetched.text.rstrip() + "\n", encoding="utf8")
|
|
253
|
+
print(f"Updated {licence_file} from {fetched.source}: {fetched.url}")
|
|
254
|
+
return licence_file
|
|
255
|
+
raise ValueError(f"Configured SPDX identifier {identifier} does not match the contents of {licence_file}.")
|
|
256
|
+
return licence_file
|
|
257
|
+
if not create_if_missing:
|
|
258
|
+
raise ValueError(f"Configured SPDX identifier {identifier} requires a project licence file at {licence_file}.")
|
|
259
|
+
licence_file.parent.mkdir(parents=True, exist_ok=True)
|
|
260
|
+
licence_file.write_text(fetched.text.rstrip() + "\n", encoding="utf8")
|
|
261
|
+
print(f"Created {licence_file} from {fetched.source}: {fetched.url}")
|
|
262
|
+
return licence_file
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
def sync_project_licence_file() -> Path:
|
|
266
|
+
"""Create the configured project licence file when it is missing.
|
|
267
|
+
|
|
268
|
+
This workflow only supports projects configured with one exact SPDX licence
|
|
269
|
+
identifier.
|
|
270
|
+
"""
|
|
271
|
+
return ensure_project_licence_file_conforms(create_if_missing=True, update_if_mismatched=True)
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
def describe_licence_obligations(identifier: Optional[str] = None) -> str:
|
|
275
|
+
"""Return a human-readable obligations summary for one project licence.
|
|
276
|
+
|
|
277
|
+
The rendered report combines:
|
|
278
|
+
- SPDX.org licence metadata
|
|
279
|
+
- choosealicense.com summary data
|
|
280
|
+
- OSADL obligations text
|
|
281
|
+
|
|
282
|
+
This workflow only supports projects configured with one exact SPDX licence
|
|
283
|
+
identifier.
|
|
284
|
+
"""
|
|
285
|
+
resolved_identifier = get_project_licence_identifier(identifier)
|
|
286
|
+
if is_proprietary_licence(resolved_identifier):
|
|
287
|
+
return _render_licence_obligations_report(
|
|
288
|
+
{
|
|
289
|
+
"identifier": LICENSE_REF_PROPRIETARY,
|
|
290
|
+
"name": None,
|
|
291
|
+
"is_osi_approved": None,
|
|
292
|
+
"summary": None,
|
|
293
|
+
"permissions": (),
|
|
294
|
+
"conditions": (),
|
|
295
|
+
"limitations": (),
|
|
296
|
+
"osadl_obligations": None,
|
|
297
|
+
"is_proprietary": True,
|
|
298
|
+
}
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
spdx_details = fetch_spdx_licence_details(resolved_identifier) or {}
|
|
302
|
+
choosealicense = fetch_choosealicense_metadata(resolved_identifier)
|
|
303
|
+
osadl = fetch_osadl_obligations(resolved_identifier)
|
|
304
|
+
return _render_licence_obligations_report(
|
|
305
|
+
{
|
|
306
|
+
"identifier": resolved_identifier,
|
|
307
|
+
"name": spdx_details.get(SPDX_NAME_KEY) if isinstance(spdx_details.get(SPDX_NAME_KEY), str) else None,
|
|
308
|
+
"is_osi_approved": (
|
|
309
|
+
"yes"
|
|
310
|
+
if spdx_details.get(SPDX_IS_OSI_APPROVED_KEY) is True
|
|
311
|
+
else "no" if spdx_details.get(SPDX_IS_OSI_APPROVED_KEY) is False else None
|
|
312
|
+
),
|
|
313
|
+
"summary": choosealicense.summary if choosealicense else None,
|
|
314
|
+
"permissions": choosealicense.permissions if choosealicense else (),
|
|
315
|
+
"conditions": choosealicense.conditions if choosealicense else (),
|
|
316
|
+
"limitations": choosealicense.limitations if choosealicense else (),
|
|
317
|
+
"osadl_obligations": osadl.splitlines() if osadl else None,
|
|
318
|
+
"is_proprietary": False,
|
|
319
|
+
}
|
|
320
|
+
)
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
def _normalise_licence_text_for_comparison(text: str) -> str:
|
|
324
|
+
return re.sub(r"\s+", " ", normalise_licence_text(text)).strip()
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
def _log_licence_text_diff(actual_text: str, expected_text: str, licence_file: Path, source: str) -> None:
|
|
328
|
+
diff = "\n".join(
|
|
329
|
+
unified_diff(
|
|
330
|
+
normalise_licence_text(actual_text).splitlines(),
|
|
331
|
+
normalise_licence_text(expected_text).splitlines(),
|
|
332
|
+
fromfile=str(licence_file),
|
|
333
|
+
tofile=f"canonical ({source})",
|
|
334
|
+
lineterm="",
|
|
335
|
+
)
|
|
336
|
+
)
|
|
337
|
+
if diff:
|
|
338
|
+
logger.warning("Project licence file differs from canonical text:\n%s", diff)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
def _fetch_scancode_licence_text(identifier: str) -> Optional[RetrievedProjectLicenceText]:
|
|
342
|
+
info = SCANCODE_DB.find(identifier)
|
|
343
|
+
if not info:
|
|
344
|
+
return None
|
|
345
|
+
data = _read_json(info.url)
|
|
346
|
+
text = data.get(SCANCODE_TEXT_KEY)
|
|
347
|
+
if not isinstance(text, str) or not text.strip():
|
|
348
|
+
return None
|
|
349
|
+
return RetrievedProjectLicenceText(
|
|
350
|
+
identifier=identifier,
|
|
351
|
+
text=normalise_licence_text(text),
|
|
352
|
+
source="ScanCode LicenseDB",
|
|
353
|
+
url=info.url,
|
|
354
|
+
)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
def _fetch_spdx_licence_text(identifier: str) -> Optional[RetrievedProjectLicenceText]:
|
|
358
|
+
url = f"https://spdx.org/licenses/{identifier}.json"
|
|
359
|
+
data = _read_json(url)
|
|
360
|
+
text = data.get(SPDX_LICENSE_TEXT_KEY)
|
|
361
|
+
if not isinstance(text, str) or not text.strip():
|
|
362
|
+
return None
|
|
363
|
+
return RetrievedProjectLicenceText(
|
|
364
|
+
identifier=identifier,
|
|
365
|
+
text=normalise_licence_text(text),
|
|
366
|
+
source="SPDX.org",
|
|
367
|
+
url=url,
|
|
368
|
+
)
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
def _fetch_github_licence_text(identifier: str) -> Optional[RetrievedProjectLicenceText]:
|
|
372
|
+
for slug in _github_api_slugs(identifier):
|
|
373
|
+
url = f"https://api.github.com/licenses/{slug}"
|
|
374
|
+
data = _read_json(url, headers={"Accept": "application/vnd.github+json"})
|
|
375
|
+
text = data.get(GITHUB_BODY_KEY)
|
|
376
|
+
if not isinstance(text, str) or not text.strip():
|
|
377
|
+
continue
|
|
378
|
+
return RetrievedProjectLicenceText(
|
|
379
|
+
identifier=identifier,
|
|
380
|
+
text=normalise_licence_text(text),
|
|
381
|
+
source="GitHub API",
|
|
382
|
+
url=url,
|
|
383
|
+
)
|
|
384
|
+
return None
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
def _fetch_choosealicense_licence_text(identifier: str) -> Optional[RetrievedProjectLicenceText]:
|
|
388
|
+
metadata = fetch_choosealicense_metadata(identifier)
|
|
389
|
+
if not metadata or not metadata.text or not metadata.url:
|
|
390
|
+
return None
|
|
391
|
+
return RetrievedProjectLicenceText(
|
|
392
|
+
identifier=identifier,
|
|
393
|
+
text=normalise_licence_text(metadata.text),
|
|
394
|
+
source="choosealicense.com",
|
|
395
|
+
url=metadata.url,
|
|
396
|
+
)
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
def _github_api_slugs(identifier: str) -> Iterable[str]:
|
|
400
|
+
yield identifier.lower()
|
|
401
|
+
simplified = re.sub(r"-(?:only|or-later)$", "", identifier, flags=re.IGNORECASE).lower()
|
|
402
|
+
if simplified != identifier.lower():
|
|
403
|
+
yield simplified
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
def _choosealicense_slugs(identifier: str) -> Iterable[str]:
|
|
407
|
+
yield from _github_api_slugs(identifier)
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
def _read_text(url: str, headers: Optional[Dict[str, str]] = None) -> str:
|
|
411
|
+
request_headers = {"User-Agent": USER_AGENT, **(headers or {})}
|
|
412
|
+
request = Request(url, headers=request_headers)
|
|
413
|
+
with urlopen(request, timeout=REQUEST_TIMEOUT) as response:
|
|
414
|
+
payload = response.read(MAX_RESPONSE_SIZE + 1)
|
|
415
|
+
if len(payload) > MAX_RESPONSE_SIZE:
|
|
416
|
+
raise ValueError(f"Response from {url} exceeds the maximum supported size")
|
|
417
|
+
return cast(str, payload.decode("utf8"))
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
def _read_json(url: str, headers: Optional[Dict[str, str]] = None) -> Dict[str, object]:
|
|
421
|
+
try:
|
|
422
|
+
data = json.loads(_read_text(url, headers=headers))
|
|
423
|
+
except (HTTPError, URLError, TimeoutError, OSError, UnicodeError, json.JSONDecodeError) as error:
|
|
424
|
+
raise ValueError(f"Could not retrieve JSON from {url}: {error}")
|
|
425
|
+
if not isinstance(data, dict):
|
|
426
|
+
raise ValueError(f"JSON payload from {url} is not an object")
|
|
427
|
+
return data
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
def _extract_choosealicense_summary(page: str) -> Optional[str]:
|
|
431
|
+
match = re.search(r'<div class="license-body">.*?<p>\s*(.*?)\s*</p>', page, flags=re.DOTALL)
|
|
432
|
+
return _strip_html(match.group(1)) if match else None
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
def _extract_choosealicense_list(page: str, class_name: str) -> list[str]:
|
|
436
|
+
block = re.search(rf'<ul class="{class_name}">(.*?)</ul>', page, flags=re.DOTALL)
|
|
437
|
+
if not block:
|
|
438
|
+
return []
|
|
439
|
+
items = []
|
|
440
|
+
for entry in re.findall(r"<li[^>]*>(.*?)</li>", block.group(1), flags=re.DOTALL):
|
|
441
|
+
text = _strip_html(entry)
|
|
442
|
+
if text:
|
|
443
|
+
items.append(text)
|
|
444
|
+
return items
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
def _extract_choosealicense_text(page: str) -> Optional[str]:
|
|
448
|
+
match = re.search(r'<pre id="license-text"[^>]*>(.*?)</pre>', page, flags=re.DOTALL)
|
|
449
|
+
return normalise_licence_text(match.group(1)) if match else None
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
def _strip_html(value: str) -> str:
|
|
453
|
+
text = re.sub(r"<[^>]+>", " ", html.unescape(value))
|
|
454
|
+
return re.sub(r"\s+", " ", text).strip()
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
def _get_report_jinja2_env() -> jinja2.Environment:
|
|
458
|
+
return jinja2.Environment(
|
|
459
|
+
loader=jinja2.FileSystemLoader(str(Path(__file__).resolve().parent.joinpath("templates"))),
|
|
460
|
+
autoescape=lambda name: bool(name and name.endswith(".html.jinja2")),
|
|
461
|
+
keep_trailing_newline=True,
|
|
462
|
+
trim_blocks=True,
|
|
463
|
+
lstrip_blocks=True,
|
|
464
|
+
)
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
def _render_licence_obligations_report(arguments: Dict[str, object]) -> str:
|
|
468
|
+
template = _get_report_jinja2_env().get_template(JINJA_TEMPLATE_LICENCE_OBLIGATIONS_TEXT)
|
|
469
|
+
return cast(str, template.render(**arguments))
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
SPDX identifier: {{ identifier }}
|
|
2
|
+
{% if is_proprietary %}
|
|
3
|
+
|
|
4
|
+
This project uses a proprietary licence.
|
|
5
|
+
The author must provide the full licence text, and redistribution, modification, notice, source, and patent obligations must be reviewed against the custom terms.
|
|
6
|
+
{% else %}
|
|
7
|
+
{% if name %}Name: {{ name }}
|
|
8
|
+
{% endif %}{% if is_osi_approved %}OSI approved: {{ is_osi_approved }}
|
|
9
|
+
{% endif %}{% if summary %}
|
|
10
|
+
{{ summary }}
|
|
11
|
+
{% endif %}{% if permissions %}
|
|
12
|
+
Permissions:
|
|
13
|
+
{% for item in permissions %}- {{ item }}
|
|
14
|
+
{% endfor %}{% endif %}{% if conditions %}
|
|
15
|
+
Conditions:
|
|
16
|
+
{% for item in conditions %}- {{ item }}
|
|
17
|
+
{% endfor %}{% endif %}{% if limitations %}
|
|
18
|
+
Limitations:
|
|
19
|
+
{% for item in limitations %}- {{ item }}
|
|
20
|
+
{% endfor %}{% endif %}
|
|
21
|
+
OSADL obligations:
|
|
22
|
+
{% if osadl_obligations %}{% for line in osadl_obligations %}{{ line }}
|
|
23
|
+
{% endfor %}{% else %}OSADL checklist unavailable for this SPDX identifier.
|
|
24
|
+
{% endif %}{% endif %}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
"""Ensure the configured top-level licence file exists and matches project configuration."""
|
|
6
|
+
|
|
7
|
+
import argparse
|
|
8
|
+
import logging
|
|
9
|
+
import sys
|
|
10
|
+
|
|
11
|
+
from continuous_delivery_scripts.spdx_report.project_licensing import (
|
|
12
|
+
sync_project_licence_file,
|
|
13
|
+
)
|
|
14
|
+
from continuous_delivery_scripts.utils.logging import log_exception, set_log_level
|
|
15
|
+
|
|
16
|
+
logger = logging.getLogger(__name__)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def main() -> int:
|
|
20
|
+
"""Create a CLI for syncing the project's top-level licence file."""
|
|
21
|
+
parser = argparse.ArgumentParser(
|
|
22
|
+
description=(
|
|
23
|
+
"Create the configured project licence file when it is missing and check it matches "
|
|
24
|
+
"the configured SPDX identifier."
|
|
25
|
+
)
|
|
26
|
+
)
|
|
27
|
+
parser.add_argument("-v", "--verbose", action="count", default=0, help="Increase logging verbosity.")
|
|
28
|
+
args = parser.parse_args()
|
|
29
|
+
set_log_level(args.verbose)
|
|
30
|
+
try:
|
|
31
|
+
licence_file = sync_project_licence_file()
|
|
32
|
+
if licence_file.exists():
|
|
33
|
+
print(f"Project licence file matches configured SPDX identifier: {licence_file}")
|
|
34
|
+
return 0
|
|
35
|
+
except Exception as error:
|
|
36
|
+
log_exception(logger, error)
|
|
37
|
+
return 1
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
if __name__ == "__main__":
|
|
41
|
+
sys.exit(main())
|
|
@@ -113,6 +113,8 @@ class ConfigurationVariable(enum.Enum):
|
|
|
113
113
|
"""Skip automatic dependency downloads before licence and SPDX dependency analysis."""
|
|
114
114
|
DOCUMENTATION_SITE_URL = 47
|
|
115
115
|
"""Optional public base URL of the generated documentation website."""
|
|
116
|
+
LICENCE_FILE_PATH = 48
|
|
117
|
+
"""Relative or absolute path to the project's top-level licence file."""
|
|
116
118
|
|
|
117
119
|
@staticmethod
|
|
118
120
|
def choices() -> List[str]:
|
|
@@ -227,6 +229,7 @@ class StaticConfig(GenericConfig):
|
|
|
227
229
|
DEPENDENCY_UPDATE_NEWS_MESSAGE = "Dependency upgrade: {message}"
|
|
228
230
|
DEPENDENCY_UPDATE_NEWS_TYPE = NewsType.bugfix
|
|
229
231
|
DEPENDENCY_UPDATE_BRANCH_PATTERN = r"^\s*[Dd]ependabot\/.+\/(?P<DEPENDENCY>.+)"
|
|
232
|
+
LICENCE_FILE_PATH = "LICENSE"
|
|
230
233
|
ACCEPTED_THIRD_PARTY_LICENCES = [
|
|
231
234
|
"Apache-2.0",
|
|
232
235
|
"BSD*",
|