tessl install tessl/pypi-tox-pyenv@1.1.0tox plugin that makes tox use `pyenv which` to find python executables
Agent Success
Agent success rate when using this tile
98%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.03x
Baseline
Agent success rate without this tile
95%
A tox plugin that implements a fallback mechanism for Python executable discovery, attempting to use a primary version manager before falling back to the system's default Python discovery.
@generates
import subprocess
from typing import Optional
def get_python_executable(basepython: str, primary_command: str) -> Optional[str]:
"""
Attempts to discover Python executable using a primary command, falling back to None.
Args:
basepython: The target Python version identifier (e.g., "python3.8", "python2.7")
primary_command: The command to use for primary discovery (e.g., "pyenv")
Returns:
The full path to the Python executable if found via primary command,
or None to signal that tox should use its default discovery mechanism.
The function executes: `<primary_command> which <basepython>`
"""
pass