CI: fix python version · Santandersecurityresearch/codeql@fe1e562 · GitHub
Skip to content

Commit fe1e562

Browse files
committed
CI: fix python version
Turns out this is important for the black formatting tool to work correctly. The formatting won't generally change between python versions (it only depends on `black`'s version), but the formatted code needs to be parseable by the system python version. One script uses ```python def foo[T](x: T) -> T: ``` syntax, which is only supported in Python 3.12 and later. Running `pre-commit` will now require a python 3.12 installation (which is already what we mandate for internal developer environment setup). The error in case of absence of such a version is pretty clear though.
1 parent 70647ce commit fe1e562

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎.github/workflows/python-tooling.yml‎

Lines changed: 3 additions & 0 deletions

‎.pre-commit-config.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
3+
default_language_version:
4+
python: python3.12
35
repos:
46
- repo: https://github.com/pre-commit/pre-commit-hooks
57
rev: v3.2.0

‎misc/scripts/models-as-data/bulk_generate_mad.py‎

Lines changed: 2 additions & 4 deletions

0 commit comments

Comments
 (0)