pjkm.core.groups.registry

Group registry: discover and load package group definitions from YAML.

Attributes

Classes

GroupRegistry

Loads and provides access to package group definitions.

Module Contents

pjkm.core.groups.registry.DEFINITIONS_DIR[source]
pjkm.core.groups.registry.CUSTOM_GROUP_PATHS[source]
class pjkm.core.groups.registry.GroupRegistry[source]

Loads and provides access to package group definitions.

load_builtin()[source]

Load all YAML group definitions from the built-in definitions directory.

Return type:

None

load_custom()[source]

Load custom group definitions from ~/.pjkm/groups/ and ./.pjkm/groups/.

Custom groups override built-in groups with the same ID. Returns list of directories that were loaded.

Return type:

list[pathlib.Path]

load_sources()[source]

Load group definitions from all registered remote sources.

Reads ~/.pjkm/sources.yaml and .pjkmrc.yaml group_sources, then loads cached repos. Sources must be synced first via pjkm group source sync.

Returns list of (source_name, group_count) tuples.

Return type:

list[tuple[str, int]]

load_plugins()[source]

Load groups from installed plugins via entry points.

Return type:

list[tuple[str, int]]

load_all()[source]

Load all groups: built-in + custom local + remote sources + plugins.

Return type:

None

load_directory(directory)[source]

Load all YAML group definitions from an arbitrary directory.

Returns count of groups loaded.

Parameters:

directory (pathlib.Path)

Return type:

int

load_file(path)[source]

Load a single YAML group definition.

Parameters:

path (pathlib.Path)

Return type:

pjkm.core.models.group.PackageGroup

get(group_id)[source]
Parameters:

group_id (str)

Return type:

pjkm.core.models.group.PackageGroup | None

list_all()[source]
Return type:

list[pjkm.core.models.group.PackageGroup]

list_for_archetype(archetype)[source]

Return groups applicable to a given archetype (empty archetypes = all).

Parameters:

archetype (str)

Return type:

list[pjkm.core.models.group.PackageGroup]

property group_ids: list[str][source]
Return type:

list[str]

static import_from_pyproject(pyproject_path, output_dir, sections=None)[source]

Import optional dependency groups from a pyproject.toml into YAML group files.

Reads [project.optional-dependencies] from the given pyproject.toml and creates a .yaml group definition for each section (or specified sections).

Returns list of created YAML files.

Parameters:
Return type:

list[pathlib.Path]