Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Docs→main: consolidate CI, adopt version-switcher v0.18.0, modernise to py3#289

Merged
coretl merged 13 commits into
docsfrom
pyproject-uv-ci
Jul 3, 2026
Merged

Docs→main: consolidate CI, adopt version-switcher v0.18.0, modernise to py3#289
coretl merged 13 commits into
docsfrom
pyproject-uv-ci

Conversation

@coretl

@coretl coretl commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Brings the MyST docs onto main and modernises the CI in one piece of work — the FPGA
equivalent of server #93 + #94. This branch is docs + the changes below, so merging it
performs the docs→main migration.

What changed

  • Docs → main / version-switcher v0.18.0 — consume the shared 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 (no fork guard here).
    The docs build-command apt-installs matplotlib+numpy for the timing_plot/block_fields
    directives (mirrors the repo Dockerfile).
  • docs/myst.yml — plugin → v0.18.0; favicon pinned to the PandA logo.
  • uv / pyproject + CI consolidationpyproject.toml + uv.lock; lint with ruff via
    _lint.yml; single ci.yml orchestrating the local code/test reusables, replacing
    code.yml / tests.yml. .gitlab-ci.yml (Vivado synthesis) is untouched.
  • Python harness modernised to py3 — the dev env is py3-only now, so dropped
    common/python/compat.py: import configparser / typing.TYPE_CHECKING directly, use
    str instead of str_, a metaclass= class instead of @add_metaclass, and removed
    the dead from __future__ import print_function imports. (This also fixes a bug in the
    in-progress consolidation where compat.py's py3 branch had become pass, which broke
    the configparser import.)

Migration notes

  • migrate.sh prepare has been run: main is seeded (pages-default-seed) and releases
    are backfilled, so this PR's publish can reconstruct the site. Merging builds main's
    own docs and persists _sources/main.zip; migrate.sh --delete-gh-pages finalises.
  • Pre-existing test note: tests.python has some failures (VHDL-output diffs +
    validate_app_name rejecting the _ in calc_extension) that are present on origin/docs
    too — not introduced here. Flagging in case they surface in _test_python_autogen.

🤖 Generated with Claude Code

…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
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
@coretl coretl changed the base branch from main to docs June 30, 2026 11:35
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
@coretl coretl requested a review from EmilioPeJu June 30, 2026 13:41
@EmilioPeJu

EmilioPeJu commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

FPGA build is failing because of the design templates:

cp "$TOP_DIR/docs/tutorials/"*.json "$FPGA_DIR/template_designs"

Should we remove the templates from the package? I don't see them in the docs branch

EDIT: they were moved to docs/_legacy_rst/tutorials, in any case, the question remains, should we move them and include them in the package(using the right path)?

@coretl

coretl commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

EDIT: they were moved to docs/_legacy_rst/tutorials, in any case, the question remains, should we move them and include them in the package(using the right path)?

The template designs actually belong with web-control, could you put them in meta-panda please?

@EmilioPeJu

Copy link
Copy Markdown
Contributor

In that case, we need to delete the cp line I mentioned earlier

@EmilioPeJu

Copy link
Copy Markdown
Contributor

Template designs added to meta-panda in commit PandABlocks/meta-panda@ebbc040

@EmilioPeJu EmilioPeJu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

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]>
@coretl coretl temporarily deployed to github-pages July 3, 2026 16:19 — with GitHub Actions Inactive
@coretl coretl merged commit 1b881d5 into docs Jul 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants