Version Compatibility

Python version compatibility checking for eyelink-wrapper backends.

This module provides runtime checks to ensure that the Python version is compatible with the requested visualization backend before attempting to import it.

pyelink.version.check_python_version(backend_name)[source]

Check if current Python version is compatible with the requested backend.

Parameters:

backend_name (str) – Name of the backend (‘psychopy’, ‘pygame’, ‘pyglet’)

Returns:

(is_compatible: bool, message: str)
  • is_compatible: True if Python version is compatible

  • message: Status message or error description

Return type:

tuple[bool, str]

pyelink.version.warn_if_incompatible(backend_name)[source]

Warn user if Python version is incompatible with backend.

This function will issue a UserWarning if the Python version is not compatible with the requested backend, providing clear guidance on what to do.

Parameters:

backend_name (str) – Name of the backend to check

Returns:

True if compatible, False otherwise

Return type:

bool

Get list of backends compatible with current Python version.

Returns:

List of backend names that are compatible with the current

Python version

Return type:

list[str]

pyelink.version.get_incompatible_reason(backend_name)[source]

Get the reason why a backend is incompatible with current Python version.

Parameters:

backend_name (str) – Name of the backend

Returns:

Reason for incompatibility, or None if compatible

Return type:

str | None