Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/ansible_compat/prerun.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import hashlib
import os
import platform
import sys
import tempfile
import warnings
Expand All @@ -15,11 +16,10 @@

# This module is early loaded by tools like ansible-lint and we want to fail
# fast even for `ansible-lint --version` if the setup is known as broken.
if sys.version_info >= (3, 14):
core_version = Version(version("ansible-core"))
if core_version < Version("2.20.0dev0"): # pragma: no cover
msg = f"Python 3.14 requires ansible-core version >= 2.20.0, and we found {core_version}."
raise RuntimeError(msg)
core_version = Version(version("ansible-core"))
if core_version >= Version("2.20.0dev0") and sys.version_info < (3, 14): # pragma: no cover
msg = f"ansible-core version >= 2.20.0 requires Python 3.14 and we found {platform.python_version()}."
raise RuntimeError(msg)


def is_writable(path: Path) -> bool:
Expand Down
Loading