CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-pip

The PyPA recommended tool for installing Python packages.

91

1.07x
Overview
Eval results
Files

task.mdevals/scenario-3/

Package Installer Script

Create a Python script that installs Python packages to custom locations based on user preferences.

Overview

Build a command-line utility that wraps package installation functionality to support different installation strategies. The script should allow users to install packages either to a specific target directory or to the user's local site-packages directory.

Capabilities

Custom Directory Installation

Install packages to a user-specified target directory.

  • Installing "requests" to "./custom_libs" directory creates the package in that location @test
  • Installing "click" to "/tmp/mylibs" directory creates the package in that location @test

User-Local Installation

Install packages to the user's local site-packages directory without requiring administrative privileges.

  • Installing "pytest" to user directory completes successfully @test
  • Installing "flask" to user directory does not require sudo/admin rights @test

API

def install_to_directory(package_name: str, target_dir: str) -> bool:
    """
    Install a package to a specific target directory.

    Args:
        package_name: The name of the package to install
        target_dir: The absolute or relative path to the target directory

    Returns:
        True if installation succeeded, False otherwise
    """
    pass

def install_to_user(package_name: str) -> bool:
    """
    Install a package to the user's local site-packages directory.

    Args:
        package_name: The name of the package to install

    Returns:
        True if installation succeeded, False otherwise
    """
    pass

Implementation

@generates

Dependencies { .dependencies }

pip { .dependency }

Provides Python package installation functionality.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-pip

tile.json