Check Command¶
The check command queries installed plugins to see if package updates are available. Each plugin uses its native tooling to check for updates.
Basic Usage¶
Check all plugins for available updates:
Filtering by Plugin¶
Check specific plugins only:
Include Pre-releases¶
Options¶
| Option | Short | Description |
|---|---|---|
--plugin |
-p |
Plugin(s) to check. Omit to check all. |
--prereleases |
Include pre-release versions in results. |
API Usage¶
from porringer.backend.builder import Builder
from porringer.core.plugin_schema.environment import CheckUpdatesParameters, Environment
builder = Builder()
# Build plugin environments
plugin_infos = builder.find_plugins('environment', Environment)
environments = builder.build_plugins(plugin_infos)
# Check each plugin
for env in environments:
params = CheckUpdatesParameters(packages=[], include_prereleases=False)
updates = env.check_updates(params)
for pkg in updates:
print(f'{pkg.name}: update available to {pkg.version}')
Plugin Implementation¶
Plugins can implement the check_updates method to provide update checking:
from porringer.core.plugin_schema.environment import (
Environment,
CheckUpdatesParameters,
)
from porringer.core.schema import Package
class MyPluginEnvironment(Environment):
def check_updates(self, params: CheckUpdatesParameters) -> list[Package]:
# Use native tooling to check for updates
# Return packages that have updates available
return []
Plugins that don't implement check_updates will return an empty list by default.