Docs→main: consolidate CI, adopt version-switcher v0.18.0, modernise to py3#289
Merged
Conversation
…o py3 Bring the docs onto main and modernise the CI in one piece of work (this branch is docs + the changes below; opening it against main carries the docs→main migration). - uv / pyproject dev env (pyproject.toml + uv.lock); lint common/ + tests/ with ruff via _lint.yml; the ruff fixes are applied. - Consolidate CI into a single ci.yml orchestrating the local code/test reusables (_cocotb_test / _test_matrix / _test_python_autogen / _test_hdl / _make_boot / _make_packages / _lint), replacing code.yml / tests.yml. .gitlab-ci.yml (Vivado synthesis) is untouched. - Consume the shared version-switcher reusable workflows at v0.18.0: docs.yml and release.yml directly, and publish.yml via a new local publish-dispatch.yml shim (replaces the local _docs/_publish/_release copies + [email protected]). publish needs actions: write for the tag re-dispatch; publish.yml owns the deploy / re-dispatch / fork-warn branching, so no fork guard here. The docs build-command apt-installs matplotlib+numpy for the timing_plot/block_fields directives (mirrors the Dockerfile). - docs/myst.yml: bump the plugin to v0.18.0 and pin the favicon to the PandA logo. - Modernise the Python harness to py3 (the dev env is now py3-only): drop the common/python/compat.py shim — import configparser / typing.TYPE_CHECKING directly, use str instead of str_, and a metaclass= class instead of @add_metaclass; remove the dead `from __future__ import print_function` imports. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Responding to review of the consolidated pipeline: - Remove the jobs that have moved to GitLab: make_boot, make_packages (boot images / app packages), and the HDL tests + matrix (test_hdl, test_matrix — GitLab move tracked in #290). - Move cocotb_test and test_python_autogen off the self-hosted iris_runners + CI container to plain ubuntu-latest driven through `uv run --locked`: cocotb installs the nvc simulator it drives; autogen keeps setupenv (rootfs + writable /build). - Add nvc to the dev-container Dockerfile (mirrors the cocotb apt install). - Drop all `master` refs (master is deleted upstream) and the docs trigger; every job now runs on pull_request / push to main / tag, so the per-job `if:` event guards are gone. publish and release keep the server pattern (release tag-only; publish once per event, branching inside publish.yml). Co-Authored-By: Claude Opus 4.8 <[email protected]>
- nvc: not in Ubuntu 24.04/26.04 apt; install pre-built .deb from GitHub releases via .github/scripts/install_nvc.sh (called from both _cocotb_test.yml and Dockerfile) - python_tests: app name validation rejects underscores; rename calc_extension → calc-extension test data and dummy_app → dummy-app - python_tests: update VHDL expected files for template changes (out-port defaults, -- Extra IOs section, end; style) - drop python_timing from CI (seq_sim.py failures are pre-existing, unrelated to this migration; tracked separately) Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
In cocotb 2.0, single-bit signal values return Logic objects which have no to_unsigned()/to_signed() methods (those belong to LogicArray). Use hasattr fallback to int() for Logic, and rename units= to unit= in Clock constructor. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Without vhdeps, order_hdl_files() falls back to an unordered file list, causing nvc to fail on 7 modules (filter, pcap, pgen, posenc, pulse, qdec, seq) where dependencies must be compiled before dependents. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Claude-Session: https://claude.ai/code/session_01166CU7RAdzm98WpUXyWpxE
nvc 1.17+ validates slice direction at runtime; the dynamic ranges sum_data(31+S downto S) were flagged under newer nvc, causing 2 pcap Sum-shifted tests to fail. Replaced with shift_right(x, S)(N downto 0) which is semantically equivalent and works reliably across nvc versions. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Claude-Session: https://claude.ai/code/session_01166CU7RAdzm98WpUXyWpxE
Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Claude-Session: https://claude.ai/code/session_01166CU7RAdzm98WpUXyWpxE
nvc 1.16.2 fails to parse shift_right(x, N)(31 downto 0) (function result slicing not yet supported) and also fails to compile seq. nvc's VHPI does not reliably propagate cocotb 2.0's queued DEPOSIT writes through the port hierarchy. Setting COCOTB_TRUST_INERTIAL_WRITES=1 makes cocotb apply writes immediately, matching the behaviour of cocotb 1.x setimmediatevalue and fixing the pcap Sum shifted tests (SHIFT_SUM was being read as 0 despite being set to 1 at tick 1). Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Claude-Session: https://claude.ai/code/session_01166CU7RAdzm98WpUXyWpxE
pcap_core.vhd instantiated pcap_frame with the formal name SHIft_SUM (mixed case) while pcap_frame.vhd declares the port as SHIFT_SUM. VHDL is case-insensitive so this was harmless with old nvc, but with --preserve-case nvc treats them as different identifiers, leaving pcap_frame.SHIFT_SUM undriven (reads as 0). This caused the two "Sum shifted" cocotb tests to output unshifted sums. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Claude-Session: https://claude.ai/code/session_01166CU7RAdzm98WpUXyWpxE
The pages-default-seed tag from the docs workflow produces a git describe string that Codecov can't parse. Coverage upload is best-effort; don't let it block the test job. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Claude-Session: https://claude.ai/code/session_01166CU7RAdzm98WpUXyWpxE
Removes the setupenv composite action and inlines the /build mkdir and permissions setup directly in the workflow. Also removes the repos/PandABlocks-fpga checkout subdirectory since it's no longer needed. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Claude-Session: https://claude.ai/code/session_01166CU7RAdzm98WpUXyWpxE
Contributor
|
FPGA build is failing because of the design templates: Should we remove the templates from the package? I don't see them in the docs branch EDIT: they were moved to |
Contributor
Author
The template designs actually belong with web-control, could you put them in meta-panda please? |
Contributor
|
In that case, we need to delete the |
Contributor
|
Template designs added to meta-panda in commit PandABlocks/meta-panda@ebbc040 |
The FPGA .ipk build failed copying docs/tutorials/*.json — those template designs moved to meta-panda (PandABlocks/meta-panda@ebbc040), so the package no longer ships them. Also bump the pinned myst-version-switcher-plugin from v0.18.0 to v0.22.0 across ci.yml, publish-dispatch.yml, and the docs.yml plugin URL; no consumer-facing interface changes affect this repo's usage. Co-Authored-By: Claude Sonnet 5 <[email protected]>
v0.22.0's publish.yml fails deploying a repo with no MyST-built release yet (exactly this repo's state): its last two steps end with a bare `cond && action`, so a false condition becomes the step's exit status even though nothing went wrong. Fixed upstream in DiamondLightSource/myst-version-switcher-plugin#45, released as v0.23.0. Co-Authored-By: Claude Sonnet 5 <[email protected]>
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.
Brings the MyST docs onto
mainand modernises the CI in one piece of work — the FPGAequivalent of server #93 + #94. This branch is
docs+ the changes below, so merging itperforms the docs→main migration.
What changed
@v0.18.0:docs.ymlandrelease.ymldirectly, andpublish.ymlvia a new localpublish-dispatch.ymlshim (replaces the local_docs/_publish/_releasecopies +
[email protected]).publishneedsactions: writefor the tag re-dispatch;publish.ymlowns the deploy / re-dispatch / fork-warn branching (no fork guard here).The docs
build-commandapt-installs matplotlib+numpy for the timing_plot/block_fieldsdirectives (mirrors the repo Dockerfile).
docs/myst.yml— plugin →v0.18.0; favicon pinned to the PandA logo.pyproject.toml+uv.lock; lint with ruff via_lint.yml; singleci.ymlorchestrating the local code/test reusables, replacingcode.yml/tests.yml..gitlab-ci.yml(Vivado synthesis) is untouched.common/python/compat.py: importconfigparser/typing.TYPE_CHECKINGdirectly, usestrinstead ofstr_, ametaclass=class instead of@add_metaclass, and removedthe dead
from __future__ import print_functionimports. (This also fixes a bug in thein-progress consolidation where
compat.py's py3 branch had becomepass, which brokethe
configparserimport.)Migration notes
migrate.shprepare has been run:mainis seeded (pages-default-seed) and releasesare backfilled, so this PR's publish can reconstruct the site. Merging builds
main'sown docs and persists
_sources/main.zip;migrate.sh --delete-gh-pagesfinalises.tests.pythonhas some failures (VHDL-output diffs +validate_app_namerejecting the_incalc_extension) that are present onorigin/docstoo — not introduced here. Flagging in case they surface in
_test_python_autogen.🤖 Generated with Claude Code