CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-pipenv

Python Development Workflow for Humans.

Pending
Overview
Eval results
Files

routines.mddocs/

Routines

High-level operations that implement core pipenv functionality. These functions provide the main business logic for install, lock, sync, and other operations. Routines are the implementation layer called by CLI commands and can be used programmatically.

Capabilities

Package Installation

Install packages from PyPI, VCS, or local paths and manage Pipfile updates.

def do_install(
    project,
    packages=False,
    editable_packages=False,
    index=False,
    dev=False,
    python=False,
    pypi_mirror=None,
    system=False,
    ignore_pipfile=False,
    requirementstxt=False,
    pre=False,
    deploy=False,
    site_packages=None,
    extra_pip_args=None,
    pipfile_categories=None,
    skip_lock=False,
):
    """
    Install packages and add them to Pipfile, or install all from Pipfile.
    
    Parameters:
    - project: Project instance
    - packages: List of package names to install
    - editable_packages: List of editable packages to install
    - dev: Install as development dependencies
    - pre: Allow pre-release packages
    - system: Use system pip instead of virtualenv
    - ignore_pipfile: Ignore Pipfile and install from command line only
    - skip_lock: Skip locking mechanism
    - deploy: Abort if lockfile is out-of-date
    """

Dependency Locking

Generate and manage Pipfile.lock with resolved dependencies.

def do_lock(
    project,
    system=False,
    clear=False,
    pre=False,
    write=True,
    quiet=False,
    pypi_mirror=None,
    categories=None,
    extra_pip_args=None,
):
    """
    Generate Pipfile.lock with resolved dependencies.
    
    Parameters:
    - project: Project instance
    - clear: Clear dependency resolver cache
    - pre: Allow pre-release packages
    - write: Write lockfile to disk
    - categories: Specific package categories to lock
    """

Package Synchronization

Install packages from Pipfile.lock to ensure deterministic builds.

def do_sync(
    project,
    dev=False,
    python=False,
    bare=False,
    dont_upgrade=False,
    user=False,
    clear=False,
    unused=False,
    system=False,
    deploy=False,
    pypi_mirror=None,
    site_packages=None,
    extra_pip_args=None,
    categories=None,
):
    """
    Install all packages specified in Pipfile.lock.
    
    Parameters:
    - project: Project instance
    - dev: Include development dependencies
    - bare: Minimal output
    - dont_upgrade: Don't upgrade packages
    - unused: Uninstall packages not in lockfile
    - deploy: Abort if lockfile is out-of-date
    """

Package Removal

Uninstall packages and remove from Pipfile.

def do_uninstall(
    project,
    packages=False,
    editable_packages=False,
    all_dev=False,
    all=False,
    python=False,
    system=False,
    lock=False,
    all_packages=False,
    keep_outdated=False,
    pypi_mirror=None,
    ctx=None,
    categories=None,
):
    """
    Uninstall packages and remove from Pipfile.
    
    Parameters:
    - project: Project instance
    - packages: List of package names to uninstall
    - all_dev: Uninstall all development packages
    - all: Uninstall all packages
    - lock: Update lockfile after uninstall
    """

def do_purge(project, bare=False, downloads=False, allow_global=False):
    """
    Remove the virtualenv and all cached dependencies.
    
    Parameters:
    - project: Project instance
    - bare: Minimal output
    - downloads: Remove cached downloads
    - allow_global: Allow purging global packages
    """

Shell Operations

Manage shell environments and run commands.

def do_shell(project, python=False, fancy=False, shell_args=None, anyway=False):
    """
    Spawn a shell within the virtualenv.
    
    Parameters:
    - project: Project instance
    - python: Use specific Python version
    - fancy: Use a fancy shell prompt
    - shell_args: Additional shell arguments
    - anyway: Create shell even if no virtualenv exists
    """

def do_run(project, command, args, python=False, pypi_mirror=None):
    """
    Run a command in the virtualenv.
    
    Parameters:
    - project: Project instance
    - command: Command to run
    - args: Command arguments
    - python: Use specific Python version
    """

Dependency Analysis

Analyze project dependencies and generate reports.

def do_graph(project, bare=False, json=False, json_tree=False, reverse=False):
    """
    Show dependency graph.
    
    Parameters:
    - project: Project instance
    - bare: Minimal output
    - json: Output as JSON
    - json_tree: Output as JSON tree
    - reverse: Show reverse dependencies
    """

def do_outdated(project, pypi_mirror=None, pre=False, clear=False):
    """
    Show outdated packages.
    
    Parameters:
    - project: Project instance
    - pre: Include pre-release packages
    - clear: Clear cache before checking
    """

Security and Cleanup

Security scanning and project maintenance.

def do_check(
    project,
    python=False,
    system=False,
    db=False,
    ignore=None,
    output="screen",
    key=None,
    quiet=False,
    exit_code=True,
    policy_file=None,
    save_json=None,
    audit_and_monitor=True,
    safety_project=None,
):
    """
    Check for security vulnerabilities and PEP 508 markers.
    
    Parameters:
    - project: Project instance
    - db: Path to safety database
    - ignore: Vulnerability IDs to ignore
    - output: Output format ('screen', 'json', etc.)
    - policy_file: Path to policy file
    - safety_project: Safety project configuration
    """

def do_clean(
    project,
    bare=False,
    python=False,
    dry_run=False,
    system=False,
    categories=None,
):
    """
    Uninstall all packages not specified in Pipfile.lock.
    
    Parameters:
    - project: Project instance
    - bare: Minimal output
    - dry_run: Show what would be uninstalled without doing it
    - categories: Specific package categories to clean
    """

def do_clear(project):
    """
    Clear pipenv caches.
    
    Parameters:
    - project: Project instance
    """

Update Operations

Update packages and dependencies.

def do_update(
    project,
    packages=False,
    editable_packages=False,
    index=False,
    dev=False,
    python=False,
    pypi_mirror=None,
    system=False,
    lock=True,
    site_packages=None,
    extra_pip_args=None,
    pipfile_categories=None,
    bare=False,
    dry_run=False,
    outdated=False,
    clear=False,
):
    """
    Update specified packages or all packages.
    
    Parameters:
    - project: Project instance
    - packages: List of specific packages to update
    - dev: Include development packages
    - lock: Generate lockfile after update
    - dry_run: Show what would be updated without doing it
    - outdated: Only update outdated packages
    """

Import Usage

from pipenv.routines.install import do_install
from pipenv.routines.lock import do_lock
from pipenv.routines.sync import do_sync
from pipenv.routines.uninstall import do_uninstall, do_purge
from pipenv.routines.shell import do_shell, do_run
from pipenv.routines.graph import do_graph
from pipenv.routines.outdated import do_outdated
from pipenv.routines.check import do_check
from pipenv.routines.clean import do_clean
from pipenv.routines.clear import do_clear
from pipenv.routines.update import do_update

# Example usage
from pipenv.project import Project

project = Project()
do_install(project, packages=["requests"], dev=False)
do_lock(project)

Install with Tessl CLI

npx tessl i tessl/pypi-pipenv

docs

cli.md

configuration.md

environment.md

exceptions.md

index.md

project.md

routines.md

utilities.md

tile.json