Skip to main content

Dependency Management

PPM revolutionizes dependency management for polyglot projects by providing a unified interface for JavaScript and Python packages while maintaining the full power and compatibility of each ecosystem.

Core Concepts

Unified Configuration

Instead of managing separate package.json and requirements.txt files, PPM uses a single project.toml file:

Ecosystem Isolation

PPM maintains proper isolation between language ecosystems:
  • JavaScript packagesnode_modules/ directory
  • Python packages → Virtual environment (.venv/ or custom location)
  • No cross-contamination between package managers

Smart Resolution

PPM intelligently resolves dependencies:
  1. Analyzes your project structure
  2. Detects language-specific files (package.json, requirements.txt)
  3. Merges configurations when importing existing projects
  4. Maintains compatibility with existing toolchains

Installation Process

How ppm install Works

1

Environment Detection

PPM scans your project to understand the structure:
  • Checks for existing package.json or requirements.txt
  • Identifies language-specific directories
  • Detects Node.js and Python versions
2

Environment Setup

For JavaScript:
  • Uses existing node_modules/ or creates new one
  • Respects .nvmrc or Node.js version constraints
For Python:
  • Creates virtual environment (.venv/ by default)
  • Uses specified Python version or system default
  • Activates environment for all Python operations
3

Dependency Installation

Parallel Installation:
  • JavaScript packages installed via npm/yarn/pnpm
  • Python packages installed via pip
  • Both processes run simultaneously for speed
4

Lock File Generation

  • Generates ppm.lock with exact dependency tree
  • Includes both JavaScript and Python package versions
  • Ensures reproducible builds across environments

JavaScript Dependencies

Package Manager Support

PPM supports all major JavaScript package managers:

Version Specifications

PPM supports standard npm semantic versioning:

Scoped Packages

Handle scoped packages with proper quoting:

Development Dependencies

Separate production and development dependencies:

Python Dependencies

Version Constraints

PPM supports PEP 440 version specifiers:

Package Extras

Include optional dependencies with extras:

Development Dependencies

Virtual Environment Management

PPM automatically manages Python virtual environments:

Dependency Resolution

Conflict Resolution

When conflicts arise, PPM provides intelligent resolution:
PPM uses npm’s resolution algorithm:
Resolution:
  • PPM installs React 18.2.x as primary dependency
  • some-lib gets React 17.x in its own dependency tree
  • No conflict due to npm’s nested dependency structure
Python uses flat dependency resolution:
Resolution:
  • PPM installs numpy 1.24.x (satisfies both requirements)
  • Reports successful resolution
  • Warns if no compatible version exists
Some packages exist in both ecosystems:
Resolution:
  • Each package manager handles its own namespace
  • No conflicts between different ecosystems
  • PPM tracks versions separately

Dependency Updates

Keep dependencies up to date:

Lock Files and Reproducibility

Lock File Format

PPM generates a comprehensive lock file:

Reproducible Builds

Ensure identical environments across systems:

Advanced Features

Custom Package Sources

Configure private registries:

Environment-Specific Dependencies

Different dependencies for different environments:

Dependency Analysis

Analyze your dependency tree:

Migration Strategies

From Existing Projects

Import from existing dependency files:

Gradual Migration

Migrate large projects incrementally:
1

Start with PPM

2

Verify Compatibility

3

Update Workflows

Replace existing scripts with PPM commands:
4

Clean Up

Best Practices

Dependency Organization

  1. Group related packages together with comments:
  2. Pin exact versions in production environments
  3. Use ranges for development to catch compatibility issues early
  4. Regular dependency updates with proper testing
  5. Security scanning as part of CI/CD pipeline

Performance Optimization

  1. Parallel installation (PPM does this automatically)
  2. Dependency caching in CI/CD systems
  3. Selective installation for specific environments
  4. Bundle analysis for JavaScript applications

PPM’s dependency management eliminates the complexity of polyglot projects while maintaining full compatibility with existing package managers and workflows. The unified approach saves time, reduces errors, and improves team productivity.