Skip to content

Add local QA helpers and python 3.13/trixie support#20

Closed
dannystaple wants to merge 11 commits into
pimoroni:mainfrom
dannystaple:ci-fixes
Closed

Add local QA helpers and python 3.13/trixie support#20
dannystaple wants to merge 11 commits into
pimoroni:mainfrom
dannystaple:ci-fixes

Conversation

@dannystaple

@dannystaple dannystaple commented May 30, 2026

Copy link
Copy Markdown
Contributor
  • Add a docker testing images - for python 3.9, 3.10, 3.11 and 3.13 in trixie.
  • Fix test mocking issue in tox.ini. Tests and functionality unchanged.
  • Add a LOCAL_QA.md guide, showing how to run these checks within the docker env.
  • Minor fix to checks - exporting the TERM settings.

This is a port of pimoroni/inventorhatmini-python#16 to the boilerplate.

A couple of whys

  • Why dockerfile? Because on a desktop, I don't have GitHub's setup python, and this would be a reasonable way to get to the matrix of versions. Plus it's got the other bits it needs (presuming I haven't missed some, we'll find out).
  • Why uv - managing a python setup with lockfiles means fewer package update surprises. It does need to be relocked sometimes though.
  • Why a lockfile - so we get fewer moments of "ahhh... this is no longer compatible with todays build of smbus", at least until we relock because we meant it.
  • Why a local qa doc - so people can run this stuff at desk without having to discover it all again.

Mostly Developer Experience (devx) to make fixing the ci failures a bit easier.

Testing

  • Make check, make shellcheck, make qa and make pytest were ran locally on this - all pythons seem to work.
  • CI Workflows for the rest of the matrix are mostly passing. 3.9 has issues - which looks like hatch support has dropped off for it.

Copilot AI review requested due to automatic review settings May 30, 2026 17:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a Docker-based local QA environment with a pinned dependency lockfile, documentation for running checks in the container, and tweaks the existing tox and check.sh setup to better support isolated testing.

Changes:

  • New Dockerfile.testing + requirements-dev.lock providing a reproducible dev/test image driven by uv.
  • New LOCAL_QA.md documenting how to build and run QA targets inside the container.
  • tox.ini switched to skip_install + manual pip install --no-deps to avoid pulling hardware-specific deps; check.sh exports TERM.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Dockerfile.testing New image: uv + Python 3.11, system tools, non-root appuser, installs from lockfile.
requirements-dev.lock New uv-generated lockfile pinning all dev deps for Python 3.11.
LOCAL_QA.md New docs describing build/run commands and lockfile regeneration.
tox.ini Skips install and instead does pip install --no-deps in commands_pre; also skip_install for qa.
check.sh Exports TERM so subprocesses inherit the value.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Dockerfile.testing
Comment thread Dockerfile.testing Outdated
Comment thread Dockerfile.testing Outdated
Comment thread tox.ini Outdated
Comment thread LOCAL_QA.md Outdated
@dannystaple dannystaple marked this pull request as draft May 31, 2026 11:11
@dannystaple dannystaple marked this pull request as ready for review May 31, 2026 11:13
@dannystaple dannystaple changed the title Add local QA helpers Add local QA helpers and python 3.13/trixie support May 31, 2026
@Gadgetoid

Copy link
Copy Markdown
Member

Whew, thank you, might take me a while to get to this since I'm buried in Pico stuff at the moment. I also really ought to play with uv more.

@Gadgetoid

Copy link
Copy Markdown
Member

I ended up somewhat roflstomping this in #21 since I had a whole bunch of bugbears with the current packaging setup that I haven't been happy with for a while.

I'm not sure about Docker... mostly because I hate it for reasons I can't really elucidate. It's not so much that I wouldn't want to include it (I'll take pragmatism over taste where I can), as that I wont be able to maintain it because I'd have no idea what I'm doing.

@dannystaple

Copy link
Copy Markdown
Contributor Author

Roflstomping is a new phrase on me! :) Perhaps for pragmatism - after taking alook at the changes in #21 , I can split this into parts, so you can take what you'd like from it.
Uv and pre-commit are good choices in #21 IMHO.

My choice of docker was the isolated debian environments to try make things Pi-like in a host testing environment - my usual testing ground is Ubuntu (in wsl) so also Debian like. I'm not wedded to it.
Happy to close this in favour of #21 as I think it covers the places I ran aground that prompted this.

@dannystaple dannystaple closed this Jul 6, 2026
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.

3 participants