yanga-core 0.0.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.
Files changed (34) hide show
  1. yanga_core-0.0.0/LICENSE +22 -0
  2. yanga_core-0.0.0/PKG-INFO +155 -0
  3. yanga_core-0.0.0/README.md +124 -0
  4. yanga_core-0.0.0/pyproject.toml +181 -0
  5. yanga_core-0.0.0/src/yanga_core/__init__.py +1 -0
  6. yanga_core-0.0.0/src/yanga_core/commands/__init__.py +0 -0
  7. yanga_core-0.0.0/src/yanga_core/commands/base.py +48 -0
  8. yanga_core-0.0.0/src/yanga_core/commands/cppcheck_report.py +307 -0
  9. yanga_core-0.0.0/src/yanga_core/commands/filter_compile_commands.py +51 -0
  10. yanga_core-0.0.0/src/yanga_core/commands/fix_html_links.py +157 -0
  11. yanga_core-0.0.0/src/yanga_core/commands/report_config.py +49 -0
  12. yanga_core-0.0.0/src/yanga_core/commands/run.py +220 -0
  13. yanga_core-0.0.0/src/yanga_core/docs/__init__.py +0 -0
  14. yanga_core-0.0.0/src/yanga_core/docs/sphinx.py +117 -0
  15. yanga_core-0.0.0/src/yanga_core/domain/__init__.py +0 -0
  16. yanga_core-0.0.0/src/yanga_core/domain/artifact.py +39 -0
  17. yanga_core-0.0.0/src/yanga_core/domain/component_analyzer.py +51 -0
  18. yanga_core-0.0.0/src/yanga_core/domain/components.py +42 -0
  19. yanga_core-0.0.0/src/yanga_core/domain/config.py +236 -0
  20. yanga_core-0.0.0/src/yanga_core/domain/config_slurper.py +62 -0
  21. yanga_core-0.0.0/src/yanga_core/domain/config_utils.py +77 -0
  22. yanga_core-0.0.0/src/yanga_core/domain/execution_context.py +96 -0
  23. yanga_core-0.0.0/src/yanga_core/domain/generated_file.py +27 -0
  24. yanga_core-0.0.0/src/yanga_core/domain/project_slurper.py +331 -0
  25. yanga_core-0.0.0/src/yanga_core/domain/reports.py +183 -0
  26. yanga_core-0.0.0/src/yanga_core/domain/spl_paths.py +60 -0
  27. yanga_core-0.0.0/src/yanga_core/ini.py +67 -0
  28. yanga_core-0.0.0/src/yanga_core/steps/__init__.py +0 -0
  29. yanga_core-0.0.0/src/yanga_core/steps/generate_report_config.py +79 -0
  30. yanga_core-0.0.0/src/yanga_core/steps/kconfig_gen.py +183 -0
  31. yanga_core-0.0.0/src/yanga_core/steps/poks_install.py +29 -0
  32. yanga_core-0.0.0/src/yanga_core/steps/scoop_install.py +32 -0
  33. yanga_core-0.0.0/src/yanga_core/steps/scoop_install_base.py +181 -0
  34. yanga_core-0.0.0/src/yanga_core/steps/west_install.py +44 -0
