Repository navigation
Build fprime_py for the Python deployment only, install Python files on every build, and add a CMake hook and component cookiecutter - #17
Merged
LeStarch merged 7 commits intoNov 10, 2026
Conversation
…etup friction - Install Python files on every build: the install ran after fprime_py linked, so an edit to a .py file alone was never installed. - Build fprime_py only for a deployment whose topology is annotated: a C++ deployment registered first claimed the module and the Python deployment was skipped, leaving an fprime_py that failed to import. A second Python deployment is now skipped with a warning. - Add cmake/FprimePython.cmake, one include replacing the pybind11 and target registration block each project copied. - Add the component cookiecutter, previously in a personal repository. - README: module is fprime_py, document custom bindings, running, and CMake setup. Co-authored-by: M Starch <LeStarch@googlemail.com>
Co-authored-by: M Starch <LeStarch@googlemail.com>
… build target - The executable of a Python deployment links modules that call into Python, so it failed to link unless each project added pybind11::embed itself. - Add tests of target/fprime_python.cmake against a stand-in project: deployment order, C++-only builds, a second Python deployment, Python reinstall without relinking, and template copy-back. Co-authored-by: M Starch <LeStarch@googlemail.com>
Covers target registration, the missing-pybind11 error, and the sub-build early return. Co-authored-by: M Starch <LeStarch@googlemail.com>
Co-authored-by: M Starch <LeStarch@googlemail.com>
fprime-util build from the deployment directory builds the deployment target, which did not depend on fprime_py or its install, leaving build-artifacts/python stale. Co-authored-by: M Starch <LeStarch@googlemail.com>
Co-authored-by: M Starch <LeStarch@googlemail.com>
This was referenced Nov 10, 2026
LeStarch
approved these changes
Nov 10, 2026
lestarch-autobot
added a commit
to lestarch-autobot/fprime-python-reference
that referenced
this pull request
Nov 10, 2026
fprime-community/fprime-python#17 was squash-merged; the tree is identical to the commit pinned before. Co-authored-by: M Starch <LeStarch@googlemail.com>
LeStarch
added a commit
to fprime-community/fprime-python-reference
that referenced
this pull request
Nov 10, 2026
* Drop the FPP JSON model, adopt the FprimePython CMake hook, and document running - Remove FPRIME_ENABLE_JSON_MODEL_GENERATION and fprime-python-model: fprime-python reads FPP directly. - Replace the pybind11 and target registration block with include(FprimePython); the build now links the deployment to pybind11::embed. - README: start the GDS and the Python flight software separately; the deployment README no longer describes a C++ binary. - Update lib/fprime-python. Co-authored-by: M Starch <LeStarch@googlemail.com> * Bump fprime-python to the tested hook Co-authored-by: M Starch <LeStarch@googlemail.com> * Bump fprime-python: install on deployment builds Co-authored-by: M Starch <LeStarch@googlemail.com> * Bump fprime-python to merged main (0a8a0c3) fprime-community/fprime-python#17 was squash-merged; the tree is identical to the commit pinned before. Co-authored-by: M Starch <LeStarch@googlemail.com> --------- Co-authored-by: M Starch <LeStarch@googlemail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
Fixes to the tool found while reviewing the how-to Develop Components in Python (nasa/fprime#4958).
fprime_pywas built for whichever deployment CMake registered first. A C++-only deployment registered first claimed it, the Python deployment was skipped, andimport fprime_pyfailed withundefined symbol: setup_user_deployment.fprime_pyis now built only for a deployment whose topology is@ fprime-python; other deployments are left alone in any order. A second Python deployment is skipped with a warning instead of silently.fprime_py, so editing only a.pyfile never reinstalled it. It is now its own target, run by every build of the project or of the deployment.pybind11::embed. The Python deployment's executable is linked against it by the tool, so projects no longer add that themselves.cmake/FprimePython.cmake.include(FprimePython)replaces the pybind11 / position-independent-code /register_fprime_targetblock each project copied.cookiecutters/component. A component template in this repository:fprime-util new --from-source <fprime-python>/cookiecutters/component.fprime_python.corrected tofprime_py.; the two TODO sections (custom bindings, deployments) written.Rationale
Each item is a point where a reader following the how-to on a new project was blocked or misled.
Testing/Review Recommendations
python -m mypy: clean.python -m pytest tests: 28 passed. Newtests/test_cmake.pydrives the real target functions and the hook from a stand-in CMake project;tests/test_generator.pyrenders the cookiecutter through the autocoder for each component kind.HELLOreturns its event.Future Work
fprime_pyandbuild-artifacts/python.pybind11::embed.AI Usage
Generative AI was used in this contribution: AI. Code, tests, and documentation were written by Devin (AI agent) at the direction of @LeStarch, and reviewed locally before submission.
IAMAI