Skip to content

ci: consolidate workflows, pin pylint, test Python 3.7–3.14 and all crypto backends - #741

Merged
jasonacox merged 1 commit into
masterfrom
ci-foundation
Oct 13, 2026
Merged

jasonacox merged 1 commit into
masterfrom
ci-foundation

Conversation

@jasonacox

Copy link
Copy Markdown
Owner

Why

Pylint started failing on master after #740:

tinytuya/core/crypto_helper.py:170:17: E0606: Possibly using variable 'pyaes' before assignment (possibly-used-before-assignment)

The Pylint workflow ran an unpinned pip install pylint across Python 3.8/3.9/3.10, so each job got a different pylint (3.2.7 on 3.8, 4.1.3 on 3.10). pylint 4.x reports the conditional pyaes import as E0606 instead of E0601, and the existing suppression only covered E0601. It's a false positive: _AESCipher_pyaes is only selected when the import succeeded.

While auditing CI I also found that CodeQL was on the deprecated codeql-action@v1 (it logs an "no longer updated or supported" error but still shows green), the test matrix stopped at 3.12, and only the cryptography AES backend was ever tested.

Changes

  • Lint fix: extend the suppression in crypto_helper.py to possibly-used-before-assignment.
  • New ci.yml replaces test.yml, contrib.yml, pylint.yml:
    • Pylint: once on Python 3.12, pylint pinned in new requirements-dev.txt (4.1.3).
    • Test: Python 3.7–3.14 (adds 3.13/3.14; 3.7 stays on ubuntu-22.04). Each job runs compileall (catches too-new syntax in modules the tests don't import), tests.py, the test.py usage path, and testcontrib.py. Invocations changed from python -m test.py to python test.py.
    • Crypto backend: tests.py once per backend (cryptography, pycryptodome, pycryptodomex, pyaes) with only that backend installed, asserting crypto_helper actually selected it.
    • Build package: python -m build, twine check --strict, install wheel and import.
    • Push runs limited to master (PRs still run), concurrency cancels superseded runs, permissions: contents: read, fail-fast: false.
  • CodeQL: v1 → v4, build-mode: none (no autobuild for Python), explicit security-events: write.
  • Dependabot: monthly updates for GitHub Actions and the pylint pin.
  • Docs: AGENTS.md (support range 3.7–3.14, CI job descriptions, pin policy); README and Contrib README badges now point at ci.yml.

Testing

  • pylint -E passes on pylint 3.2.3 and 4.1.3.
  • python -m tests passes locally on 3.8, 3.10, 3.12, 3.13, and on 3.12 with each of the four backends (pyaes skips the GCM tests as expected).
  • python -m build + twine check --strict pass.
  • 3.7 and 3.14 could not be tested locally; this PR's CI run is their verification.

Note: the old workflow names/badges (Build Test, Contrib Test, Pylint) stop updating once merged. Master has no branch protection referencing them.

No library behavior changes, so no RELEASE.md entry.

🤖 Generated with Claude Code

…rypto backends

- Fix Pylint failure: newer pylint reports the conditional pyaes import as
  possibly-used-before-assignment (E0606); extend the existing suppression.
- Replace test.yml, contrib.yml and pylint.yml with a single ci.yml:
  lint once on Python 3.12 with pylint pinned in requirements-dev.txt,
  test on 3.7-3.14 (adds 3.13/3.14, compileall per version), run tests.py
  once per AES backend with only that backend installed, and build/twine
  check the package.
- Upgrade CodeQL from the deprecated v1 action to v4 (build-mode none).
- Add Dependabot for GitHub Actions and the pylint pin.
- Update AGENTS.md and README badges to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copilot AI 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.

🟢 Approval recommended

The consolidated workflows are internally consistent and all newly introduced CI jobs pass.

0 open findings

What changed in this PR

Consolidates and modernizes CI while expanding Python and crypto-backend coverage.

Changes:

  • Unifies linting, testing, crypto, and packaging checks in ci.yml.
  • Updates CodeQL and adds Dependabot maintenance.
  • Pins Pylint, resolves its false positive, and updates CI documentation/badges.
File Description
.github/​workflows/​ci.yml Adds consolidated CI coverage.
.github/​workflows/​test.yml Removes superseded test workflow.
.github/​workflows/​contrib.yml Removes superseded contrib workflow.
.github/​workflows/​pylint.yml Removes superseded lint workflow.
.github/​workflows/​codeql-analysis.yml Modernizes CodeQL configuration.
.github/​dependabot.yml Adds monthly dependency updates.
requirements-dev.txt Pins Pylint for consistent linting.
tinytuya/​core/​crypto_helper.py Suppresses the new false-positive diagnostic.
README.md Updates the CI badge.
tinytuya/​Contrib/​README.md Updates the CI badge.
AGENTS.md Documents the expanded CI process.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jasonacox
jasonacox merged commit 3c0a687 into master Oct 13, 2026
17 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.

3 participants