@@ -0,0 +1,22 @@
1
+
2
+ MIT License
3
+
4
+ Copyright (c) 2026 cuinixam
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -0,0 +1,155 @@
1
+ Metadata-Version: 2.4
2
+ Name: yanga-core
3
+ Version: 0.0.0
4
+ Summary: Core library for C/C++ software product line engineering.
5
+ License-Expression: MIT
6
+ License-File: LICENSE
7
+ Author: cuinixam
8
+ Author-email: cuinixam@gmail.com
9
+ Requires-Python: >=3.10
10
+ Classifier: Development Status :: 2 - Pre-Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Natural Language :: English
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Software Development :: Libraries
20
+ Requires-Dist: clanguru (>=0,<1)
21
+ Requires-Dist: kspl (>=1,<2)
22
+ Requires-Dist: mashumaro (>=3.13,<4)
23
+ Requires-Dist: pick (>=2.2,<3)
24
+ Requires-Dist: py-app-dev (>=2.1,<3)
25
+ Requires-Dist: typer (>=0,<1)
26
+ Project-URL: Bug Tracker, https://github.com/yanga-project/yanga-core/issues
27
+ Project-URL: Changelog, https://github.com/yanga-project/yanga-core/blob/main/CHANGELOG.md
28
+ Project-URL: Repository, https://github.com/yanga-project/yanga-core
29
+ Description-Content-Type: text/markdown
30
+
31
+ # Yanga Core
32
+
33
+ <p align="center">
34
+ <a href="https://github.com/yanga-project/yanga-core/actions/workflows/ci.yml?query=branch%3Amain">
35
+ <img src="https://img.shields.io/github/actions/workflow/status/yanga-project/yanga-core/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
36
+ </a>
37
+ <a href="https://codecov.io/gh/yanga-project/yanga-core">
38
+ <img src="https://img.shields.io/codecov/c/github/yanga-project/yanga-core.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
39
+ </a>
40
+ </p>
41
+ <p align="center">
42
+ <a href="https://github.com/astral-sh/uv">
43
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" alt="uv">
44
+ </a>
45
+ <a href="https://github.com/astral-sh/ruff">
46
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
47
+ </a>
48
+ <a href="https://github.com/cuinixam/pypeline">
49
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/cuinixam/pypeline/refs/heads/main/assets/badge/v0.json" alt="pypeline">
50
+ </a>
51
+ <a href="https://github.com/pre-commit/pre-commit">
52
+ <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
53
+ </a>
54
+ </p>
55
+ <p align="center">
56
+ <a href="https://pypi.org/project/yanga-core/">
57
+ <img src="https://img.shields.io/pypi/v/yanga-core.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
58
+ </a>
59
+ <img src="https://img.shields.io/pypi/pyversions/yanga-core.svg?style=flat-square&logo=python&amp;logoColor=fff" alt="Supported Python versions">
60
+ <img src="https://img.shields.io/pypi/l/yanga-core.svg?style=flat-square" alt="License">
61
+ </p>
62
+
63
+ ---
64
+
65
+ **Source Code**: <a href="https://github.com/yanga-project/yanga-core" target="_blank">https://github.com/yanga-project/yanga-core </a>
66
+
67
+ ---
68
+
69
+ Core library for C/C++ software product line (SPL) engineering. Works with any build system.
70
+
71
+ Yanga Core provides data models, configuration loading, pipeline steps, and commands that build system integrations (like [Yanga](https://github.com/yanga-project/yanga) for CMake) use to:
72
+
73
+ - Define platforms, variants, and components for a product line
74
+ - Run build pipeline steps (KConfig generation, dependency installation, static analysis, ...)
75
+ - Generate HTML reports (CppCheck, Sphinx docs, coverage)
76
+
77
+ ## Key Concepts
78
+
79
+ - **Platform** — build target with generators and build types (Debug, Release, ...)
80
+ - **Variant** — product configuration that picks which components to build for a platform
81
+ - **Component** — source code unit with sources, tests, docs, and include directories
82
+ - **ExecutionContext** — holds the active variant, platform, components, and shared data registry
83
+ - **Pipeline Step** — one step in the build pipeline (e.g. KConfig generation, dependency installation)
84
+
85
+ ## Installation
86
+
87
+ Requires Python 3.10+.
88
+
89
+ ```bash
90
+ pip install yanga-core
91
+ ```
92
+
93
+ ## Usage
94
+
95
+ `yanga-core` is a library, not a standalone CLI. Applications import its modules and compose them. See [Yanga](https://github.com/yanga-project/yanga) for a CMake-based application using `yanga-core`.
96
+
97
+ ```python
98
+ from yanga_core.domain.config import PlatformConfig, VariantConfig
99
+ from yanga_core.domain.components import Component
100
+ from yanga_core.domain.execution_context import ExecutionContext, UserRequest, UserRequestScope
101
+ from yanga_core.domain.project_slurper import ProjectSlurper
102
+ ```
103
+
104
+ ### Core Modules
105
+
106
+ | Module | Description |
107
+ | --------------------- | -------------------------------------------------------------------------- |
108
+ | `yanga_core.domain` | Config models, components, execution context, artifacts |
109
+ | `yanga_core.commands` | Commands for running steps, reports, compile commands, CppCheck, HTML fixes |
110
+ | `yanga_core.steps` | Pipeline steps for `pypeline` (KConfig, dependency install, reports) |
111
+ | `yanga_core.docs` | Sphinx doc generation helpers |
112
+
113
+ ## Contributing
114
+
115
+ ### Setup
116
+
117
+ ```bash
118
+ # Clone the repository
119
+ git clone https://github.com/yanga-project/yanga-core.git
120
+ cd yanga-core
121
+
122
+ # Install dependencies (using uv)
123
+ uv sync
124
+ ```
125
+
126
+ ### Running Tests
127
+
128
+ The project uses [pypeline-runner](https://github.com/yanga-project/pypeline) for automation:
129
+
130
+ ```bash
131
+ # Run full pipeline (lint + tests)
132
+ pypeline run
133
+
134
+ # Run only linting
135
+ pypeline run --step PreCommit
136
+
137
+ # Run only tests with a specific Python version
138
+ pypeline run --step CreateVEnv --step PyTest --single --input python_version=3.13
139
+ ```
140
+
141
+ ### Code Quality
142
+
143
+ - [Ruff](https://github.com/astral-sh/ruff) for linting and formatting
144
+ - [pre-commit](https://pre-commit.com/) hooks enforce code standards
145
+ - Commits must follow [conventional commits](https://www.conventionalcommits.org)
146
+
147
+ ## Credits
148
+
149
+ [![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json)](https://github.com/copier-org/copier)
150
+
151
+ This package was created with
152
+ [Copier](https://copier.readthedocs.io/) and the
153
+ [browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
154
+ project template.
155
+
@@ -0,0 +1,124 @@
1
+ # Yanga Core
2
+
3
+ <p align="center">
4
+ <a href="https://github.com/yanga-project/yanga-core/actions/workflows/ci.yml?query=branch%3Amain">
5
+ <img src="https://img.shields.io/github/actions/workflow/status/yanga-project/yanga-core/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
6
+ </a>
7
+ <a href="https://codecov.io/gh/yanga-project/yanga-core">
8
+ <img src="https://img.shields.io/codecov/c/github/yanga-project/yanga-core.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
9
+ </a>
10
+ </p>
11
+ <p align="center">
12
+ <a href="https://github.com/astral-sh/uv">
13
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" alt="uv">
14
+ </a>
15
+ <a href="https://github.com/astral-sh/ruff">
16
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
17
+ </a>
18
+ <a href="https://github.com/cuinixam/pypeline">
19
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/cuinixam/pypeline/refs/heads/main/assets/badge/v0.json" alt="pypeline">
20
+ </a>
21
+ <a href="https://github.com/pre-commit/pre-commit">
22
+ <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
23
+ </a>
24
+ </p>
25
+ <p align="center">
26
+ <a href="https://pypi.org/project/yanga-core/">
27
+ <img src="https://img.shields.io/pypi/v/yanga-core.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
28
+ </a>
29
+ <img src="https://img.shields.io/pypi/pyversions/yanga-core.svg?style=flat-square&logo=python&amp;logoColor=fff" alt="Supported Python versions">
30
+ <img src="https://img.shields.io/pypi/l/yanga-core.svg?style=flat-square" alt="License">
31
+ </p>
32
+
33
+ ---
34
+
35
+ **Source Code**: <a href="https://github.com/yanga-project/yanga-core" target="_blank">https://github.com/yanga-project/yanga-core </a>
36
+
37
+ ---
38
+
39
+ Core library for C/C++ software product line (SPL) engineering. Works with any build system.
40
+
41
+ Yanga Core provides data models, configuration loading, pipeline steps, and commands that build system integrations (like [Yanga](https://github.com/yanga-project/yanga) for CMake) use to:
42
+
43
+ - Define platforms, variants, and components for a product line
44
+ - Run build pipeline steps (KConfig generation, dependency installation, static analysis, ...)
45
+ - Generate HTML reports (CppCheck, Sphinx docs, coverage)
46
+
47
+ ## Key Concepts
48
+
49
+ - **Platform** — build target with generators and build types (Debug, Release, ...)
50
+ - **Variant** — product configuration that picks which components to build for a platform
51
+ - **Component** — source code unit with sources, tests, docs, and include directories
52
+ - **ExecutionContext** — holds the active variant, platform, components, and shared data registry
53
+ - **Pipeline Step** — one step in the build pipeline (e.g. KConfig generation, dependency installation)
54
+
55
+ ## Installation
56
+
57
+ Requires Python 3.10+.
58
+
59
+ ```bash
60
+ pip install yanga-core
61
+ ```
62
+
63
+ ## Usage
64
+
65
+ `yanga-core` is a library, not a standalone CLI. Applications import its modules and compose them. See [Yanga](https://github.com/yanga-project/yanga) for a CMake-based application using `yanga-core`.
66
+
67
+ ```python
68
+ from yanga_core.domain.config import PlatformConfig, VariantConfig
69
+ from yanga_core.domain.components import Component
70
+ from yanga_core.domain.execution_context import ExecutionContext, UserRequest, UserRequestScope
71
+ from yanga_core.domain.project_slurper import ProjectSlurper
72
+ ```
73
+
74
+ ### Core Modules
75
+
76
+ | Module | Description |
77
+ | --------------------- | -------------------------------------------------------------------------- |
78
+ | `yanga_core.domain` | Config models, components, execution context, artifacts |
79
+ | `yanga_core.commands` | Commands for running steps, reports, compile commands, CppCheck, HTML fixes |
80
+ | `yanga_core.steps` | Pipeline steps for `pypeline` (KConfig, dependency install, reports) |
81
+ | `yanga_core.docs` | Sphinx doc generation helpers |
82
+
83
+ ## Contributing
84
+
85
+ ### Setup
86
+
87
+ ```bash
88
+ # Clone the repository
89
+ git clone https://github.com/yanga-project/yanga-core.git
90
+ cd yanga-core
91
+
92
+ # Install dependencies (using uv)
93
+ uv sync
94
+ ```
95
+
96
+ ### Running Tests
97
+
98
+ The project uses [pypeline-runner](https://github.com/yanga-project/pypeline) for automation:
99
+
100
+ ```bash
101
+ # Run full pipeline (lint + tests)
102
+ pypeline run
103
+
104
+ # Run only linting
105
+ pypeline run --step PreCommit
106
+
107
+ # Run only tests with a specific Python version
108
+ pypeline run --step CreateVEnv --step PyTest --single --input python_version=3.13
109
+ ```
110
+
111
+ ### Code Quality
112
+
113
+ - [Ruff](https://github.com/astral-sh/ruff) for linting and formatting
114
+ - [pre-commit](https://pre-commit.com/) hooks enforce code standards
115
+ - Commits must follow [conventional commits](https://www.conventionalcommits.org)
116
+
117
+ ## Credits
118
+
119
+ [![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json)](https://github.com/copier-org/copier)
120
+
121
+ This package was created with
122
+ [Copier](https://copier.readthedocs.io/) and the
123
+ [browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
124
+ project template.
@@ -0,0 +1,181 @@
1
+ [project]
2
+ name = "yanga-core"
3
+ version = "0.0.0"
4
+ description = "Core library for C/C++ software product line engineering."
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ authors = [
8
+ { name = "cuinixam", email = "cuinixam@gmail.com" },
9
+ ]
10
+ requires-python = ">=3.10"
11
+ classifiers = [
12
+ "Development Status :: 2 - Pre-Alpha",
13
+ "Intended Audience :: Developers",
14
+ "Natural Language :: English",
15
+ "Operating System :: OS Independent",
16
+ "Programming Language :: Python :: 3.10",
17
+ "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Programming Language :: Python :: 3.14",
21
+ "Topic :: Software Development :: Libraries",
22
+ ]
23
+
24
+ dependencies = [
25
+ "py-app-dev>=2.1,<3",
26
+ "typer>=0,<1",
27
+ "mashumaro>=3.13,<4",
28
+ "clanguru>=0,<1",
29
+ "kspl>=1,<2",
30
+ "pick>=2.2,<3",
31
+ ]
32
+ urls."Bug Tracker" = "https://github.com/yanga-project/yanga-core/issues"
33
+ urls.Changelog = "https://github.com/yanga-project/yanga-core/blob/main/CHANGELOG.md"
34
+ urls.repository = "https://github.com/yanga-project/yanga-core"
35
+
36
+ [build-system]
37
+ requires = ["poetry-core>=2,<3"]
38
+ build-backend = "poetry.core.masonry.api"
39
+
40
+ [dependency-groups]
41
+ dev = [
42
+ "pytest==9.*",
43
+ "coverage",
44
+ "pytest-cov==7.*",
45
+ "pypeline-runner>=1,<2",
46
+ "pre-commit>=4,<5",
47
+ "ruff>=0,<1",
48
+ # docs
49
+ "myst-parser>=4,<5",
50
+ "furo",
51
+ "sphinx-copybutton>=0,<1",
52
+ "sphinx-design>=0,<1",
53
+ "sphinx-new-tab-link>=0,<1",
54
+ "sphinx-rtd-size>=0.2,<1",
55
+ "sphinxcontrib-mermaid>=1,<2",
56
+ ]
57
+
58
+ [tool.ruff]
59
+ line-length = 180
60
+ lint.select = [
61
+ "B", # flake8-bugbear
62
+ "D", # flake8-docstrings
63
+ "C4", # flake8-comprehensions
64
+ "S", # flake8-bandit
65
+ "F", # pyflake
66
+ "E", # pycodestyle
67
+ "W", # pycodestyle
68
+ "UP", # pyupgrade
69
+ "I", # isort
70
+ "RUF", # ruff specific
71
+ ]
72
+ lint.ignore = [
73
+ "D100", # Missing docstring in public module
74
+ "D101", # Missing docstring in public class
75
+ "D102", # Missing docstring in public method
76
+ "D103", # Missing docstring in public function
77
+ "D104", # Missing docstring in public package
78
+ "D105", # Missing docstring in magic method
79
+ "D203", # 1 blank line required before class docstring
80
+ "D212", # Multi-line docstring summary should start at the first line
81
+ "D100", # Missing docstring in public module
82
+ "D104", # Missing docstring in public package
83
+ "D106", # Missing docstring in public nested class
84
+ "D107", # Missing docstring in `__init__`
85
+ "D401", # First line of docstring should be in imperative mood
86
+ ]
87
+ lint.per-file-ignores."conftest.py" = [ "D100" ]
88
+ lint.per-file-ignores."setup.py" = [ "D100" ]
89
+ lint.per-file-ignores."tests/**/*" = [
90
+ "D100",
91
+ "D101",
92
+ "D102",
93
+ "D103",
94
+ "D104",
95
+ "S101",
96
+ ]
97
+ lint.isort.known-first-party = [ "yanga_core", "tests" ]
98
+
99
+ [tool.pyproject-fmt]
100
+ max_supported_python = "3.14"
101
+
102
+ [tool.pytest]
103
+ minversion = "9.0"
104
+ addopts = [
105
+ "-v",
106
+ "-Wonce",
107
+ "-p no:doctest",
108
+ "--cov=yanga_core",
109
+ "--cov-report=term",
110
+ "--cov-report=xml"
111
+ ]
112
+ pythonpath = [ "src" ]
113
+
114
+ [tool.coverage]
115
+ run.branch = true
116
+ paths.source = [
117
+ "src",
118
+ ".tox/**/site-packages",
119
+ ]
120
+ report.exclude_lines = [
121
+ "pragma: no cover",
122
+ "@overload",
123
+ "if TYPE_CHECKING",
124
+ "raise NotImplementedError",
125
+ 'if __name__ == "__main__":',
126
+ ]
127
+
128
+ [tool.mypy]
129
+ check_untyped_defs = true
130
+ disallow_any_generics = true
131
+ disallow_incomplete_defs = true
132
+ disallow_untyped_defs = true
133
+ mypy_path = "src/"
134
+ no_implicit_optional = true
135
+ show_error_codes = true
136
+ warn_unreachable = true
137
+ warn_unused_ignores = true
138
+ exclude = [
139
+ 'docs/.*',
140
+ 'setup.py',
141
+ ]
142
+ disable_error_code = [ "import-untyped" ]
143
+
144
+ [[tool.mypy.overrides]]
145
+ module = "tests.*"
146
+ allow_untyped_defs = true
147
+
148
+ [tool.semantic_release]
149
+ allow_zero_version = true
150
+ version_toml = [ "pyproject.toml:project.version" ]
151
+ version_variables = [
152
+ "src/yanga_core/__init__.py:__version__",
153
+ ]
154
+ build_command = """
155
+ pip install uv
156
+ uv lock
157
+ git add uv.lock
158
+ uv build
159
+ """
160
+
161
+ [tool.semantic_release.changelog]
162
+ exclude_commit_patterns = [
163
+ '''chore(?:\([^)]*?\))?: .+''',
164
+ '''ci(?:\([^)]*?\))?: .+''',
165
+ '''refactor(?:\([^)]*?\))?: .+''',
166
+ '''style(?:\([^)]*?\))?: .+''',
167
+ '''test(?:\([^)]*?\))?: .+''',
168
+ '''build\((?!deps\): .+)''',
169
+ '''Merged? .*''',
170
+ '''Initial [Cc]ommit.*''', # codespell:ignore
171
+ ]
172
+
173
+ [tool.semantic_release.changelog.environment]
174
+ keep_trailing_newline = true
175
+
176
+ [tool.semantic_release.branches.main]
177
+ match = "main"
178
+
179
+ [tool.semantic_release.branches.noop]
180
+ match = "(?!main$)"
181
+ prerelease = true
@@ -0,0 +1 @@
1
+ __version__ = "0.0.0"
File without changes
@@ -0,0 +1,48 @@
1
+ from argparse import Namespace
2
+ from dataclasses import dataclass, field
3
+ from pathlib import Path
4
+ from typing import TypeVar
5
+
6
+ from mashumaro import DataClassDictMixin
7
+ from pick import pick
8
+ from py_app_dev.core.logging import logger
9
+
10
+ T = TypeVar("T", bound=DataClassDictMixin)
11
+
12
+
13
+ def create_config(config_class: type[T], namespace: Namespace) -> T:
14
+ """
15
+ Creates a configuration instance from an argparse Namespace for the given class.
16
+
17
+ - config_class: The class type to instantiate, inheriting from DataClassDictMixin.
18
+ - namespace: The argparse Namespace containing configuration data.
19
+
20
+ It returns an instance of config_class populated with data from namespace.
21
+
22
+ """
23
+ return config_class.from_dict(vars(namespace))
24
+
25
+
26
+ @dataclass
27
+ class CommandConfigBase(DataClassDictMixin):
28
+ project_dir: Path = field(
29
+ default=Path(".").absolute(),
30
+ metadata={"help": "Project root directory. Defaults to the current directory if not specified."},
31
+ )
32
+
33
+
34
+ def prompt_user_to_select_option(options: list[str], prompt: str) -> str | None:
35
+ if not options:
36
+ return None
37
+ # If there is only one option, return it immediately
38
+ if len(options) == 1:
39
+ return options[0]
40
+ try:
41
+ # TODO: this message is only necessary in case the user will press Ctrl+C to quit.
42
+ # In this case, after pick method returns, the execution is paused until the user presses any key.
43
+ # I have no idea why that happens.
44
+ logger.info("Press any key to continue...")
45
+ selected_variant, _ = pick(options, prompt, indicator="=>")
46
+ except KeyboardInterrupt:
47
+ selected_variant = None
48
+ return str(selected_variant) if selected_variant else None