CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-tox-pyenv

tox plugin that makes tox use `pyenv which` to find python executables

Overall
score

98%

Overview
Eval results
Files

task.mdevals/scenario-9/

Python Version Manager Integration

Create a Python version manager integration utility that discovers Python executables based on local and global version configuration.

Capabilities

Basic Version Discovery

  • When given "python3.8" as the version name, it returns the full path to the python3.8 executable @test
  • When the version manager command fails, it raises a RuntimeError with the error details @test

Local Version Priority

  • When a local version is configured for the current directory, it returns the path to that version's executable @test
  • When multiple local versions are specified, it returns the path to the first available version @test

Global Version Fallback

  • When no local version is set, it returns the path to the globally-configured default Python executable @test
  • When explicitly queried for the global version, it returns the global default regardless of local configuration @test

Implementation

@generates

API

def find_version_executable(version_name: str) -> str:
    """
    Find the full path to a Python executable for a specific version.

    Args:
        version_name: The Python version identifier (e.g., "python3.8")

    Returns:
        The absolute path to the Python executable

    Raises:
        RuntimeError: If the version manager command fails
    """
    pass

def get_local_version_executable() -> str:
    """
    Get the Python executable path for the locally-configured version.

    Respects local version configuration in the current directory.

    Returns:
        The absolute path to the locally-configured Python executable

    Raises:
        RuntimeError: If version manager command fails
    """
    pass

def get_global_version_executable() -> str:
    """
    Get the Python executable path for the globally-configured version.

    Returns:
        The absolute path to the global default Python executable

    Raises:
        RuntimeError: If version manager command fails
    """
    pass

Dependencies { .dependencies }

subprocess { .dependency }

Provides subprocess management for executing external commands and capturing output.

@satisfied-by

os { .dependency }

Provides operating system interfaces for path manipulation and environment variables.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-tox-pyenv

tile.json