spl-core 4.0.0__py3-none-any.whl
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.
- spl_core/__init__.py +1 -0
- spl_core/common/__init__.py +0 -0
- spl_core/common/cmake.py +52 -0
- spl_core/common/path.py +17 -0
- spl_core/gcov_maid/__init__.py +0 -0
- spl_core/gcov_maid/gcov_maid.py +48 -0
- spl_core/kconfig/__init__.py +0 -0
- spl_core/kconfig/kconfig.py +271 -0
- spl_core/project_creator/__init__.py +0 -0
- spl_core/project_creator/creator.py +133 -0
- spl_core/project_creator/templates/project/cookiecutter.json +14 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.flake8 +2 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.gitignore +33 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/cmake-kits.json +11 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/cmake-variants.json +18 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/extensions.json +18 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/launch.json +37 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/settings.json +45 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/.vscode/tasks.json +93 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/CMakeLists.txt +43 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/KConfig +23 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/LICENSE +21 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/Pipfile +33 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/README.md +7 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/build.bat +1 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/build.ps1 +245 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/conf.py +200 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/Doxyfile.in +2774 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/common/index.rst +5 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/components/index.rst +23 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/doxygen-awesome/LICENSE +21 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/doxygen-awesome/doxygen-awesome.css +2530 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/software_architecture/index.rst +2 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/software_requirements/index.rst +7 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/doc/test_report_template.txt +46 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/index.rst +38 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/install-mandatory.bat +1 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/pytest.ini +9 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/scoopfile.json +47 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/test/test_build.py +39 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/test/test_unittests.py +28 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/test/utils.py +26 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/tools/setup/git-config.ps1 +8 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/CMakeLists.txt +3 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/doc/_images/screenshot.png +0 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/doc/design.rst +25 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/doc/index.rst +8 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/src/component.c +31 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/src/component.h +1 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/component/test/test_component.cc +60 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/main/CMakeLists.txt +2 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/main/doc/index.rst +14 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_components -%} components {%- endif %}/main/src/main.c +17 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_tools -%} tools {%- endif %}/toolchains/clang/toolchain.cmake +8 -0
- spl_core/project_creator/templates/project/{{cookiecutter.name}}/{% if cookiecutter.touch_tools -%} tools {%- endif %}/toolchains/gcc/toolchain.cmake +3 -0
- spl_core/project_creator/templates/variant/cookiecutter.json +4 -0
- spl_core/project_creator/templates/variant/{{cookiecutter.flavor}}/{{cookiecutter.subsystem}}/config.cmake +1 -0
- spl_core/project_creator/templates/variant/{{cookiecutter.flavor}}/{{cookiecutter.subsystem}}/config.txt +1 -0
- spl_core/project_creator/templates/variant/{{cookiecutter.flavor}}/{{cookiecutter.subsystem}}/parts.cmake +2 -0
- spl_core/project_creator/variant.py +23 -0
- spl_core/project_creator/workspace_artifacts.py +36 -0
- spl_core-4.0.0.dist-info/LICENSE +22 -0
- spl_core-4.0.0.dist-info/METADATA +62 -0
- spl_core-4.0.0.dist-info/RECORD +65 -0
- spl_core-4.0.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
""" Configuration """
|
|
3
|
+
|
|
4
|
+
import json
|
|
5
|
+
import os
|
|
6
|
+
import datetime
|
|
7
|
+
import re
|
|
8
|
+
|
|
9
|
+
day = datetime.date.today()
|
|
10
|
+
# meta data #################################################################
|
|
11
|
+
|
|
12
|
+
project = "Project"
|
|
13
|
+
copyright = f"{day.year} Avengineers"
|
|
14
|
+
release = f"{day}"
|
|
15
|
+
|
|
16
|
+
# file handling #############################################################
|
|
17
|
+
# @see https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
18
|
+
|
|
19
|
+
templates_path = [
|
|
20
|
+
"doc/_tmpl",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
exclude_patterns = [
|
|
24
|
+
"README.md",
|
|
25
|
+
"build/modules",
|
|
26
|
+
"build/deps",
|
|
27
|
+
".venv",
|
|
28
|
+
".git",
|
|
29
|
+
"**/test_results.rst", # We renamed this file, but nobody deletes it.
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
include_patterns = ["index.rst", "doc/**"]
|
|
33
|
+
|
|
34
|
+
# configuration of built-in stuff ###########################################
|
|
35
|
+
# @see https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
36
|
+
|
|
37
|
+
numfig = True
|
|
38
|
+
|
|
39
|
+
# html config ###############################################################
|
|
40
|
+
# @see https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
41
|
+
|
|
42
|
+
# Omit "documentation" in title
|
|
43
|
+
html_title = f"{project} {release}"
|
|
44
|
+
|
|
45
|
+
html_theme = "sphinx_rtd_theme"
|
|
46
|
+
|
|
47
|
+
# Hide hyper link which leeds to the source of page displayed
|
|
48
|
+
html_show_sourcelink = True
|
|
49
|
+
|
|
50
|
+
html_theme_options = {
|
|
51
|
+
"canonical_url": "",
|
|
52
|
+
"analytics_id": "", # Provided by Google in your dashboard
|
|
53
|
+
"display_version": True,
|
|
54
|
+
"prev_next_buttons_location": "bottom",
|
|
55
|
+
"style_external_links": True,
|
|
56
|
+
"logo_only": False,
|
|
57
|
+
"style_nav_header_background": "white",
|
|
58
|
+
# Toc options
|
|
59
|
+
"collapse_navigation": True,
|
|
60
|
+
"sticky_navigation": True,
|
|
61
|
+
"navigation_depth": 6,
|
|
62
|
+
"includehidden": True,
|
|
63
|
+
"titles_only": False,
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
# EXTENSIONS AND THEIR CONFIGS ##############################################
|
|
67
|
+
extensions = ["sphinx_rtd_size"]
|
|
68
|
+
|
|
69
|
+
sphinx_rtd_size_width = "90%"
|
|
70
|
+
|
|
71
|
+
# mermaid config - @see https://pypi.org/project/sphinxcontrib-mermaid/ #####
|
|
72
|
+
extensions.append("sphinxcontrib.mermaid")
|
|
73
|
+
|
|
74
|
+
# sphinx_needs ###############################################################
|
|
75
|
+
extensions.append("sphinx_needs")
|
|
76
|
+
|
|
77
|
+
# test_reports ###############################################################
|
|
78
|
+
extensions.append("sphinxcontrib.test_reports")
|
|
79
|
+
tr_report_template = "doc/test_report_template.txt"
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def tr_link(app, need, needs, first_option_name, second_option_name, *args, **kwargs):
|
|
83
|
+
"""Make links between 'needs'. In comparison to the default 'tr_link' function,
|
|
84
|
+
this function supports regular expression pattern matching."""
|
|
85
|
+
if first_option_name not in need:
|
|
86
|
+
return ""
|
|
87
|
+
# Get the value of the 'first_option_name'
|
|
88
|
+
first_option_value = need[first_option_name]
|
|
89
|
+
|
|
90
|
+
links = []
|
|
91
|
+
for need_target in needs.values():
|
|
92
|
+
# Skip linking to itself
|
|
93
|
+
if need_target["id"] == need["id"]:
|
|
94
|
+
continue
|
|
95
|
+
if second_option_name not in need_target:
|
|
96
|
+
continue
|
|
97
|
+
|
|
98
|
+
if first_option_value is not None and len(first_option_value) > 0:
|
|
99
|
+
second_option_value = need_target[second_option_name]
|
|
100
|
+
if second_option_value is not None and len(second_option_value) > 0:
|
|
101
|
+
if first_option_value == second_option_value:
|
|
102
|
+
links.append(need_target["id"])
|
|
103
|
+
# if the first option value has a *, use regex matching
|
|
104
|
+
elif "*" in first_option_value:
|
|
105
|
+
if re.match(first_option_value, second_option_value):
|
|
106
|
+
links.append(need_target["id"])
|
|
107
|
+
|
|
108
|
+
return links
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
needs_functions = [tr_link]
|
|
112
|
+
|
|
113
|
+
extensions.append("sphinx.ext.todo")
|
|
114
|
+
|
|
115
|
+
# Render Your Data Readable ##################################################
|
|
116
|
+
# Enables adding Jupyter notebooks to toctree
|
|
117
|
+
# @see https://sphinxcontribdatatemplates.readthedocs.io/en/latest/index.html
|
|
118
|
+
extensions.append("sphinxcontrib.datatemplates")
|
|
119
|
+
|
|
120
|
+
# needs_types - this option allows the setup of own need types like bugs, user_stories and more.
|
|
121
|
+
needs_types = [
|
|
122
|
+
dict(
|
|
123
|
+
directive="req", title="Requirement", prefix="R_", color="#BFD8D2", style="node"
|
|
124
|
+
),
|
|
125
|
+
dict(
|
|
126
|
+
directive="spec",
|
|
127
|
+
title="Specification",
|
|
128
|
+
prefix="S_",
|
|
129
|
+
color="#FEDCD2",
|
|
130
|
+
style="node",
|
|
131
|
+
),
|
|
132
|
+
dict(
|
|
133
|
+
directive="impl",
|
|
134
|
+
title="Implementation",
|
|
135
|
+
prefix="I_",
|
|
136
|
+
color="#DF744A",
|
|
137
|
+
style="node",
|
|
138
|
+
),
|
|
139
|
+
dict(
|
|
140
|
+
directive="test", title="Test Case", prefix="T_", color="#DCB239", style="node"
|
|
141
|
+
),
|
|
142
|
+
]
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
# Define own options
|
|
146
|
+
needs_extra_options = ["integrity", "assignee", "version"]
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
# Define own link types
|
|
150
|
+
needs_extra_links = [
|
|
151
|
+
# SWE.3 BP.5: link from Implementation (Software unit) to Specification (Software detailed design)
|
|
152
|
+
{"option": "implements", "incoming": "is implemented by", "outgoing": "implements"},
|
|
153
|
+
# SWE.4 BP.5: link from Test Case (Unit test specification) to Specification (Software detailed design)
|
|
154
|
+
{"option": "tests", "incoming": "is tested by", "outgoing": "tests"},
|
|
155
|
+
# SWE.4 BP.5: link from Test Case (Unit test specification) to Test Result (Unit test result)
|
|
156
|
+
{"option": "results", "incoming": "is resulted from", "outgoing": "results"},
|
|
157
|
+
]
|
|
158
|
+
|
|
159
|
+
# Link tests results to the test cases
|
|
160
|
+
needs_global_options = {
|
|
161
|
+
"results": "[[tr_link('title', 'case')]]",
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
# Provide all config values to jinja
|
|
165
|
+
html_context = {
|
|
166
|
+
"build_config": {},
|
|
167
|
+
"config": {},
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
# Check if the SPHINX_BUILD_CONFIGURATION_FILE environment variable exists
|
|
171
|
+
# and if so, load the JSON file and set the 'html_context' variable
|
|
172
|
+
if "SPHINX_BUILD_CONFIGURATION_FILE" in os.environ:
|
|
173
|
+
with open(os.environ["SPHINX_BUILD_CONFIGURATION_FILE"], "r") as file:
|
|
174
|
+
html_context["build_config"] = json.load(file)
|
|
175
|
+
include_patterns.extend(html_context["build_config"].get("include_patterns", []))
|
|
176
|
+
|
|
177
|
+
# Check if the SPHINX_BUILD_CONFIGURATION_FILE environment variable exists
|
|
178
|
+
# and if so, load the JSON file and set the 'html_context' variable
|
|
179
|
+
if "AUTOCONF_JSON_FILE" in os.environ:
|
|
180
|
+
with open(os.environ["AUTOCONF_JSON_FILE"], "r") as file:
|
|
181
|
+
html_context["config"] = json.load(file)["features"]
|
|
182
|
+
|
|
183
|
+
if "VARIANT" in os.environ:
|
|
184
|
+
html_context["build_config"]["variant"] = os.environ["VARIANT"]
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def rstjinja(app, docname, source):
|
|
188
|
+
"""
|
|
189
|
+
Render our pages as a jinja template for fancy templating goodness.
|
|
190
|
+
"""
|
|
191
|
+
# Make sure we're outputting HTML
|
|
192
|
+
if app.builder.format != "html":
|
|
193
|
+
return
|
|
194
|
+
src = source[0]
|
|
195
|
+
rendered = app.builder.templates.render_string(src, app.config.html_context)
|
|
196
|
+
source[0] = rendered
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def setup(app):
|
|
200
|
+
app.connect("source-read", rstjinja)
|