Tool version is not compatible with the Python version in CI.

Open Beginner friendly
#153 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
77/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cmake, github-actions, python

Research direction

Start by reading the CI workflow that runs actions/setup-python and the .pre-commit-config.yaml entry for cheshirekow/cmake-format-precommit at v0.6.13. Reproduce the failure with pre-commit run --show-diff-on-failure --color=always --all-files and check whether pinning Python to 3.12 or updating the hook resolves it. Done means the cmake-format hook completes successfully in CI.

Written by the indexing model from the issue text.

Description

bug
Issue applies to:
  • pflow
  • OPFLOW
  • TCOPFLOW
  • SCOPFLOW
  • SOPFLOW
  • CMake and build system
  • Spack
  • Visualization
  • Documentation
  • Other
Summary

One issue arised with CI on PR #150 that could affect future PRs.

PR #150 failed in the pre-commit step, specifically the cmake-format hook.

In short, according to log analysis and Github CoPilot, the repo is fine, but the tool version is not compatible with the Python version in CI.

(Feel free to assign a fix to me and I will create a PR.)

Longer explanation:

The relevant evidence is in the workflow and config:

cmake-format............................................................. Failed

It’s a toolchain compatibility issue.

What failed:

The job runs pre-commit
The cmake-format hook is from cheshirekow/cmake-format-precommit
That hook pulls in cmakelang, which crashes under Python 3.15
The logs show the exact root cause:

ValueError: Cannot use capturing groups in re.Scanner
That error is coming from Python’s re.Scanner behavior in Python 3.15, and it is known to break older cmakelang/cmake-format releases.

Why it happened here: Workflow uses actions/setup-python without pinning a version
On GitHub runners, that resolves to Python 3.15
Then pre-commit creates an environment with that Python version
The old cmake-format dependency crashes during parsing

Description how to reproduce the issue

Run pre-commit run --show-diff-on-failure --color=always --all-files
[INFO] Initializing environment for https://github.com/cheshirekow/cmake-format-precommit.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-clang-format.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[WARNING] repo [https://github.com/pre-commit/pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks%60) uses deprecated stage names (commit, push) which will be removed in a future version. Hint: often pre-commit autoupdate --repo [https://github.com/pre-commit/pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks%60) will fix this. if it does not -- consider reporting an issue to that repo.
[INFO] Installing environment for https://github.com/cheshirekow/cmake-format-precommit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/mirrors-clang-format.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
cmake-format.............................................................Failed

  • hook id: cmake-format
  • exit code: 1

WARNING main.py:530: While processing src/CMakeLists.txt
Traceback (most recent call last):
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/bin/cmake-format", line 6, in
sys.exit(main())
~~~~^^
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 633, in main
return inner_main()
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 616, in inner_main
onefile_main(infile_path, args, argparse_dict)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 526, in onefile_main
outtext, reflow_valid = process_file(cfg, intext, args.dump)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 144, in process_file
tokens = lex.tokenize(infile_content)
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/lex/init.py", line 135, in tokenize
scanner = re.Scanner([
# double quoted string
...<48 lines>...
lambda s, t: (TokenType.UNQUOTED_LITERAL, t)),
], re.DOTALL)
File "/opt/hostedtoolcache/Python/3.15.0/x64/lib/python3.15/re/init.py", line 406, in init
raise ValueError("Cannot use capturing groups in re.Scanner")
ValueError: Cannot use capturing groups in re.Scanner
WARNING main.py:530: While processing buildsystem/clang-hip/cache.cmake
Traceback (most recent call last):
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/bin/cmake-format", line 6, in
sys.exit(main())
~~~~^^
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 633, in main
return inner_main()
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 616, in inner_main
onefile_main(infile_path, args, argparse_dict)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 526, in onefile_main
outtext, reflow_valid = process_file(cfg, intext, args.dump)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 144, in process_file
tokens = lex.tokenize(infile_content)
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/lex/init.py", line 135, in tokenize
scanner = re.Scanner([
# double quoted string
...<48 lines>...
lambda s, t: (TokenType.UNQUOTED_LITERAL, t)),
], re.DOTALL)
File "/opt/hostedtoolcache/Python/3.15.0/x64/lib/python3.15/re/init.py", line 406, in init
raise ValueError("Cannot use capturing groups in re.Scanner")
ValueError: Cannot use capturing groups in re.Scanner
WARNING main.py:530: While processing interfaces/python/CMakeLists.txt
Traceback (most recent call last):
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/bin/cmake-format", line 6, in
sys.exit(main())
~~~~^^
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 633, in main
return inner_main()
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 616, in inner_main
onefile_main(infile_path, args, argparse_dict)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 526, in onefile_main
outtext, reflow_valid = process_file(cfg, intext, args.dump)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 144, in process_file
tokens = lex.tokenize(infile_content)
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/lex/init.py", line 135, in tokenize
scanner = re.Scanner([
# double quoted string
...<48 lines>...
lambda s, t: (TokenType.UNQUOTED_LITERAL, t)),
], re.DOTALL)
File "/opt/hostedtoolcache/Python/3.15.0/x64/lib/python3.15/re/init.py", line 406, in init
raise ValueError("Cannot use capturing groups in re.Scanner")
ValueError: Cannot use capturing groups in re.Scanner
WARNING main.py:530: While processing tests/unit/opflow/objective/CMakeLists.txt
Traceback (most recent call last):
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/bin/cmake-format", line 6, in
sys.exit(main())
~~~~^^
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 633, in main
return inner_main()
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 616, in inner_main
onefile_main(infile_path, args, argparse_dict)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 526, in onefile_main
outtext, reflow_valid = process_file(cfg, intext, args.dump)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/format/main.py", line 144, in process_file
tokens = lex.tokenize(infile_content)
File "/home/runner/.cache/pre-commit/repog8fl9qvh/py_env-python3.15/lib/python3.15/site-packages/cmakelang/lex/init.py", line 135, in tokenize
scanner = re.Scanner([
# double quoted string
...<48 lines>...
lambda s, t: (TokenType.UNQUOTED_LITERAL, t)),
], re.DOTALL)
File "/opt/hostedtoolcache/Python/3.15.0/x64/lib/python3.15/re/init.py", line 406, in init
raise ValueError("Cannot use capturing groups in re.Scanner")
ValueError: Cannot use capturing groups in re.Scanner

ExaGO version

99ce24b2270d4683b0bffe421fe739e5be37d4f0

System and environment details

WSL

Additional information

No response

Possible fix or workaround

Proposed best fix: pin Python to 3.12 or 3.13 in the workflow, not 3.15

YAML:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

  - uses: actions/setup-python@v5
    with:
      python-version: '3.12'

  - uses: pre-commit/[email protected]

Also recommended is to upgrade the cmake-format hook to a newer revision if available or update the cmake-format-precommit repo to a maintained release
YAML:

Dominant language
Python
Stars
17
Forks
11
Avg merge
2d 11h
Merged PRs (30d)
2

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ORNL/ExaGO

All issues in ORNL/ExaGO

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.