Skip to content

Feat/python version ci#267

Closed
zindello wants to merge 5 commits into
pyMC-dev:devfrom
zindello:feat/python-version-ci
Closed

Feat/python version ci#267
zindello wants to merge 5 commits into
pyMC-dev:devfrom
zindello:feat/python-version-ci

Conversation

@zindello
Copy link
Copy Markdown

Automated Python Compatibility Testing

Introduces a GitHub Actions workflow that runs the full test suite against
Python 3.10, 3.11, 3.12 and 3.13 on every push and pull request across all
branches.

What this does

  • Catches Python version regressions before they reach devices in the field
  • Runs the complete existing test suite — no new test infrastructure required
  • All four versions run to completion regardless of individual failures (fail-fast: false)
  • Directly motivated by a datetime.UTC regression that broke all Python 3.10 devices (LuckFox Pico Ultra) after a recent update

To enforce this as a merge gate

Settings → Branches → Branch protection rules → require status checks →
add Python Compatibility

zindello added 5 commits May 27, 2026 09:58
datetime.UTC was added in Python 3.11. Fall back to timezone.utc on
older interpreters, matching the existing pattern in mqtt_handler.py.

Co-Authored-By: Zindello <josh@zindello.com.au>
datetime.UTC was introduced in Python 3.11. timezone.utc is available
since Python 3.2 and is functionally identical.

Co-Authored-By: Zindello <josh@zindello.com.au>
Replace the try/except UTC shim in mqtt_handler.py with timezone.utc
directly, consistent with the api_endpoints.py fix. Add a static AST
scan that fails if datetime.UTC is reintroduced anywhere in the codebase,
guarding against future regressions on Python 3.10 (LuckFox Pico Ultra).

Co-Authored-By: Zindello <josh@zindello.com.au>
Runs the test suite across all supported Python versions on every push
and pull request. fail-fast disabled so all versions are reported.

Co-Authored-By: Zindello <josh@zindello.com.au>
Also extend the compat scanner to catch datetime.UTC used as an
attribute (datetime.datetime.now(datetime.UTC)) in addition to
direct imports, so this form cannot be reintroduced undetected.

Co-Authored-By: Zindello <josh@zindello.com.au>
@rightup rightup closed this May 27, 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.

2 participants