Feat/python version ci#267
Closed
zindello wants to merge 5 commits into
Closed
Conversation
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>
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.
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
fail-fast: false)datetime.UTCregression that broke all Python 3.10 devices (LuckFox Pico Ultra) after a recent updateTo enforce this as a merge gate
Settings → Branches → Branch protection rules → require status checks →
add Python Compatibility