pycompat.yml 988 B

123456789101112131415161718192021222324252627
  1. # Rejects Python syntax the device's 3.4 runtime cannot byte-compile.
  2. #
  3. # mod-ui ships inside a MOD OS image whose toolchain provides Python 3.4. A
  4. # newer construct (f-string, async/await, walrus, ...) does not fail loudly:
  5. # the image build's byte-compile step fails for that module and the device
  6. # ships without it. tools/check_py34.py catches that here instead.
  7. #
  8. # Deliberately does NOT need a Python 3.4 interpreter: the checker parses with
  9. # the host interpreter's ast module and rejects node types 3.4 does not have.
  10. # GitHub Actions no longer offers 3.4 (EOL 2019), so an interpreter-based gate
  11. # would not be runnable here.
  12. name: pycompat
  13. on: [push, pull_request]
  14. jobs:
  15. python34-syntax:
  16. runs-on: ubuntu-22.04
  17. name: python 3.4 syntax gate
  18. steps:
  19. - uses: actions/checkout@v3
  20. - uses: actions/setup-python@v5
  21. with:
  22. python-version: '3.11'
  23. - name: Reject post-3.4 syntax in shipped Python
  24. run: python3 tools/check_py34.py