neuralspotx 0.6.4__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 (214) hide show
  1. neuralspotx-0.6.4/LICENSE +29 -0
  2. neuralspotx-0.6.4/PKG-INFO +117 -0
  3. neuralspotx-0.6.4/README.md +90 -0
  4. neuralspotx-0.6.4/pyproject.toml +103 -0
  5. neuralspotx-0.6.4/setup.cfg +4 -0
  6. neuralspotx-0.6.4/src/neuralspotx/__init__.py +171 -0
  7. neuralspotx-0.6.4/src/neuralspotx/_errors.py +126 -0
  8. neuralspotx-0.6.4/src/neuralspotx/_io.py +131 -0
  9. neuralspotx-0.6.4/src/neuralspotx/_logging.py +124 -0
  10. neuralspotx-0.6.4/src/neuralspotx/_parallel.py +88 -0
  11. neuralspotx-0.6.4/src/neuralspotx/_resolve_cache.py +224 -0
  12. neuralspotx-0.6.4/src/neuralspotx/api/__init__.py +106 -0
  13. neuralspotx-0.6.4/src/neuralspotx/api/_app.py +289 -0
  14. neuralspotx-0.6.4/src/neuralspotx/api/_cache.py +32 -0
  15. neuralspotx-0.6.4/src/neuralspotx/api/_lock.py +150 -0
  16. neuralspotx-0.6.4/src/neuralspotx/api/_modules.py +284 -0
  17. neuralspotx-0.6.4/src/neuralspotx/api/_registry.py +39 -0
  18. neuralspotx-0.6.4/src/neuralspotx/api/_requests.py +222 -0
  19. neuralspotx-0.6.4/src/neuralspotx/api/_sbom.py +37 -0
  20. neuralspotx-0.6.4/src/neuralspotx/board_descriptors.py +322 -0
  21. neuralspotx-0.6.4/src/neuralspotx/boards/apollo2_evb/README.md +6 -0
  22. neuralspotx-0.6.4/src/neuralspotx/boards/apollo2_evb/board.cmake +79 -0
  23. neuralspotx-0.6.4/src/neuralspotx/boards/apollo2_evb/board.yaml +19 -0
  24. neuralspotx-0.6.4/src/neuralspotx/boards/apollo2_evb/nsx-module.yaml +36 -0
  25. neuralspotx-0.6.4/src/neuralspotx/boards/apollo330mP_evb/README.md +3 -0
  26. neuralspotx-0.6.4/src/neuralspotx/boards/apollo330mP_evb/board.cmake +79 -0
  27. neuralspotx-0.6.4/src/neuralspotx/boards/apollo330mP_evb/board.yaml +21 -0
  28. neuralspotx-0.6.4/src/neuralspotx/boards/apollo330mP_evb/nsx-module.yaml +39 -0
  29. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3_evb/README.md +1 -0
  30. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3_evb/board.cmake +73 -0
  31. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3_evb/board.yaml +19 -0
  32. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3_evb/nsx-module.yaml +36 -0
  33. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3_evb_cygnus/README.md +1 -0
  34. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3_evb_cygnus/board.cmake +73 -0
  35. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3_evb_cygnus/board.yaml +19 -0
  36. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3_evb_cygnus/nsx-module.yaml +36 -0
  37. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3p_evb/README.md +6 -0
  38. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3p_evb/board.cmake +79 -0
  39. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3p_evb/board.yaml +19 -0
  40. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3p_evb/nsx-module.yaml +36 -0
  41. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3p_evb_cygnus/README.md +1 -0
  42. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3p_evb_cygnus/board.cmake +79 -0
  43. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3p_evb_cygnus/board.yaml +19 -0
  44. neuralspotx-0.6.4/src/neuralspotx/boards/apollo3p_evb_cygnus/nsx-module.yaml +36 -0
  45. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4b_blue_evb/board.cmake +77 -0
  46. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4b_blue_evb/board.yaml +19 -0
  47. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4b_blue_evb/nsx-module.yaml +36 -0
  48. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4l_blue_evb/README.md +1 -0
  49. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4l_blue_evb/board.cmake +77 -0
  50. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4l_blue_evb/board.yaml +19 -0
  51. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4l_blue_evb/nsx-module.yaml +36 -0
  52. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4l_evb/README.md +1 -0
  53. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4l_evb/board.cmake +77 -0
  54. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4l_evb/board.yaml +19 -0
  55. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4l_evb/nsx-module.yaml +36 -0
  56. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4p_blue_kbr_evb/README.md +1 -0
  57. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4p_blue_kbr_evb/board.cmake +77 -0
  58. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4p_blue_kbr_evb/board.yaml +19 -0
  59. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4p_blue_kbr_evb/nsx-module.yaml +36 -0
  60. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4p_blue_kxr_evb/README.md +1 -0
  61. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4p_blue_kxr_evb/board.cmake +77 -0
  62. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4p_blue_kxr_evb/board.yaml +19 -0
  63. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4p_blue_kxr_evb/nsx-module.yaml +36 -0
  64. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4p_evb/README.md +6 -0
  65. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4p_evb/board.cmake +78 -0
  66. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4p_evb/board.yaml +19 -0
  67. neuralspotx-0.6.4/src/neuralspotx/boards/apollo4p_evb/nsx-module.yaml +36 -0
  68. neuralspotx-0.6.4/src/neuralspotx/boards/apollo510_evb/README.md +6 -0
  69. neuralspotx-0.6.4/src/neuralspotx/boards/apollo510_evb/board.cmake +80 -0
  70. neuralspotx-0.6.4/src/neuralspotx/boards/apollo510_evb/board.yaml +21 -0
  71. neuralspotx-0.6.4/src/neuralspotx/boards/apollo510_evb/nsx-module.yaml +39 -0
  72. neuralspotx-0.6.4/src/neuralspotx/boards/apollo510b_evb/README.md +3 -0
  73. neuralspotx-0.6.4/src/neuralspotx/boards/apollo510b_evb/board.cmake +81 -0
  74. neuralspotx-0.6.4/src/neuralspotx/boards/apollo510b_evb/board.yaml +21 -0
  75. neuralspotx-0.6.4/src/neuralspotx/boards/apollo510b_evb/nsx-module.yaml +39 -0
  76. neuralspotx-0.6.4/src/neuralspotx/boards/apollo510dL_evb/README.md +8 -0
  77. neuralspotx-0.6.4/src/neuralspotx/boards/apollo510dL_evb/board.cmake +78 -0
  78. neuralspotx-0.6.4/src/neuralspotx/boards/apollo510dL_evb/board.yaml +25 -0
  79. neuralspotx-0.6.4/src/neuralspotx/boards/apollo510dL_evb/nsx-module.yaml +38 -0
  80. neuralspotx-0.6.4/src/neuralspotx/boards/apollo5b_evb/README.md +3 -0
  81. neuralspotx-0.6.4/src/neuralspotx/boards/apollo5b_evb/board.cmake +81 -0
  82. neuralspotx-0.6.4/src/neuralspotx/boards/apollo5b_evb/board.yaml +21 -0
  83. neuralspotx-0.6.4/src/neuralspotx/boards/apollo5b_evb/nsx-module.yaml +39 -0
  84. neuralspotx-0.6.4/src/neuralspotx/boards/atomiq110_fpga_turbo/README.md +4 -0
  85. neuralspotx-0.6.4/src/neuralspotx/boards/atomiq110_fpga_turbo/board.cmake +79 -0
  86. neuralspotx-0.6.4/src/neuralspotx/boards/atomiq110_fpga_turbo/board.yaml +21 -0
  87. neuralspotx-0.6.4/src/neuralspotx/boards/atomiq110_fpga_turbo/nsx-module.yaml +38 -0
  88. neuralspotx-0.6.4/src/neuralspotx/cli/__init__.py +1181 -0
  89. neuralspotx-0.6.4/src/neuralspotx/cli/_cmd_board.py +133 -0
  90. neuralspotx-0.6.4/src/neuralspotx/cli/_cmd_cache.py +46 -0
  91. neuralspotx-0.6.4/src/neuralspotx/cli/_cmd_module.py +260 -0
  92. neuralspotx-0.6.4/src/neuralspotx/cli/_hints.py +51 -0
  93. neuralspotx-0.6.4/src/neuralspotx/cli/_render.py +342 -0
  94. neuralspotx-0.6.4/src/neuralspotx/cmake/README.md +14 -0
  95. neuralspotx-0.6.4/src/neuralspotx/cmake/nsx-module.yaml +37 -0
  96. neuralspotx-0.6.4/src/neuralspotx/cmake/nsx_app_bootstrap.cmake +184 -0
  97. neuralspotx-0.6.4/src/neuralspotx/cmake/nsx_board_table.cmake +47 -0
  98. neuralspotx-0.6.4/src/neuralspotx/cmake/nsx_helpers.cmake +97 -0
  99. neuralspotx-0.6.4/src/neuralspotx/cmake/nsx_sdk_providers.cmake +193 -0
  100. neuralspotx-0.6.4/src/neuralspotx/cmake/nsx_toolchain_flags.cmake +154 -0
  101. neuralspotx-0.6.4/src/neuralspotx/cmake/packages/nsx_package_config.cmake.in +12 -0
  102. neuralspotx-0.6.4/src/neuralspotx/cmake/segger/socs/apollo2.cmake +11 -0
  103. neuralspotx-0.6.4/src/neuralspotx/cmake/segger/socs/apollo330.cmake +10 -0
  104. neuralspotx-0.6.4/src/neuralspotx/cmake/segger/socs/apollo3p.cmake +9 -0
  105. neuralspotx-0.6.4/src/neuralspotx/cmake/segger/socs/apollo4p.cmake +9 -0
  106. neuralspotx-0.6.4/src/neuralspotx/cmake/segger/socs/apollo5.cmake +12 -0
  107. neuralspotx-0.6.4/src/neuralspotx/cmake/segger/templates/flash_cmds.jlink.in +6 -0
  108. neuralspotx-0.6.4/src/neuralspotx/cmake/segger/templates/reset_cmds.jlink.in +4 -0
  109. neuralspotx-0.6.4/src/neuralspotx/cmake/toolchains/arm-none-eabi-gcc.cmake +27 -0
  110. neuralspotx-0.6.4/src/neuralspotx/cmake/toolchains/armclang.cmake +48 -0
  111. neuralspotx-0.6.4/src/neuralspotx/cmake/toolchains/atfe.cmake +56 -0
  112. neuralspotx-0.6.4/src/neuralspotx/constants.py +204 -0
  113. neuralspotx-0.6.4/src/neuralspotx/data/__init__.py +1 -0
  114. neuralspotx-0.6.4/src/neuralspotx/data/registry.lock.yaml +459 -0
  115. neuralspotx-0.6.4/src/neuralspotx/file_lock.py +211 -0
  116. neuralspotx-0.6.4/src/neuralspotx/metadata.py +296 -0
  117. neuralspotx-0.6.4/src/neuralspotx/models/__init__.py +55 -0
  118. neuralspotx-0.6.4/src/neuralspotx/models/_cache.py +60 -0
  119. neuralspotx-0.6.4/src/neuralspotx/models/_changes.py +49 -0
  120. neuralspotx-0.6.4/src/neuralspotx/models/_command.py +104 -0
  121. neuralspotx-0.6.4/src/neuralspotx/models/_discovery.py +127 -0
  122. neuralspotx-0.6.4/src/neuralspotx/models/_loader.py +307 -0
  123. neuralspotx-0.6.4/src/neuralspotx/models/_outdated.py +82 -0
  124. neuralspotx-0.6.4/src/neuralspotx/models/_project.py +292 -0
  125. neuralspotx-0.6.4/src/neuralspotx/module_cache.py +367 -0
  126. neuralspotx-0.6.4/src/neuralspotx/module_discovery.py +365 -0
  127. neuralspotx-0.6.4/src/neuralspotx/module_registry/__init__.py +79 -0
  128. neuralspotx-0.6.4/src/neuralspotx/module_registry/_closure.py +146 -0
  129. neuralspotx-0.6.4/src/neuralspotx/module_registry/_discovery.py +89 -0
  130. neuralspotx-0.6.4/src/neuralspotx/module_registry/_metadata.py +218 -0
  131. neuralspotx-0.6.4/src/neuralspotx/module_registry/_nsx_cfg.py +67 -0
  132. neuralspotx-0.6.4/src/neuralspotx/module_registry/_policy.py +53 -0
  133. neuralspotx-0.6.4/src/neuralspotx/module_registry/_profile.py +96 -0
  134. neuralspotx-0.6.4/src/neuralspotx/module_registry/_rmtree.py +41 -0
  135. neuralspotx-0.6.4/src/neuralspotx/module_registry/_table.py +20 -0
  136. neuralspotx-0.6.4/src/neuralspotx/module_registry/_vendoring.py +280 -0
  137. neuralspotx-0.6.4/src/neuralspotx/nsx_lock/__init__.py +187 -0
  138. neuralspotx-0.6.4/src/neuralspotx/nsx_lock/_constants.py +31 -0
  139. neuralspotx-0.6.4/src/neuralspotx/nsx_lock/_hashing.py +243 -0
  140. neuralspotx-0.6.4/src/neuralspotx/nsx_lock/_io.py +75 -0
  141. neuralspotx-0.6.4/src/neuralspotx/nsx_lock/_kinds.py +28 -0
  142. neuralspotx-0.6.4/src/neuralspotx/nsx_lock/_models.py +125 -0
  143. neuralspotx-0.6.4/src/neuralspotx/nsx_lock/_resolution.py +120 -0
  144. neuralspotx-0.6.4/src/neuralspotx/operations/__init__.py +105 -0
  145. neuralspotx-0.6.4/src/neuralspotx/operations/_app_lifecycle.py +271 -0
  146. neuralspotx-0.6.4/src/neuralspotx/operations/_build.py +317 -0
  147. neuralspotx-0.6.4/src/neuralspotx/operations/_cache.py +72 -0
  148. neuralspotx-0.6.4/src/neuralspotx/operations/_common.py +160 -0
  149. neuralspotx-0.6.4/src/neuralspotx/operations/_doctor.py +249 -0
  150. neuralspotx-0.6.4/src/neuralspotx/operations/_lock.py +824 -0
  151. neuralspotx-0.6.4/src/neuralspotx/operations/_modules.py +448 -0
  152. neuralspotx-0.6.4/src/neuralspotx/operations/_sbom.py +296 -0
  153. neuralspotx-0.6.4/src/neuralspotx/operations/_sync.py +405 -0
  154. neuralspotx-0.6.4/src/neuralspotx/project_config.py +859 -0
  155. neuralspotx-0.6.4/src/neuralspotx/py.typed +0 -0
  156. neuralspotx-0.6.4/src/neuralspotx/subprocess_utils/__init__.py +137 -0
  157. neuralspotx-0.6.4/src/neuralspotx/subprocess_utils/_git.py +293 -0
  158. neuralspotx-0.6.4/src/neuralspotx/subprocess_utils/_runner.py +220 -0
  159. neuralspotx-0.6.4/src/neuralspotx/subprocess_utils/_verbosity.py +78 -0
  160. neuralspotx-0.6.4/src/neuralspotx/subprocess_utils/_winjob.py +177 -0
  161. neuralspotx-0.6.4/src/neuralspotx/templates/__init__.py +1 -0
  162. neuralspotx-0.6.4/src/neuralspotx/templates/external_app/CMakeLists.txt.j2 +28 -0
  163. neuralspotx-0.6.4/src/neuralspotx/templates/external_app/README.md.j2 +42 -0
  164. neuralspotx-0.6.4/src/neuralspotx/templates/external_app/cmake/presets/CMakePresets.json +37 -0
  165. neuralspotx-0.6.4/src/neuralspotx/templates/external_app/src/main.c.j2 +33 -0
  166. neuralspotx-0.6.4/src/neuralspotx/templating.py +55 -0
  167. neuralspotx-0.6.4/src/neuralspotx/tooling.py +163 -0
  168. neuralspotx-0.6.4/src/neuralspotx.egg-info/PKG-INFO +117 -0
  169. neuralspotx-0.6.4/src/neuralspotx.egg-info/SOURCES.txt +212 -0
  170. neuralspotx-0.6.4/src/neuralspotx.egg-info/dependency_links.txt +1 -0
  171. neuralspotx-0.6.4/src/neuralspotx.egg-info/entry_points.txt +2 -0
  172. neuralspotx-0.6.4/src/neuralspotx.egg-info/requires.txt +2 -0
  173. neuralspotx-0.6.4/src/neuralspotx.egg-info/top_level.txt +1 -0
  174. neuralspotx-0.6.4/tests/test_api_dispatch.py +406 -0
  175. neuralspotx-0.6.4/tests/test_api_e2e.py +839 -0
  176. neuralspotx-0.6.4/tests/test_artifact_hash_cache_schema.py +108 -0
  177. neuralspotx-0.6.4/tests/test_board_descriptors.py +82 -0
  178. neuralspotx-0.6.4/tests/test_board_inheritance.py +174 -0
  179. neuralspotx-0.6.4/tests/test_board_normalization.py +107 -0
  180. neuralspotx-0.6.4/tests/test_board_table_drift.py +58 -0
  181. neuralspotx-0.6.4/tests/test_clean_reset.py +95 -0
  182. neuralspotx-0.6.4/tests/test_cli_board.py +131 -0
  183. neuralspotx-0.6.4/tests/test_cli_json.py +92 -0
  184. neuralspotx-0.6.4/tests/test_cli_ux_polish.py +221 -0
  185. neuralspotx-0.6.4/tests/test_cmake_glue_gitignore.py +69 -0
  186. neuralspotx-0.6.4/tests/test_custom_board_provider_cmake.py +132 -0
  187. neuralspotx-0.6.4/tests/test_discovery.py +377 -0
  188. neuralspotx-0.6.4/tests/test_emitter.py +87 -0
  189. neuralspotx-0.6.4/tests/test_example_builds.py +92 -0
  190. neuralspotx-0.6.4/tests/test_file_lock_thread_safety.py +86 -0
  191. neuralspotx-0.6.4/tests/test_frozen_integrity.py +67 -0
  192. neuralspotx-0.6.4/tests/test_git_transport_hardening.py +186 -0
  193. neuralspotx-0.6.4/tests/test_hypothesis_properties.py +451 -0
  194. neuralspotx-0.6.4/tests/test_later_fixes.py +150 -0
  195. neuralspotx-0.6.4/tests/test_lock_robustness.py +222 -0
  196. neuralspotx-0.6.4/tests/test_models.py +174 -0
  197. neuralspotx-0.6.4/tests/test_module_cache.py +630 -0
  198. neuralspotx-0.6.4/tests/test_next_fixes.py +253 -0
  199. neuralspotx-0.6.4/tests/test_now_fixes.py +226 -0
  200. neuralspotx-0.6.4/tests/test_nsx_lock.py +1198 -0
  201. neuralspotx-0.6.4/tests/test_parallel.py +91 -0
  202. neuralspotx-0.6.4/tests/test_project_config_typed.py +333 -0
  203. neuralspotx-0.6.4/tests/test_project_config_version.py +32 -0
  204. neuralspotx-0.6.4/tests/test_public_api_surface.py +533 -0
  205. neuralspotx-0.6.4/tests/test_public_surface_doc.py +62 -0
  206. neuralspotx-0.6.4/tests/test_registry_layers.py +243 -0
  207. neuralspotx-0.6.4/tests/test_resolve_cache.py +248 -0
  208. neuralspotx-0.6.4/tests/test_rmtree_compat.py +151 -0
  209. neuralspotx-0.6.4/tests/test_sbom.py +202 -0
  210. neuralspotx-0.6.4/tests/test_starter_profile_derivation.py +132 -0
  211. neuralspotx-0.6.4/tests/test_streaming.py +89 -0
  212. neuralspotx-0.6.4/tests/test_subprocess_tree.py +102 -0
  213. neuralspotx-0.6.4/tests/test_tooling_probes.py +61 -0
  214. neuralspotx-0.6.4/tests/test_typed_exceptions.py +423 -0
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, Ambiq
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,117 @@
1
+ Metadata-Version: 2.4
2
+ Name: neuralspotx
3
+ Version: 0.6.4
4
+ Summary: Python tooling and app bootstrap for neuralspotx
5
+ Author-email: Ambiq <support@ambiq.com>
6
+ License: BSD-3-Clause
7
+ Project-URL: Homepage, https://github.com/AmbiqAI/neuralspotx
8
+ Project-URL: Repository, https://github.com/AmbiqAI/neuralspotx
9
+ Project-URL: Issues, https://github.com/AmbiqAI/neuralspotx/issues
10
+ Project-URL: Changelog, https://github.com/AmbiqAI/neuralspotx/blob/main/CHANGELOG.md
11
+ Keywords: embedded,firmware,ambiq,neuralspot,build-system
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: License :: OSI Approved :: BSD License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Software Development :: Build Tools
19
+ Classifier: Topic :: Software Development :: Embedded Systems
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: Jinja2>=3.1
25
+ Requires-Dist: PyYAML>=6.0
26
+ Dynamic: license-file
27
+
28
+ # neuralspotx
29
+
30
+ [![CI](https://github.com/AmbiqAI/neuralspotx/actions/workflows/ci.yml/badge.svg)](https://github.com/AmbiqAI/neuralspotx/actions/workflows/ci.yml)
31
+ [![Pages](https://github.com/AmbiqAI/neuralspotx/actions/workflows/deploy-pages.yml/badge.svg)](https://github.com/AmbiqAI/neuralspotx/actions/workflows/deploy-pages.yml)
32
+ [![Release](https://github.com/AmbiqAI/neuralspotx/actions/workflows/release.yml/badge.svg)](https://github.com/AmbiqAI/neuralspotx/actions/workflows/release.yml)
33
+
34
+ `neuralspotx` is the NSX tooling repo.
35
+
36
+ NSX is a lightweight bare-metal workflow for Ambiq targets. It provides:
37
+
38
+ - the `nsx` CLI
39
+ - packaged app templates
40
+ - packaged CMake helpers
41
+ - built-in board definitions
42
+ - curated metadata for module and SDK selection
43
+
44
+ The primary audience is app developers creating small, focused NSX applications
45
+ for bring-up, profiling, validation, and simple demos.
46
+
47
+ For contributor workflows such as releases, CI, and the Python API surface, use
48
+ the docs site under `docs/`.
49
+
50
+ ## Documentation
51
+
52
+ The main documentation lives in the docs site built from `docs/`.
53
+
54
+ Install the docs toolchain:
55
+
56
+ ```bash
57
+ cd <nsx-repo>
58
+ uv sync --group docs
59
+ ```
60
+
61
+ Run the docs site locally:
62
+
63
+ ```bash
64
+ cd <nsx-repo>
65
+ uv run --group docs zensical serve
66
+ ```
67
+
68
+ Build the static site:
69
+
70
+ ```bash
71
+ cd <nsx-repo>
72
+ uv run --group docs zensical build
73
+ ```
74
+
75
+ ## Quick Start
76
+
77
+ NSX uses an app-first flow. Each app is a self-contained project directory with
78
+ vendored modules, board definitions, and build helpers.
79
+
80
+ For app users, the cleanest install path is `pipx`:
81
+
82
+ ```bash
83
+ pipx install neuralspotx
84
+ nsx doctor
85
+ nsx create-app hello_ap510 --board apollo510_evb
86
+ ```
87
+
88
+ For contributors working from a source checkout:
89
+
90
+ ```bash
91
+ cd <nsx-repo>
92
+ uv sync
93
+ source .venv/bin/activate
94
+ nsx doctor
95
+ nsx create-app hello_ap510 --board apollo510_evb
96
+ ```
97
+
98
+ Build the app:
99
+
100
+ ```bash
101
+ nsx configure --app-dir hello_ap510
102
+ nsx build --app-dir hello_ap510
103
+ ```
104
+
105
+ ## Repo Scope
106
+
107
+ This repo owns:
108
+
109
+ - `src/neuralspotx`
110
+ - packaged documentation and templates
111
+ - packaged board definitions
112
+ - CMake helper assets used by generated apps
113
+
114
+ Built-in firmware modules are described by the packaged registry and fetched
115
+ from their default upstream repos as needed. Normal app users create standalone
116
+ app directories and let NSX manage module resolution, vendoring, configuration,
117
+ build, flash, and view flows.
@@ -0,0 +1,90 @@
1
+ # neuralspotx
2
+
3
+ [![CI](https://github.com/AmbiqAI/neuralspotx/actions/workflows/ci.yml/badge.svg)](https://github.com/AmbiqAI/neuralspotx/actions/workflows/ci.yml)
4
+ [![Pages](https://github.com/AmbiqAI/neuralspotx/actions/workflows/deploy-pages.yml/badge.svg)](https://github.com/AmbiqAI/neuralspotx/actions/workflows/deploy-pages.yml)
5
+ [![Release](https://github.com/AmbiqAI/neuralspotx/actions/workflows/release.yml/badge.svg)](https://github.com/AmbiqAI/neuralspotx/actions/workflows/release.yml)
6
+
7
+ `neuralspotx` is the NSX tooling repo.
8
+
9
+ NSX is a lightweight bare-metal workflow for Ambiq targets. It provides:
10
+
11
+ - the `nsx` CLI
12
+ - packaged app templates
13
+ - packaged CMake helpers
14
+ - built-in board definitions
15
+ - curated metadata for module and SDK selection
16
+
17
+ The primary audience is app developers creating small, focused NSX applications
18
+ for bring-up, profiling, validation, and simple demos.
19
+
20
+ For contributor workflows such as releases, CI, and the Python API surface, use
21
+ the docs site under `docs/`.
22
+
23
+ ## Documentation
24
+
25
+ The main documentation lives in the docs site built from `docs/`.
26
+
27
+ Install the docs toolchain:
28
+
29
+ ```bash
30
+ cd <nsx-repo>
31
+ uv sync --group docs
32
+ ```
33
+
34
+ Run the docs site locally:
35
+
36
+ ```bash
37
+ cd <nsx-repo>
38
+ uv run --group docs zensical serve
39
+ ```
40
+
41
+ Build the static site:
42
+
43
+ ```bash
44
+ cd <nsx-repo>
45
+ uv run --group docs zensical build
46
+ ```
47
+
48
+ ## Quick Start
49
+
50
+ NSX uses an app-first flow. Each app is a self-contained project directory with
51
+ vendored modules, board definitions, and build helpers.
52
+
53
+ For app users, the cleanest install path is `pipx`:
54
+
55
+ ```bash
56
+ pipx install neuralspotx
57
+ nsx doctor
58
+ nsx create-app hello_ap510 --board apollo510_evb
59
+ ```
60
+
61
+ For contributors working from a source checkout:
62
+
63
+ ```bash
64
+ cd <nsx-repo>
65
+ uv sync
66
+ source .venv/bin/activate
67
+ nsx doctor
68
+ nsx create-app hello_ap510 --board apollo510_evb
69
+ ```
70
+
71
+ Build the app:
72
+
73
+ ```bash
74
+ nsx configure --app-dir hello_ap510
75
+ nsx build --app-dir hello_ap510
76
+ ```
77
+
78
+ ## Repo Scope
79
+
80
+ This repo owns:
81
+
82
+ - `src/neuralspotx`
83
+ - packaged documentation and templates
84
+ - packaged board definitions
85
+ - CMake helper assets used by generated apps
86
+
87
+ Built-in firmware modules are described by the packaged registry and fetched
88
+ from their default upstream repos as needed. Normal app users create standalone
89
+ app directories and let NSX manage module resolution, vendoring, configuration,
90
+ build, flash, and view flows.
@@ -0,0 +1,103 @@
1
+ [project]
2
+ name = "neuralspotx"
3
+ version = "0.6.4"
4
+ description = "Python tooling and app bootstrap for neuralspotx"
5
+ requires-python = ">=3.10"
6
+ license = {text = "BSD-3-Clause"}
7
+ readme = "README.md"
8
+ authors = [
9
+ {name = "Ambiq", email = "support@ambiq.com"},
10
+ ]
11
+ keywords = ["embedded", "firmware", "ambiq", "neuralspot", "build-system"]
12
+ classifiers = [
13
+ "Development Status :: 4 - Beta",
14
+ "License :: OSI Approved :: BSD License",
15
+ "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3.10",
17
+ "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Topic :: Software Development :: Build Tools",
20
+ "Topic :: Software Development :: Embedded Systems",
21
+ "Typing :: Typed",
22
+ ]
23
+ dependencies = [
24
+ "Jinja2>=3.1",
25
+ "PyYAML>=6.0",
26
+ ]
27
+
28
+ [project.scripts]
29
+ nsx = "neuralspotx.cli:main"
30
+
31
+ [project.urls]
32
+ Homepage = "https://github.com/AmbiqAI/neuralspotx"
33
+ Repository = "https://github.com/AmbiqAI/neuralspotx"
34
+ Issues = "https://github.com/AmbiqAI/neuralspotx/issues"
35
+ Changelog = "https://github.com/AmbiqAI/neuralspotx/blob/main/CHANGELOG.md"
36
+
37
+ [dependency-groups]
38
+ docs = [
39
+ "mkdocs-material>=9.0",
40
+ "pymdown-extensions>=10.15",
41
+ "zensical>=0.0.11",
42
+ ]
43
+ lint = [
44
+ "ruff>=0.11.0",
45
+ ]
46
+ test = [
47
+ "hypothesis>=6.0",
48
+ "pytest>=8.0",
49
+ "pytest-timeout>=2.3",
50
+ ]
51
+ examples = [
52
+ # Host-side tools for example apps (e.g. usb_rpc rpc_host.py).
53
+ # grpcio-tools bundles protoc + a matching protobuf, eliminating
54
+ # version-mismatch errors between system protoc and the Python package.
55
+ # Run: uv sync --group examples
56
+ "pyserial>=3.5",
57
+ "grpcio-tools>=1.70",
58
+ ]
59
+
60
+ [build-system]
61
+ requires = ["setuptools>=61.0", "wheel"]
62
+ build-backend = "setuptools.build_meta"
63
+
64
+ [tool.setuptools]
65
+ package-dir = {"" = "src"}
66
+ include-package-data = true
67
+
68
+ [tool.setuptools.packages.find]
69
+ where = ["src"]
70
+ include = ["neuralspotx", "neuralspotx.*"]
71
+
72
+ [tool.setuptools.package-data]
73
+ neuralspotx = ["py.typed", "templates/external_app/**/*", "cmake/**/*", "boards/**/*"]
74
+ "neuralspotx.data" = ["*.yaml"]
75
+
76
+ [tool.pytest.ini_options]
77
+ testpaths = ["tests"]
78
+
79
+ [tool.ruff]
80
+ line-length = 100
81
+ target-version = "py310"
82
+ preview = true
83
+
84
+ [tool.ruff.lint]
85
+ # Enable preview to pick up PLW1514 ("unspecified-encoding"), which
86
+ # flags `open(...)`, `Path.read_text(...)`, `Path.write_text(...)`,
87
+ # etc. without an explicit `encoding=` argument. This protects us
88
+ # from a recurrence of the R17/Windows mojibake bug, where the
89
+ # default locale encoding (cp1252 on Windows) silently corrupted an
90
+ # em-dash in a generated CMake file.
91
+ extend-select = [
92
+ "PLW1514", # unspecified-encoding
93
+ ]
94
+ select = [
95
+ "E4",
96
+ "E7",
97
+ "E9",
98
+ "F",
99
+ "I",
100
+ ]
101
+
102
+ [tool.ruff.lint.per-file-ignores]
103
+ "**/__init__.py" = ["F401"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,171 @@
1
+ """Canonical Python package for neuralspotx tooling.
2
+
3
+ The names exposed here form the **public Python API** of NSX. Anything
4
+ importable from a private ``_<name>`` module is, by convention,
5
+ internal and may change without notice.
6
+
7
+ See ``docs/reference/public-api.md`` for the canonical list with
8
+ stability tiers. ``tests/test_public_surface_doc.py`` keeps the doc
9
+ and ``__all__`` from drifting.
10
+ """
11
+
12
+ from ._errors import (
13
+ NSXCacheError,
14
+ NSXConfigError,
15
+ NSXError,
16
+ NSXGitError,
17
+ NSXIntegrityError,
18
+ NSXLockError,
19
+ NSXModuleError,
20
+ NSXResolutionError,
21
+ NSXTimeoutError,
22
+ NSXToolchainError,
23
+ )
24
+ from ._io import Emitter, Event, default_emitter
25
+ from .api import (
26
+ AppActionRequest,
27
+ AppBuildRequest,
28
+ AppCleanRequest,
29
+ AppCreateRequest,
30
+ AppFlashRequest,
31
+ AppLockRequest,
32
+ AppOutdatedRequest,
33
+ AppSyncRequest,
34
+ AppUpdateRequest,
35
+ AppViewRequest,
36
+ ModuleChangeRequest,
37
+ ModuleInitRequest,
38
+ ModuleRegisterRequest,
39
+ ModuleUpdateRequest,
40
+ add_module,
41
+ build_app,
42
+ cache_info,
43
+ clean_app,
44
+ clean_cache,
45
+ configure_app,
46
+ create_app,
47
+ describe_module,
48
+ doctor,
49
+ find_app_root,
50
+ flash_app,
51
+ generate_sbom,
52
+ init_module,
53
+ list_modules,
54
+ load_registry,
55
+ lock_app,
56
+ outdated_app,
57
+ register_module,
58
+ registry_module_project,
59
+ remove_module,
60
+ resolve_app_dir,
61
+ search_modules,
62
+ starter_profile,
63
+ sync_app,
64
+ update_app,
65
+ update_modules,
66
+ validate_module_metadata,
67
+ view_app,
68
+ )
69
+ from .models import (
70
+ CacheCleanResult,
71
+ CacheEntry,
72
+ CacheInfo,
73
+ CommandCategory,
74
+ CommandHint,
75
+ CommandScope,
76
+ DiscoveryRecord,
77
+ DoctorCheck,
78
+ DoctorReport,
79
+ ModuleChange,
80
+ OutdatedModule,
81
+ OutdatedReport,
82
+ OutdatedSkip,
83
+ SearchMatch,
84
+ SearchResult,
85
+ )
86
+ from .nsx_lock import LockKind, NsxLock, ResolvedModule
87
+ from .operations import OutdatedStatus, ProfileStatus
88
+
89
+ __all__ = [
90
+ # Request dataclasses
91
+ "AppActionRequest",
92
+ "AppBuildRequest",
93
+ "AppCleanRequest",
94
+ "AppCreateRequest",
95
+ "AppFlashRequest",
96
+ "AppLockRequest",
97
+ "AppOutdatedRequest",
98
+ "AppSyncRequest",
99
+ "AppUpdateRequest",
100
+ "AppViewRequest",
101
+ "ModuleChangeRequest",
102
+ "ModuleInitRequest",
103
+ "ModuleRegisterRequest",
104
+ "ModuleUpdateRequest",
105
+ # Result / data models
106
+ "CacheCleanResult",
107
+ "CacheEntry",
108
+ "CacheInfo",
109
+ "CommandCategory",
110
+ "CommandHint",
111
+ "CommandScope",
112
+ "DiscoveryRecord",
113
+ "DoctorCheck",
114
+ "DoctorReport",
115
+ "ModuleChange",
116
+ "OutdatedModule",
117
+ "OutdatedReport",
118
+ "OutdatedSkip",
119
+ "SearchMatch",
120
+ "SearchResult",
121
+ # Lock model + enums
122
+ "LockKind",
123
+ "NsxLock",
124
+ "OutdatedStatus",
125
+ "ProfileStatus",
126
+ "ResolvedModule",
127
+ # Errors
128
+ "NSXCacheError",
129
+ "NSXConfigError",
130
+ "NSXError",
131
+ "NSXGitError",
132
+ "NSXIntegrityError",
133
+ "NSXLockError",
134
+ "NSXModuleError",
135
+ "NSXResolutionError",
136
+ "NSXTimeoutError",
137
+ "NSXToolchainError",
138
+ # Structured emitter
139
+ "Emitter",
140
+ "Event",
141
+ "default_emitter",
142
+ # API callables
143
+ "add_module",
144
+ "build_app",
145
+ "cache_info",
146
+ "clean_app",
147
+ "clean_cache",
148
+ "configure_app",
149
+ "create_app",
150
+ "describe_module",
151
+ "doctor",
152
+ "find_app_root",
153
+ "flash_app",
154
+ "generate_sbom",
155
+ "init_module",
156
+ "list_modules",
157
+ "lock_app",
158
+ "load_registry",
159
+ "outdated_app",
160
+ "registry_module_project",
161
+ "register_module",
162
+ "remove_module",
163
+ "resolve_app_dir",
164
+ "search_modules",
165
+ "starter_profile",
166
+ "sync_app",
167
+ "update_app",
168
+ "update_modules",
169
+ "validate_module_metadata",
170
+ "view_app",
171
+ ]
@@ -0,0 +1,126 @@
1
+ """NSX exception hierarchy.
2
+
3
+ Lives in its own module (no NSX imports) so internal layers
4
+ (``operations``, ``module_registry``, ``project_config``,
5
+ ``subprocess_utils``, ``tooling``) can ``raise NSX*Error(...)`` directly
6
+ without pulling in :mod:`neuralspotx.api` and creating an import cycle.
7
+
8
+ The public surface is re-exported from :mod:`neuralspotx.api` and
9
+ :mod:`neuralspotx` so library consumers continue to write
10
+ ``from neuralspotx import NSXError`` exactly as before.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+
16
+ class NSXError(RuntimeError):
17
+ """Raised when an NSX workflow operation fails.
18
+
19
+ Library consumers catch typed errors via ``except NSXError:`` (or one
20
+ of the more specific subclasses below). The CLI wrapper translates
21
+ these into a non-zero process exit code at the top level; embedders
22
+ handle them as ordinary Python exceptions.
23
+ """
24
+
25
+
26
+ class NSXTimeoutError(NSXError):
27
+ """Raised when an NSX subprocess exceeded its ``timeout_s`` budget."""
28
+
29
+ def __init__(
30
+ self,
31
+ message: str,
32
+ *,
33
+ command: str | None = None,
34
+ timeout_s: float | None = None,
35
+ ) -> None:
36
+ super().__init__(message)
37
+ self.command = command
38
+ self.timeout_s = timeout_s
39
+
40
+
41
+ class NSXConfigError(NSXError):
42
+ """Raised for invalid or missing app / registry configuration.
43
+
44
+ The optional ``field`` attribute names the offending YAML key path
45
+ (dot-separated, with ``[i]`` for list indices, e.g.
46
+ ``"modules[2].name"``) so structured callers can map an error back
47
+ to a specific location in ``nsx.yml`` without re-parsing the
48
+ message.
49
+ """
50
+
51
+ def __init__(self, message: str, *, field: str | None = None) -> None:
52
+ super().__init__(message)
53
+ self.field = field
54
+
55
+
56
+ class NSXCacheError(NSXError):
57
+ """Raised when an on-disk NSX cache file is unreadable or has an
58
+ unsupported ``schema_version``.
59
+
60
+ Catch alongside :class:`NSXError` for general failure handling, or
61
+ specifically when offering remediation steps such as ``nsx cache
62
+ clean``.
63
+ """
64
+
65
+
66
+ class NSXResolutionError(NSXError):
67
+ """Raised for git-ref resolution or lock-file consistency failures."""
68
+
69
+
70
+ class NSXLockError(NSXError):
71
+ """Raised for failures in the per-app advisory-lock subsystem.
72
+
73
+ Covers both runtime acquisition failures (the platform lock
74
+ primitive errors out, the lock is held by another process in
75
+ non-blocking mode) and on-disk ``nsx.lock`` schema/format
76
+ incompatibilities surfaced by readers like ``sync`` and
77
+ ``outdated``.
78
+ """
79
+
80
+
81
+ class NSXModuleError(NSXError):
82
+ """Raised for module-name lookup or dependency-closure failures."""
83
+
84
+
85
+ class NSXIntegrityError(NSXModuleError):
86
+ """Raised when a vendored module's content hash does not match
87
+ the value recorded in ``nsx.lock``.
88
+
89
+ Surfaced primarily by ``nsx sync --frozen`` when the on-disk tree
90
+ has been mutated since the lock was written. Subclasses
91
+ :class:`NSXModuleError` so existing ``except NSXModuleError`` sites
92
+ continue to catch the failure.
93
+ """
94
+
95
+ def __init__(self, message: str, *, module: str | None = None) -> None:
96
+ super().__init__(message)
97
+ self.module = module
98
+
99
+
100
+ class NSXGitError(NSXError):
101
+ """Raised for unsafe or rejected ``git`` operations.
102
+
103
+ Used by ``git_clone_at_commit`` to refuse registry URLs that name
104
+ disallowed transports such as ``ext::`` (arbitrary command
105
+ execution) or ``file://`` / ``file::`` (local-filesystem
106
+ redirection), which would otherwise bypass the registry's
107
+ intended ``http(s)``/``ssh``/``git`` allow-list.
108
+ """
109
+
110
+
111
+ class NSXToolchainError(NSXError):
112
+ """Raised for missing or unsupported toolchain configuration."""
113
+
114
+
115
+ __all__ = [
116
+ "NSXCacheError",
117
+ "NSXConfigError",
118
+ "NSXError",
119
+ "NSXGitError",
120
+ "NSXIntegrityError",
121
+ "NSXLockError",
122
+ "NSXModuleError",
123
+ "NSXResolutionError",
124
+ "NSXTimeoutError",
125
+ "NSXToolchainError",
126
+ ]