Config Reference¶
Complete reference for Pyreload configuration files.
Configuration Formats¶
Pyreload supports three formats:
- YAML:
.pyreload.yml,.pyreload.yaml,pyreload.yml,pyreload.yaml - JSON:
.pyreload.json,pyreload.json - TOML:
.pyreload.toml,pyreload.toml
Schema¶
watch¶
Type: array of strings
Default: ["."]
Paths to watch for file changes.
extensions¶
Type: array of strings
Default: ["py"]
File extensions to watch (without dots).
ignore¶
Type: array of strings (glob patterns)
Default: Common patterns (see below)
Patterns to ignore when watching files.
Default ignore patterns:
- .git/**
- **/__pycache__/**
- **/*.pyc
- **/*.pyo
- .venv/**
- venv/**
- node_modules/**
- .tox/**
- **/*.egg-info/**
polling¶
Type: boolean
Default: false
Use polling instead of native file system events.
poll_interval¶
Type: number (seconds)
Default: 1.0
Polling interval when polling is enabled.
delay¶
Type: number (seconds)
Default: 1.0
Delay before restarting after detecting changes.
clean¶
Type: boolean
Default: false
Clear terminal screen before each restart.
verbose¶
Type: boolean
Default: false
Enable verbose output.
quiet¶
Type: boolean
Default: false
Suppress Pyreload output (show only application output).
exec¶
Type: boolean
Default: false
Use exec mode (replace process instead of spawning child).
⚠️ Warning: Exec mode disables file watching.
no_interactive¶
Type: boolean
Default: false
Disable interactive keyboard commands.
Complete Examples¶
Development Configuration¶
# .pyreload.yml
watch:
- src
- config
- tests
extensions:
- py
- yaml
- json
ignore:
- "**/__pycache__/**"
- "**/*.pyc"
- ".pytest_cache/**"
clean: true
verbose: true
delay: 1.0
Production Configuration¶
# .pyreload.prod.yml
watch:
- src
- config
extensions:
- py
- yaml
ignore:
- "**/__pycache__/**"
- "tests/**"
- "docs/**"
polling: true
poll_interval: 2.0
quiet: true
no_interactive: true
Docker Configuration¶
# .pyreload.docker.yml
watch:
- /app/src
extensions:
- py
polling: true
poll_interval: 1.0
ignore:
- "**/__pycache__/**"
- ".git/**"
clean: true
Minimal Configuration¶
Configuration Precedence¶
Configuration is loaded in this order (later overrides earlier):
- Default values
- Configuration file
- Environment variables
- Command-line arguments
Example¶
# Command overrides config
pyreload -c config.yml -v -w tests app.py
# Result:
# - watch: ["src", "tests"]
# - verbose: true
Validation¶
Pyreload validates configuration and reports errors:
Unknown Option¶
Invalid Type¶
Invalid Pattern¶
Environment-Specific Configs¶
Development¶
Staging¶
Production¶
Usage¶
# Development
pyreload -c .pyreload.dev.yml app.py
# Staging
pyreload -c .pyreload.staging.yml app.py
# Production
pyreload -c .pyreload.prod.yml app.py
Best Practices¶
- Version control: Commit config files to share settings
- Environment files: Use separate configs for different environments
- Comments: Document non-obvious options (YAML/TOML only)
- Validation: Test configs with
--verboseflag - Minimal: Start with minimal config and expand as needed