Configuration¶
depkeeper can be configured through CLI options, environment variables, and configuration files. When a CLI flag is not explicitly provided, depkeeper reads the value from the configuration file. If no configuration file is found, built-in defaults apply.
Configuration Hierarchy¶
Configuration is applied in this order (later overrides earlier):
- Built-in defaults
- Configuration file (
depkeeper.tomlorpyproject.toml) - Environment variables (
DEPKEEPER_*) - CLI arguments
CLI Options¶
Global Options¶
These options apply to all commands:
| Option | Description | Default |
|---|---|---|
-c, --config PATH | Path to configuration file | Auto-detected |
-v, --verbose | Increase verbosity (can repeat: -v, -vv) | Warning level |
--color / --no-color | Enable/disable colored output | --color |
--version | Show version and exit | -- |
-h, --help | Show help and exit | -- |
Command-Specific Options¶
See CLI Reference for complete option documentation per command.
Environment Variables¶
All environment variables are prefixed with DEPKEEPER_:
| Variable | Description | Example |
|---|---|---|
DEPKEEPER_CONFIG | Path to configuration file | /path/to/config.toml |
DEPKEEPER_COLOR | Enable/disable colors | true, false |
Examples¶
In CI/CD¶
Configuration File¶
File Locations¶
depkeeper looks for configuration in:
- Path specified by
--configorDEPKEEPER_CONFIG depkeeper.tomlin the current directorypyproject.tomlunder[tool.depkeeper]
depkeeper.toml Format¶
TOML
# depkeeper.toml
[depkeeper]
# Enable conflict checking by default
check_conflicts = true
# Only consider exact version pins (==)
strict_version_matching = false
pyproject.toml Format¶
Configuration Options Reference¶
| Option | Type | Default | Description |
|---|---|---|---|
check_conflicts | bool | true | Enable dependency conflict resolution |
strict_version_matching | bool | false | Only consider exact version pins (==) |
Excluding Packages¶
Use the --packages / -p CLI option to update only specific packages:
Example Configurations¶
Conservative Production¶
TOML
# depkeeper.toml - Production-safe settings
[depkeeper]
check_conflicts = true
strict_version_matching = true
Active Development¶
TOML
# depkeeper.toml - Development settings
[depkeeper]
check_conflicts = true
strict_version_matching = false
Precedence Example¶
Given:
depkeeper.toml:
Environment:
Command:
The effective configuration is:
check_conflicts = false(CLI overrides file)color = false(from environment)
Debugging Configuration¶
View effective configuration with verbose mode:
Text Only
DEBUG: Config path: /project/depkeeper.toml
DEBUG: Loaded configuration: {'check_conflicts': True, 'strict_version_matching': False}
DEBUG: Effective check_conflicts: True
Next Steps¶
- CLI Reference -- Complete command documentation
- Configuration Options -- Full options reference
- CI/CD Integration -- Use configuration in pipelines