Configuration
PPM uses a singleproject.toml file to configure your entire polyglot project. This file defines dependencies, scripts, and project metadata in a simple, readable format.
Basic Structure
Every PPM project starts with aproject.toml file in the root directory:
Project Metadata
The[project] section contains basic information about your project:
Field Descriptions
JavaScript Dependencies
Define JavaScript and Node.js dependencies in the[dependencies.js] section:
Version Specifications
PPM supports standard npm semantic versioning:Scoped Packages
Include scoped packages with quotes:Python Dependencies
Define Python packages in the[dependencies.python] section:
Python Version Constraints
PPM supports PEP 440 version specifiers:Package Extras
Include optional dependencies with extras:Scripts
Define custom scripts in the[scripts] section to automate common tasks:
Script Features
- Cross-platform: Scripts work on Windows, macOS, and Linux
- Environment-aware: Python scripts run in the virtual environment
- Parallel execution: Use
&to run scripts simultaneously - Sequential execution: Use
&&to run scripts in sequence - Namespacing: Use
:to group related scripts
Built-in Script Variables
PPM provides several built-in variables for scripts:Environment Configuration
Python Virtual Environment
PPM automatically manages Python virtual environments, but you can customize the behavior:Node.js Configuration
Configure Node.js behavior for JavaScript projects:Advanced Configuration
Development Dependencies
Separate development-only dependencies:Environment-Specific Configuration
Define different configurations for different environments:Custom Package Sources
Configure custom package registries:Lock File Configuration
Control lock file behavior:File Structure Examples
Here are some complete examples for different project types:Full-Stack Web Application
Data Science Project
Microservices Project
Validation and Best Practices
Configuration Validation
PPM validates yourproject.toml file and provides helpful error messages:
- Missing required fields (
name,version) - Invalid semantic versions
- Conflicting dependency versions
- Invalid script syntax
Best Practices
- Use semantic versioning for your project version
- Pin exact versions in production environments
- Group related scripts with namespaces (e.g.,
test:frontend,test:backend) - Document complex scripts with comments
- Keep dependencies organized by purpose (framework, utilities, development)
- Use lock files for reproducible builds
- Separate dev and production dependencies
Configuration Tips
- Start simple: Begin with basic dependencies and add complexity as needed
- Use consistent naming: Follow consistent patterns for script names
- Test your scripts: Ensure all scripts work across different platforms
- Version control: Always commit your
project.tomland lock files - Document environment setup: Include setup instructions in your README
Migration from Other Tools
From package.json
Convert existing Node.js projects:From requirements.txt
Convert existing Python projects:From Both
For existing polyglot projects:Your
project.toml file is the heart of your PPM project. Take time to structure it well, and you’ll enjoy a smooth development experience across your entire polyglot application.