cache
flavor.cache
¶
Cache management for Flavor packages.
Classes¶
CacheManager
¶
Manages the Flavor package cache.
Initialize cache manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cache_dir
|
Path | None
|
Override cache directory (defaults to system cache) |
None
|
Source code in flavor/cache.py
Functions¶
clean
¶
Clean old packages from cache.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_age_days
|
int | None
|
Remove packages older than this many days (None = remove all) |
None
|
Returns:
| Type | Description |
|---|---|
list[str]
|
List of removed package IDs |
Source code in flavor/cache.py
get_cache_size
¶
inspect_workenv
¶
Inspect a specific workenv.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workenv_name
|
str
|
Name of the workenv to inspect |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Detailed inspection information |
Source code in flavor/cache.py
list_cached
¶
List all cached packages.
Returns:
| Type | Description |
|---|---|
list[dict[str, str | int | float | None]]
|
List of cached package information |
Source code in flavor/cache.py
remove
¶
Remove a specific cached package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package_id
|
str
|
ID of the package to remove |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if removed, False if not found |
Source code in flavor/cache.py
Functions¶
get_cache_dir
¶
Get the cache directory for Flavor packages.
Uses XDG Base Directory specification: - FLAVOR_CACHE environment variable if set - XDG_CACHE_HOME if set - ~/.cache/flavor/workenv by default