pwrforge 0.0.2__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 (120) hide show
  1. pwrforge-0.0.2/LICENSE +20 -0
  2. pwrforge-0.0.2/PKG-INFO +229 -0
  3. pwrforge-0.0.2/README.md +132 -0
  4. pwrforge-0.0.2/pwrforge/__init__.py +10 -0
  5. pwrforge-0.0.2/pwrforge/certs/certGen.sh +519 -0
  6. pwrforge-0.0.2/pwrforge/certs/generateAllCertificates.sh +133 -0
  7. pwrforge-0.0.2/pwrforge/certs/openssl_device_intermediate_ca.cnf +127 -0
  8. pwrforge-0.0.2/pwrforge/certs/openssl_root_ca.cnf +127 -0
  9. pwrforge-0.0.2/pwrforge/cli.py +522 -0
  10. pwrforge-0.0.2/pwrforge/commands/__init__.py +0 -0
  11. pwrforge-0.0.2/pwrforge/commands/build.py +103 -0
  12. pwrforge-0.0.2/pwrforge/commands/check.py +611 -0
  13. pwrforge-0.0.2/pwrforge/commands/clean.py +57 -0
  14. pwrforge-0.0.2/pwrforge/commands/debug.py +104 -0
  15. pwrforge-0.0.2/pwrforge/commands/doc.py +98 -0
  16. pwrforge-0.0.2/pwrforge/commands/docker.py +148 -0
  17. pwrforge-0.0.2/pwrforge/commands/fix.py +41 -0
  18. pwrforge-0.0.2/pwrforge/commands/flash.py +238 -0
  19. pwrforge-0.0.2/pwrforge/commands/gen.py +132 -0
  20. pwrforge-0.0.2/pwrforge/commands/license_check.py +156 -0
  21. pwrforge-0.0.2/pwrforge/commands/monitor.py +180 -0
  22. pwrforge-0.0.2/pwrforge/commands/new.py +150 -0
  23. pwrforge-0.0.2/pwrforge/commands/publish.py +95 -0
  24. pwrforge-0.0.2/pwrforge/commands/run.py +57 -0
  25. pwrforge-0.0.2/pwrforge/commands/test.py +254 -0
  26. pwrforge-0.0.2/pwrforge/commands/update.py +158 -0
  27. pwrforge-0.0.2/pwrforge/commands/version.py +10 -0
  28. pwrforge-0.0.2/pwrforge/config.py +362 -0
  29. pwrforge-0.0.2/pwrforge/config_utils.py +95 -0
  30. pwrforge-0.0.2/pwrforge/file_generators/__init__.py +0 -0
  31. pwrforge-0.0.2/pwrforge/file_generators/base_gen.py +45 -0
  32. pwrforge-0.0.2/pwrforge/file_generators/cicd_gen.py +113 -0
  33. pwrforge-0.0.2/pwrforge/file_generators/clang_parser/__init__.py +0 -0
  34. pwrforge-0.0.2/pwrforge/file_generators/clang_parser/data_classes.py +82 -0
  35. pwrforge-0.0.2/pwrforge/file_generators/clang_parser/header_parser.py +28 -0
  36. pwrforge-0.0.2/pwrforge/file_generators/clang_parser/params_extractor.py +74 -0
  37. pwrforge-0.0.2/pwrforge/file_generators/cmake_gen.py +11 -0
  38. pwrforge-0.0.2/pwrforge/file_generators/conan_gen.py +67 -0
  39. pwrforge-0.0.2/pwrforge/file_generators/cpp_gen.py +117 -0
  40. pwrforge-0.0.2/pwrforge/file_generators/docker_gen.py +118 -0
  41. pwrforge-0.0.2/pwrforge/file_generators/env_gen.py +35 -0
  42. pwrforge-0.0.2/pwrforge/file_generators/mock_gen.py +48 -0
  43. pwrforge-0.0.2/pwrforge/file_generators/readme_gen.py +13 -0
  44. pwrforge-0.0.2/pwrforge/file_generators/templates/.gitlab-ci-custom.yml.j2 +2 -0
  45. pwrforge-0.0.2/pwrforge/file_generators/templates/.gitlab-ci.yml.j2 +181 -0
  46. pwrforge-0.0.2/pwrforge/file_generators/templates/CMakeLists.txt.j2 +66 -0
  47. pwrforge-0.0.2/pwrforge/file_generators/templates/README.md.j2 +243 -0
  48. pwrforge-0.0.2/pwrforge/file_generators/templates/conan/conanfile.py.j2 +115 -0
  49. pwrforge-0.0.2/pwrforge/file_generators/templates/conan/conanfiletest.j2 +44 -0
  50. pwrforge-0.0.2/pwrforge/file_generators/templates/conan/profile_atsam.j2 +22 -0
  51. pwrforge-0.0.2/pwrforge/file_generators/templates/conan/profile_esp32.j2 +21 -0
  52. pwrforge-0.0.2/pwrforge/file_generators/templates/conan/profile_stm32.j2 +22 -0
  53. pwrforge-0.0.2/pwrforge/file_generators/templates/conan/profile_x86.j2 +28 -0
  54. pwrforge-0.0.2/pwrforge/file_generators/templates/conan/test_package/CMakeLists.txt.j2 +11 -0
  55. pwrforge-0.0.2/pwrforge/file_generators/templates/conan/test_package/conanfile.py.j2 +30 -0
  56. pwrforge-0.0.2/pwrforge/file_generators/templates/conan/test_package/devcontainer.json.j2 +35 -0
  57. pwrforge-0.0.2/pwrforge/file_generators/templates/conan/test_package/example.cpp.j2 +7 -0
  58. pwrforge-0.0.2/pwrforge/file_generators/templates/conan/toolchain/arm_gcc_toolchain.cmake.j2 +68 -0
  59. pwrforge-0.0.2/pwrforge/file_generators/templates/conan/toolchain/stm32_gcc_toolchain.cmake.j2 +12 -0
  60. pwrforge-0.0.2/pwrforge/file_generators/templates/cpp/cmake-src-atsam.j2 +74 -0
  61. pwrforge-0.0.2/pwrforge/file_generators/templates/cpp/cmake-src-esp32.j2 +4 -0
  62. pwrforge-0.0.2/pwrforge/file_generators/templates/cpp/cmake-src-multitarget.j2 +1 -0
  63. pwrforge-0.0.2/pwrforge/file_generators/templates/cpp/cmake-src-stm32.j2 +80 -0
  64. pwrforge-0.0.2/pwrforge/file_generators/templates/cpp/cmake-src-x86.j2 +23 -0
  65. pwrforge-0.0.2/pwrforge/file_generators/templates/cpp/lib.cpp.j2 +9 -0
  66. pwrforge-0.0.2/pwrforge/file_generators/templates/cpp/lib.h.j2 +14 -0
  67. pwrforge-0.0.2/pwrforge/file_generators/templates/cpp/main.cpp.j2 +46 -0
  68. pwrforge-0.0.2/pwrforge/file_generators/templates/docker/Dockerfile-arm.j2 +22 -0
  69. pwrforge-0.0.2/pwrforge/file_generators/templates/docker/Dockerfile-custom.j2 +2 -0
  70. pwrforge-0.0.2/pwrforge/file_generators/templates/docker/Dockerfile-esp32.j2 +37 -0
  71. pwrforge-0.0.2/pwrforge/file_generators/templates/docker/Dockerfile.j2 +96 -0
  72. pwrforge-0.0.2/pwrforge/file_generators/templates/docker/atsam-gdb.script.j2 +6 -0
  73. pwrforge-0.0.2/pwrforge/file_generators/templates/docker/atsam-openocd.cfg.j2 +6 -0
  74. pwrforge-0.0.2/pwrforge/file_generators/templates/docker/devcontainer.json.j2 +35 -0
  75. pwrforge-0.0.2/pwrforge/file_generators/templates/docker/docker-compose.yaml.j2 +26 -0
  76. pwrforge-0.0.2/pwrforge/file_generators/templates/docker/env.txt.j2 +8 -0
  77. pwrforge-0.0.2/pwrforge/file_generators/templates/docker/stm32-openocd.cfg.j2 +4 -0
  78. pwrforge-0.0.2/pwrforge/file_generators/templates/mock/.clang-format +2 -0
  79. pwrforge-0.0.2/pwrforge/file_generators/templates/mock/CMakeLists.txt +22 -0
  80. pwrforge-0.0.2/pwrforge/file_generators/templates/mock/class_interface.h.j2 +25 -0
  81. pwrforge-0.0.2/pwrforge/file_generators/templates/mock/class_mock.cpp.j2 +26 -0
  82. pwrforge-0.0.2/pwrforge/file_generators/templates/mock/class_mock.h.j2 +24 -0
  83. pwrforge-0.0.2/pwrforge/file_generators/templates/pwrforge.toml.j2 +157 -0
  84. pwrforge-0.0.2/pwrforge/file_generators/templates/setup.sh.j2 +22 -0
  85. pwrforge-0.0.2/pwrforge/file_generators/templates/tests/CMakeLists-it.txt.j2 +1 -0
  86. pwrforge-0.0.2/pwrforge/file_generators/templates/tests/CMakeLists-mocks.txt.j2 +1 -0
  87. pwrforge-0.0.2/pwrforge/file_generators/templates/tests/CMakeLists-test.txt.j2 +40 -0
  88. pwrforge-0.0.2/pwrforge/file_generators/templates/tests/CMakeLists-ut.txt.j2 +1 -0
  89. pwrforge-0.0.2/pwrforge/file_generators/templates/tests/static_mock/CMakeLists.txt +14 -0
  90. pwrforge-0.0.2/pwrforge/file_generators/templates/tests/static_mock/static_mock.h +50 -0
  91. pwrforge-0.0.2/pwrforge/file_generators/templates/ut/.clang-format +2 -0
  92. pwrforge-0.0.2/pwrforge/file_generators/templates/ut/CMakeLists.txt.j2 +31 -0
  93. pwrforge-0.0.2/pwrforge/file_generators/templates/ut/ut.cpp.j2 +37 -0
  94. pwrforge-0.0.2/pwrforge/file_generators/templates/vscode/launch.json.j2 +20 -0
  95. pwrforge-0.0.2/pwrforge/file_generators/templates/vscode/tasks.json.j2 +40 -0
  96. pwrforge-0.0.2/pwrforge/file_generators/tests_gen.py +44 -0
  97. pwrforge-0.0.2/pwrforge/file_generators/toml_gen.py +16 -0
  98. pwrforge-0.0.2/pwrforge/file_generators/ut_gen.py +154 -0
  99. pwrforge-0.0.2/pwrforge/file_generators/vscode_gen.py +56 -0
  100. pwrforge-0.0.2/pwrforge/global_values.py +20 -0
  101. pwrforge-0.0.2/pwrforge/logger.py +56 -0
  102. pwrforge-0.0.2/pwrforge/target_helpers/__init__.py +0 -0
  103. pwrforge-0.0.2/pwrforge/target_helpers/atmel.xml +1340 -0
  104. pwrforge-0.0.2/pwrforge/target_helpers/atsam_helper.py +98 -0
  105. pwrforge-0.0.2/pwrforge/target_helpers/esp32_helper.py +104 -0
  106. pwrforge-0.0.2/pwrforge/target_helpers/stm32_helper.py +36 -0
  107. pwrforge-0.0.2/pwrforge/templates/.clang-format +102 -0
  108. pwrforge-0.0.2/pwrforge/templates/.clang-tidy +166 -0
  109. pwrforge-0.0.2/pwrforge/templates/.devcontainer/pwrforge-0.0.2-py3-none-any.whl +0 -0
  110. pwrforge-0.0.2/pwrforge/templates/.devcontainer/requirements.txt +118 -0
  111. pwrforge-0.0.2/pwrforge/templates/.gitignore +187 -0
  112. pwrforge-0.0.2/pwrforge/templates/LICENSE +20 -0
  113. pwrforge-0.0.2/pwrforge/utils/__init__.py +0 -0
  114. pwrforge-0.0.2/pwrforge/utils/clang_utils.py +19 -0
  115. pwrforge-0.0.2/pwrforge/utils/conan_utils.py +74 -0
  116. pwrforge-0.0.2/pwrforge/utils/docker_utils.py +83 -0
  117. pwrforge-0.0.2/pwrforge/utils/file_utils.py +82 -0
  118. pwrforge-0.0.2/pwrforge/utils/path_utils.py +18 -0
  119. pwrforge-0.0.2/pwrforge/utils/sys_utils.py +38 -0
  120. pwrforge-0.0.2/pyproject.toml +159 -0
