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-2/

VCS Package Installer

A Python utility for installing packages from version control repositories.

Overview

Build a utility that enables installation of Python packages from Git, Mercurial, Subversion, and Bazaar repositories. The tool should parse VCS URLs, build appropriate installation commands, and execute installations with support for branches, tags, commits, and subdirectories.

Capabilities

Parse VCS URLs

  • Parsing "git+https://github.com/user/repo.git" returns a dict with vcs_type='git', url='https://github.com/user/repo.git', revision=None, subdirectory=None @test
  • Parsing "git+https://github.com/user/repo.git@v1.0.0" returns a dict with vcs_type='git', url='https://github.com/user/repo.git', revision='v1.0.0', subdirectory=None @test
  • Parsing "git+https://github.com/user/repo.git#subdirectory=pkg" returns a dict with vcs_type='git', url='https://github.com/user/repo.git', revision=None, subdirectory='pkg' @test
  • Parsing "hg+https://example.com/repo" returns a dict with vcs_type='hg' @test

Build installation commands

Execute VCS installations

Implementation

@generates

API

def parse_vcs_url(url: str) -> dict:
    """
    Parse a VCS URL and extract its components.

    Args:
        url: A VCS URL (e.g., "git+https://github.com/user/repo.git@branch#subdirectory=pkg")

    Returns:
        A dictionary with keys:
        - 'vcs_type': The VCS type ('git', 'hg', 'svn', 'bzr')
        - 'url': The repository URL
        - 'revision': Optional branch/tag/commit (None if not specified)
        - 'subdirectory': Optional subdirectory path (None if not specified)
    """
    pass

def build_install_command(vcs_url: str, editable: bool = False) -> str:
    """
    Build a pip install command for a VCS URL.

    Args:
        vcs_url: A VCS URL to install from
        editable: Whether to create an editable installation

    Returns:
        A pip install command string that can be executed
    """
    pass

def install_from_vcs(vcs_url: str, editable: bool = False) -> bool:
    """
    Install a package from a VCS repository.

    Args:
        vcs_url: A VCS URL to install from
        editable: Whether to create an editable installation

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

Dependencies { .dependencies }

pip { .dependency }

The Python package installer, used to install packages from VCS repositories.

Install with Tessl CLI

npx tessl i tessl/pypi-pip

tile.json