docs(build): add canonical build instructions, pyproject.toml, and add more radio presets - #7222
Merged
Merged
Conversation
Member
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -22,3 +22,10 @@
"mkdocs-minify-plugin>=0.8",
"mike>=2.0",
]
+
+[build-system]
+requires = ["setuptools>=61.0"]
+build-backend = "setuptools.build_meta"
+
+[tool.setuptools]
+packages = []
|
Add BUILDING.md with canonical build instructions covering firmware, simulator, companion, and WASM plugin workflows using both CMake presets and manual superbuild invocations. Add pyproject.toml declaring all Python build dependencies for use with uv, and sync requirements.txt to match (adds asciitree, pyelftools). Expand CMakePresets.json with per-radio firmware presets for all major RadioMaster, Jumper, FrSky, and FlySky targets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pfeerick
force-pushed
the
building-md-py-deps
branch
from
September 2, 2026 07:12
74f9023 to
93799ae
Compare
…LDING.md into docs site - Add the 24 CMake presets that were missing relative to fw.json's officially tracked target list (f16, pa01, pl18ev, pl18u, st16, x10express, x7access, x9e, v12/v14/v14lcd/v16, commando8, c14, bumblebee, t12max, t15, t16, t18, t22, tpros, tprov2, gx15, tx15), bringing the preset list to full parity with fw.json (53 presets total, the 43 fw.json targets plus 5 pre-existing non-released ones). Presets are now ordered alphabetically by manufacturer then model, matching fw.json's own ordering. - Move BUILDING.md's content into docs/building/index.md (replacing the old stub Overview page) so it's part of the published docs site instead of only visible to repo browsers; delete the root BUILDING.md now that nothing references it. requirements.txt and pyproject.toml's main dependency list were already in sync, no change needed there.
pfeerick
marked this pull request as ready for review
September 2, 2026 08:36
… / docs-requirements.txt
pyproject.toml now gets a [build-system]/[tool.setuptools] section
(packages = []) so it's installable directly via `pip install .` or
`pip install ".[docs]"`, not just `uv sync` -- no requirement to use
uv. Every CI job and doc page that installed Python deps from the two
standalone requirements files now installs from pyproject.toml instead:
- .github/actions/python_dependencies/action.yml (used by
companion.yml): `pip install -r requirements.txt` -> `pip install .`
- .github/workflows/validate_hw_defs.yml: `uv pip install -r
requirements.txt` -> `uv pip install .`
- .github/workflows/docs.yml: `uv run --with-requirements
docs-requirements.txt` -> `uv run --extra docs --`, and its path
triggers now watch pyproject.toml instead of the deleted file
- docs/README.md, docs/building/macos-sequoia.md: same substitution
for the documented manual install commands
- Justfile: update a stale comment pointing at a requirements.txt
path that never existed
requirements.txt and docs-requirements.txt are deleted now that
nothing references them.
Left alone: docs/building/macos-sonoma.md, macos-catalina.md,
windows.md, and tools/setup_buildenv_ubuntu{22,24}.04.sh all install
Python packages *before* cloning the repo, so there's no pyproject.toml
on disk yet for them to point at -- switching those over would mean
reordering their instructions, not just swapping a command.
Also: add .venv/, *.egg-info/, and __pycache__/ to .gitignore (both
`uv sync` and `pip install .` create these in the repo root and
weren't previously ignored), and group *.pyc alongside them.
Swap actions/setup-python + `pip install .` for astral-sh/setup-uv + `uv sync`, matching the pattern already used by validate_hw_defs.yml and docs.yml. The venv's bin dir is prepended to GITHUB_PATH so the downstream WASM module build (which invokes python3 through CMake, not directly) keeps finding it exactly as it did with setup-python. Also fixes the action's `name:` field, which was a stale copy-paste leftover reading "Setup WASI SDK". validate_hw_defs.yml's install step becomes a plain `uv sync` instead of `uv venv && uv pip install .`, for consistency and so it'd pick up a uv.lock if one is ever added. This was the only Python-related CI step left on plain pip; validate_fw_json.yml runs stdlib-only scripts directly and build_fw.yml installs nothing (relies on the pre-baked edgetx-dev image), so nothing else needed touching to be fully uv-based.
…project.toml companion.yml's path filters didn't include the three composite actions its jobs actually use (python_dependencies, wasi_sdk, build_companion) or pyproject.toml, which python_dependencies now installs from. Found this because the previous commit's conversion of python_dependencies to uv wouldn't have triggered this workflow at all on this PR otherwise.
cmake/GenericDefinitions.cmake sets Python3_FIND_VIRTUALENV FIRST, which makes CMake's Python discovery key off the VIRTUAL_ENV environment variable specifically -- not just PATH. The previous commit only prepended .venv/bin to PATH, which was enough for uv run (used by validate_hw_defs.yml) but not for the WASM module build, which invokes python3 indirectly through CMake/make during hw_defs codegen. That failed with "ModuleNotFoundError: No module named 'jinja2'" in CI since CMake found some other python3 instead of the one uv sync had actually installed dependencies into.
Adds a small workflow that runs on any change to CMakePresets.json: - Schema validation via check-jsonschema (run through uvx, no persistent install) against the presets JSON schema bundled with whatever CMake version the runner has -- matching the exact CMake version enforcing these presets rather than an arbitrary remote copy. (An earlier attempt at using CMake's GitHub mirror URL for this turned out to resolve to an empty/non-functional schema, so the runner's own local copy is used instead.) - Formatting check via prettier, pinned to 3.9.6. A .prettierrc.json override bumps printWidth to 120 for this file specifically (the repo-wide default stays 80 for anything else prettier might touch later); at that width the file's existing style -- compact single-line cacheVariables entries, blank lines separating manufacturer groups -- already passes --check with zero changes. A generic JSON pretty-printer (python -m json.tool, pre-commit-hooks' pretty-format-json) was considered and rejected: both force every cacheVariables entry onto multiple lines and drop the blank-line grouping, since neither preserves short objects inline or blank lines the way prettier's JSON printer does. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The check-jsonschema schema path used an unquoted glob assigned to a variable in a single step, which bash does not expand on plain assignment (only when used unquoted as a command argument) -- the literal "cmake-*" string was being passed straight to check-jsonschema, which then failed with FileNotFoundError. Split the assignment so the glob expands where it's actually used. Also drops three blank lines between the default/firmware/native/ companion presets in CMakePresets.json -- copy/paste artifacts from before this PR's changes, inconsistent with companion/simu already having none between them. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.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.
Update docs overview(
docs/building/index.md) with canonical build instructions covering firmware, simulator, companion, and WASM plugin workflows using both CMake presets and manual superbuild invocations.Add pyproject.toml declaring all Python build dependencies for use with uv (
pip install .for backward compatibility, and pip install ".[docs]" for doc building requirements). Adds previously missing asciitree, pyelftools. Dependent CI tasks (i.e. Companion, WASI) will auto-fire on any changes to the file in the future.Expand CMakePresets.json with per-radio firmware presets for all currently supported targets
Add CI schema/format validation for the CMakePresets to protect against any mangling of the file.