pwrforge-0.0.2/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2025 Wroclaw University of Science and Technology.
2
+ Copyright (c) 2022 Spyrosoft Solution S.A.
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
@@ -0,0 +1,229 @@
1
+ Metadata-Version: 2.4
2
+ Name: pwrforge
3
+ Version: 0.0.2
4
+ Summary: C/C++ package and software development life cycle manager. Continuation of scargo project.
5
+ License: Copyright (c) 2025 Wroclaw University of Science and Technology.
6
+ Copyright (c) 2022 Spyrosoft Solution S.A.
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
25
+ License-File: LICENSE
26
+ Keywords: firmware,package,embedded,cli
27
+ Author: Andrzej Aksenczuk
28
+ Author-email: andrzej.aksenczuk@pwr.edu.pl
29
+ Requires-Python: >=3.10
30
+ Classifier: Development Status :: 4 - Beta
31
+ Classifier: Intended Audience :: Developers
32
+ Classifier: Natural Language :: English
33
+ Classifier: Operating System :: POSIX
34
+ Classifier: Operating System :: Microsoft :: Windows
35
+ Classifier: Operating System :: MacOS :: MacOS X
36
+ Classifier: Environment :: Console
37
+ Classifier: License :: OSI Approved :: MIT License
38
+ Classifier: Programming Language :: Python :: 3.11
39
+ Classifier: Programming Language :: Python :: 3.12
40
+ Classifier: Programming Language :: Python :: 3.13
41
+ Provides-Extra: dev
42
+ Provides-Extra: doc
43
+ Requires-Dist: Sphinx ; extra == "doc"
44
+ Requires-Dist: black (==24.8.0) ; extra == "dev"
45
+ Requires-Dist: clang (==17.0.6)
46
+ Requires-Dist: click (==8.1.3)
47
+ Requires-Dist: cmake (==3.30.5)
48
+ Requires-Dist: coloredlogs (==15.0.1)
49
+ Requires-Dist: conan (==2.8.1)
50
+ Requires-Dist: coverage (>=7.6.1,<7.7.0) ; extra == "dev"
51
+ Requires-Dist: docker (==7.1.0)
52
+ Requires-Dist: esptool (==4.7.0)
53
+ Requires-Dist: flake8 (>=6.1.0) ; extra == "dev"
54
+ Requires-Dist: flit (==3.8.0) ; extra == "dev"
55
+ Requires-Dist: gcovr (==8.2)
56
+ Requires-Dist: isort (==5.11.4) ; extra == "dev"
57
+ Requires-Dist: jinja2 (==3.1.4)
58
+ Requires-Dist: libclang (==18.1.1)
59
+ Requires-Dist: lizard (==1.17.10)
60
+ Requires-Dist: matplotlib (==3.7.5) ; extra == "dev"
61
+ Requires-Dist: mypy (==1.14.1) ; extra == "dev"
62
+ Requires-Dist: numpy (>=1.26.0) ; extra == "dev"
63
+ Requires-Dist: paramiko (==3.5.0)
64
+ Requires-Dist: pip-tools (==7.5.2) ; extra == "dev"
65
+ Requires-Dist: pre-commit ; extra == "dev"
66
+ Requires-Dist: pyclean (==3.0.0) ; extra == "dev"
67
+ Requires-Dist: pydantic (==1.10.6)
68
+ Requires-Dist: pyelftools ; extra == "dev"
69
+ Requires-Dist: pyfakefs (==5.3.2) ; extra == "dev"
70
+ Requires-Dist: pylint (==3.2.7) ; extra == "dev"
71
+ Requires-Dist: pyopenssl (==23.2.0) ; extra == "dev"
72
+ Requires-Dist: pytest (==7.4.3) ; extra == "dev"
73
+ Requires-Dist: pytest-cov (==4.1.0) ; extra == "dev"
74
+ Requires-Dist: pytest-lazy-fixture (==0.6.3) ; extra == "dev"
75
+ Requires-Dist: pytest-mock (==3.12.0) ; extra == "dev"
76
+ Requires-Dist: pytest-order (==1.2.0) ; extra == "dev"
77
+ Requires-Dist: pytest-subprocess (==1.5.0) ; extra == "dev"
78
+ Requires-Dist: pytest-xdist (==3.5.0) ; extra == "dev"
79
+ Requires-Dist: pyyaml (==6.0.2)
80
+ Requires-Dist: recommonmark ; extra == "doc"
81
+ Requires-Dist: sphinx-rtd-theme (==1.1.1) ; extra == "doc"
82
+ Requires-Dist: sphinxcontrib-plantuml (==0.30) ; extra == "doc"
83
+ Requires-Dist: toml (==0.10.2)
84
+ Requires-Dist: tomlkit (==0.13.2)
85
+ Requires-Dist: typer (==0.9.0)
86
+ Requires-Dist: types-PyYAML (==6.0.12.12) ; extra == "dev"
87
+ Requires-Dist: types-clang (==0.14.3) ; extra == "dev"
88
+ Requires-Dist: types-pyOpenSSL (==23.2.0) ; extra == "dev"
89
+ Requires-Dist: types-toml ; extra == "dev"
90
+ Requires-Dist: typing-extensions (==4.6.0)
91
+ Requires-Dist: unittest-xml-reporting ; extra == "dev"
92
+ Project-URL: Documentation, https://pwr.github.io/pwrforge/index.html
93
+ Project-URL: Source, https://github.com/pwr/pwrforge
94
+ Project-URL: Tracker, https://github.com/pwr/pwrforge/issues
95
+ Description-Content-Type: text/markdown
96
+
97
+ # pwrforge
98
+ pwrforge project was written by PWR team and is continuation of Spyrosoft Solutions S.A. scargo project. Find more information at [tft.pwr.edu.pl](https://tft.pwr.edu.pl/).
99
+ <p align="center">
100
+ <img src="docs/source/_static/pwr_logo_color.png" alt="pwr" width="200"/>
101
+ </p>
102
+
103
+ # Overview
104
+ This is the documentation for pwrforge - a Python-based C/C++ package and software development life cycle manager inspired by RUST cargo idea.
105
+
106
+ pwrforge can:
107
+
108
+ - Create a new project (binary or library) for embedded systems and x86
109
+ - Build the project
110
+ - Run static code analyzers
111
+ - Fix chosen problem automatically based on the checker analysis
112
+ - Run unit tests
113
+ - Generate documentation from the source code
114
+ - Work with the predefined docker environment depending on the chosen architecture
115
+ - Generate mocks and test skeletetons
116
+
117
+ # Installation
118
+ ## Installing pwrforge on Ubuntu 24.04+ (PEP 668-compliant systems)
119
+
120
+ Ubuntu 24.04 and newer follow PEP 668, which restricts the use of pip in the system Python environment to prevent accidental damage to system-managed packages.
121
+
122
+ To safely install pwrforge, use a virtual environment:
123
+
124
+ ```
125
+ python3.12 -m venv .venv
126
+ source .venv/bin/activate
127
+ pip install --upgrade pip
128
+ pip install pwrforge
129
+ ```
130
+
131
+ This ensures isolated and conflict-free usage of pwrforge without requiring elevated privileges or --break-system-packages.
132
+
133
+ ## Install on ubuntu <=22.04, windows or macos
134
+ pwrforge is available on [pypi](https://pypi.org/project/pwrforge/), so you can install it with pip:
135
+
136
+ ```pip install pwrforge```
137
+
138
+ If system does not find 'pwrforge' command after installing, add the installation directory to your env paths. On Ubuntu you can find installation directory by running:
139
+
140
+ ```$ pip show "pwrforge"```
141
+
142
+ Then add to PATH e.g.:
143
+
144
+ ```$ export PATH=~/.local/bin:${PATH}```
145
+
146
+ # Working with pwrforge
147
+ ![pwrforge flow animation](docs/source/_static/pwrforge_flow_docker.svg)
148
+
149
+ # Project dependencies
150
+ ## Working with docker (recommended)
151
+ - docker with docker-compose - https://docs.docker.com/engine/install/ubuntu/
152
+ - pip
153
+ - python3 - `sudo apt install python3.12-venv python3.12-distutils -y`
154
+
155
+ # Work environment
156
+ You can always change work environment between docker or native after project is created.
157
+ Just edit the pwrforge.toml file ([project] -> build-env = "docker" or build-env = "native").
158
+ For it may be needed dependencies manually which are included in `.devcontainer/Dockerfile`
159
+
160
+ Its recommended to work in virtual environment (venv) or conda environment e.g.:
161
+ - pip install virtualenv
162
+ - virtualenv -p /usr/bin/python3.12 venv
163
+ - source venv/bin/activate
164
+
165
+
166
+ ## Working in docker
167
+ 1) If you create a new project, run `docker compose run pwrforge-dev` to run project development image depending on chosen architecture. All dependencies should be already there.
168
+ Run pwrforge commands as you would do natively.
169
+
170
+ 2) If you create a project with --docker flag (`pwrforge new <my_proj> --docker ...`) or with any docker flag, by default each pwrforge command will be triggered in docker.
171
+
172
+ ## Working natively
173
+ 1) Create a project with --no-docker flag (`pwrforge new <my_proj> --no-docker ...`).
174
+
175
+ ## Create the requirements for docker env
176
+ From version 2.3.2 the pwrforge is install in docker but overload by docker compose volume data, to get present version from your native env.
177
+ During deployment the requirements file is created using following command
178
+
179
+ - `pip-compile --all-extras --output-file=ci/requirements.txt pyproject.toml`
180
+ - `pip-compile --output-file=pwrforge/file_generators/templates/docker/requirements.txt.j2 pyproject.toml`
181
+
182
+ to have all newest dependencies. This solutions allow as to have pwrforge install in docker for ci/cd and be able to use newest features without official releases.
183
+
184
+ ## Testing custom pwrforge generated project locally
185
+ You can make changes in pwrforge and install it locally using ```pip install .``` command when you are in the main project folder.
186
+ To test the custom pwrforge version and have this custom pwrforge available also inside the docker (crucial for testing), in created project update docker-compose.yaml:
187
+
188
+ volumes:
189
+
190
+ - ..:/workspace
191
+ - /dev:/dev
192
+ - ~/.local/lib/python3.12/site-packages/pwrforge:/usr/local/lib/python3.12/dist-packages/pwrforge
193
+
194
+ Where ```~/.local/lib/python3.12/site-packages/pwrforge``` is a path to pwrforge on your local machine. It the following path is not working, find installation dir using ```pip show pwrforge```.
195
+
196
+ To keep this setup between ```pwrforge update``` commands, in pwrforge.toml file update also ```update-exclude``` as in following example:
197
+
198
+ update-exclude = [".devcontainer/docker-compose.yaml"]
199
+
200
+ pip install --upgrade build
201
+ python -m build --wheel
202
+
203
+ # Known Issues
204
+
205
+ ## MacOs with ARM processors
206
+ - On macOS devices with ARM processors (such as M1 and M3), USB device passthrough to Docker containers is not supported. While most development tasks can be performed within the Docker container, actions that involve direct interaction with USB devices, such as flashing firmware or monitoring hardware, must be executed natively on the host system.
207
+
208
+ ## Windows
209
+
210
+ - On Windows devices, USB device passthrough is not supported in Docker containers when using Docker Desktop. To work around this limitation, you can use WSL2 (Windows Subsystem for Linux) or run a virtual machine with a Linux distribution like Ubuntu 22.04 to enable USB device access.
211
+
212
+ # Potential issues
213
+
214
+ pip install -e ".[dev]"
215
+
216
+ ## Docker permissions on Ubuntu
217
+
218
+ When using the `docker-compose` command, you may encounter permission errors due to insufficient permissions for accessing the Docker daemon socket. To resolve this issue, ensure that your user has the necessary permissions by adding your user to the `docker` group or granting appropriate access rights to the Docker daemon socket.
219
+ To add your user to the `docker` group, run the following command:
220
+ - `newgroup docker`
221
+ - `sudo usermod -aG docker $USER`
222
+ - `sudo systemctl restart docker`
223
+
224
+ # Contributing
225
+
226
+ See contributing guide on https://pwr.github.io/pwrforge/contributing.html
227
+
228
+
229
+
@@ -0,0 +1,132 @@
1
+ # pwrforge
2
+ pwrforge project was written by PWR team and is continuation of Spyrosoft Solutions S.A. scargo project. Find more information at [tft.pwr.edu.pl](https://tft.pwr.edu.pl/).
3
+ <p align="center">
4
+ <img src="docs/source/_static/pwr_logo_color.png" alt="pwr" width="200"/>
5
+ </p>
6
+
7
+ # Overview
8
+ This is the documentation for pwrforge - a Python-based C/C++ package and software development life cycle manager inspired by RUST cargo idea.
9
+
10
+ pwrforge can:
11
+
12
+ - Create a new project (binary or library) for embedded systems and x86
13
+ - Build the project
14
+ - Run static code analyzers
15
+ - Fix chosen problem automatically based on the checker analysis
16
+ - Run unit tests
17
+ - Generate documentation from the source code
18
+ - Work with the predefined docker environment depending on the chosen architecture
19
+ - Generate mocks and test skeletetons
20
+
21
+ # Installation
22
+ ## Installing pwrforge on Ubuntu 24.04+ (PEP 668-compliant systems)
23
+
24
+ Ubuntu 24.04 and newer follow PEP 668, which restricts the use of pip in the system Python environment to prevent accidental damage to system-managed packages.
25
+
26
+ To safely install pwrforge, use a virtual environment:
27
+
28
+ ```
29
+ python3.12 -m venv .venv
30
+ source .venv/bin/activate
31
+ pip install --upgrade pip
32
+ pip install pwrforge
33
+ ```
34
+
35
+ This ensures isolated and conflict-free usage of pwrforge without requiring elevated privileges or --break-system-packages.
36
+
37
+ ## Install on ubuntu <=22.04, windows or macos
38
+ pwrforge is available on [pypi](https://pypi.org/project/pwrforge/), so you can install it with pip:
39
+
40
+ ```pip install pwrforge```
41
+
42
+ If system does not find 'pwrforge' command after installing, add the installation directory to your env paths. On Ubuntu you can find installation directory by running:
43
+
44
+ ```$ pip show "pwrforge"```
45
+
46
+ Then add to PATH e.g.:
47
+
48
+ ```$ export PATH=~/.local/bin:${PATH}```
49
+
50
+ # Working with pwrforge
51
+ ![pwrforge flow animation](docs/source/_static/pwrforge_flow_docker.svg)
52
+
53
+ # Project dependencies
54
+ ## Working with docker (recommended)
55
+ - docker with docker-compose - https://docs.docker.com/engine/install/ubuntu/
56
+ - pip
57
+ - python3 - `sudo apt install python3.12-venv python3.12-distutils -y`
58
+
59
+ # Work environment
60
+ You can always change work environment between docker or native after project is created.
61
+ Just edit the pwrforge.toml file ([project] -> build-env = "docker" or build-env = "native").
62
+ For it may be needed dependencies manually which are included in `.devcontainer/Dockerfile`
63
+
64
+ Its recommended to work in virtual environment (venv) or conda environment e.g.:
65
+ - pip install virtualenv
66
+ - virtualenv -p /usr/bin/python3.12 venv
67
+ - source venv/bin/activate
68
+
69
+
70
+ ## Working in docker
71
+ 1) If you create a new project, run `docker compose run pwrforge-dev` to run project development image depending on chosen architecture. All dependencies should be already there.
72
+ Run pwrforge commands as you would do natively.
73
+
74
+ 2) If you create a project with --docker flag (`pwrforge new <my_proj> --docker ...`) or with any docker flag, by default each pwrforge command will be triggered in docker.
75
+
76
+ ## Working natively
77
+ 1) Create a project with --no-docker flag (`pwrforge new <my_proj> --no-docker ...`).
78
+
79
+ ## Create the requirements for docker env
80
+ From version 2.3.2 the pwrforge is install in docker but overload by docker compose volume data, to get present version from your native env.
81
+ During deployment the requirements file is created using following command
82
+
83
+ - `pip-compile --all-extras --output-file=ci/requirements.txt pyproject.toml`
84
+ - `pip-compile --output-file=pwrforge/file_generators/templates/docker/requirements.txt.j2 pyproject.toml`
85
+
86
+ to have all newest dependencies. This solutions allow as to have pwrforge install in docker for ci/cd and be able to use newest features without official releases.
87
+
88
+ ## Testing custom pwrforge generated project locally
89
+ You can make changes in pwrforge and install it locally using ```pip install .``` command when you are in the main project folder.
90
+ To test the custom pwrforge version and have this custom pwrforge available also inside the docker (crucial for testing), in created project update docker-compose.yaml:
91
+
92
+ volumes:
93
+
94
+ - ..:/workspace
95
+ - /dev:/dev
96
+ - ~/.local/lib/python3.12/site-packages/pwrforge:/usr/local/lib/python3.12/dist-packages/pwrforge
97
+
98
+ Where ```~/.local/lib/python3.12/site-packages/pwrforge``` is a path to pwrforge on your local machine. It the following path is not working, find installation dir using ```pip show pwrforge```.
99
+
100
+ To keep this setup between ```pwrforge update``` commands, in pwrforge.toml file update also ```update-exclude``` as in following example:
101
+
102
+ update-exclude = [".devcontainer/docker-compose.yaml"]
103
+
104
+ pip install --upgrade build
105
+ python -m build --wheel
106
+
107
+ # Known Issues
108
+
109
+ ## MacOs with ARM processors
110
+ - On macOS devices with ARM processors (such as M1 and M3), USB device passthrough to Docker containers is not supported. While most development tasks can be performed within the Docker container, actions that involve direct interaction with USB devices, such as flashing firmware or monitoring hardware, must be executed natively on the host system.
111
+
112
+ ## Windows
113
+
114
+ - On Windows devices, USB device passthrough is not supported in Docker containers when using Docker Desktop. To work around this limitation, you can use WSL2 (Windows Subsystem for Linux) or run a virtual machine with a Linux distribution like Ubuntu 22.04 to enable USB device access.
115
+
116
+ # Potential issues
117
+
118
+ pip install -e ".[dev]"
119
+
120
+ ## Docker permissions on Ubuntu
121
+
122
+ When using the `docker-compose` command, you may encounter permission errors due to insufficient permissions for accessing the Docker daemon socket. To resolve this issue, ensure that your user has the necessary permissions by adding your user to the `docker` group or granting appropriate access rights to the Docker daemon socket.
123
+ To add your user to the `docker` group, run the following command:
124
+ - `newgroup docker`
125
+ - `sudo usermod -aG docker $USER`
126
+ - `sudo systemctl restart docker`
127
+
128
+ # Contributing
129
+
130
+ See contributing guide on https://pwr.github.io/pwrforge/contributing.html
131
+
132
+
@@ -0,0 +1,10 @@
1
+ # pwrforge/__init__.py
2
+ from importlib.metadata import PackageNotFoundError
3
+ from importlib.metadata import version as pkg_version
4
+
5
+ try:
6
+ _installed_version = pkg_version("pwrforge")
7
+ except PackageNotFoundError:
8
+ _installed_version = "0.0.0"
9
+
10
+ __version__ = _installed_version or "0.0.0"