# Running ansible-lint via pre-commit requires python3.14

**URL:** <https://forum.ansible.com/t/running-ansible-lint-via-pre-commit-requires-python3-14/45493>\
**Category:** Get Help\
**Tags:** ansible-lint\
**Created:** [March 6, 2026, 10:02am UTC](https://forum.ansible.com/t/running-ansible-lint-via-pre-commit-requires-python3-14/45493 "2026-03-06T10:02:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [March 6, 2026, 10:02am UTC](https://forum.ansible.com/t/running-ansible-lint-via-pre-commit-requires-python3-14/45493/1 "2026-03-06T10:02:26Z")

</div>

The Ansible roles I write, on machines running Debian Trixie, which has Python 3.13.5, generally have `.pre-commit-config.yaml` files like this:

```yaml
---
repos:
  # https://github.com/adrienverge/yamllint/tags
  - repo: https://github.com/adrienverge/yamllint.git
    rev: v1.38.0
    hooks:
      - id: yamllint
        name: YAML Lint
  # https://github.com/aristanetworks/j2lint/releases
  - repo: https://github.com/aristanetworks/j2lint.git
    rev: v1.2.0
    hooks:
      - id: j2lint
        name: Jinja2-Linter
        args:
          - templates
  # https://github.com/jackdewinter/pymarkdown/releases
  - repo: https://github.com/jackdewinter/pymarkdown.git
    rev: v0.9.34
    hooks:
      - id: pymarkdown
        name: Markdown Lint
  # https://github.com/ansible/ansible-lint/releases
  - repo: https://github.com/ansible/ansible-lint.git
    rev: v26.1.1
    hooks:
      - id: ansible-lint
        name: Ansible Lint
        language: python
        additional_dependencies:
          # https://pypi.org/project/ansible/
          - ansible==13.4.0
          # https://github.com/kellyjonbrazil/jc/releases
          - jc==1.25.6
          # https://github.com/jmespath/jmespath.py/tags
          - jmespath==1.0.1
...

```

In the past I was able to increment the `ansible-lint` version string when there were [new releases](https://github.com/ansible/ansible-lint/releases) (incidentally new `ansible-lint` releases don’t result in posts in the [News & Announcements \> Ecosystem Releases category on this forum](https://forum.ansible.com/c/news/releases/18)).

However I am currently stuck on `ansible-lint` 26.1.1 as most [recent versions require Python 3.14](https://github.com/ansible/ansible-lint/issues/4946), is [this intentional](https://github.com/ansible/ansible-lint/pull/4959), is this the result of a policy or is this an accident? Would it be possible to enable the running `ansible-lint` via `pre-commit` to work with multiple versions of Python?

I’m posting this here as the [GitHub issue](https://github.com/ansible/ansible-lint/issues/4978) I opened about this hasn’t had a response.

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [March 6, 2026, 4:08pm UTC](https://forum.ansible.com/t/running-ansible-lint-via-pre-commit-requires-python3-14/45493/2 "2026-03-06T16:08:39Z")

</div>

This can be [solved](https://github.com/ansible/ansible-lint/issues/4978#issuecomment-4011915897) by adding `language_version: python3`:

```yaml
---
repos:
  - repo: https://github.com/ansible/ansible-lint.git
    rev: v26.3.0
    hooks:
      - id: ansible-lint
        name: Ansible Lint
        language: python
        language_version: python3
        additional_dependencies:
          # https://pypi.org/project/ansible/
          - ansible==13.4.0
          # https://github.com/kellyjonbrazil/jc/releases
          - jc==1.25.6
          # https://github.com/jmespath/jmespath.py/tags
          - jmespath==1.0.1
...
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [April 5, 2026, 4:08pm UTC](https://forum.ansible.com/t/running-ansible-lint-via-pre-commit-requires-python3-14/45493/3 "2026-04-05T16:08:56Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
