Skip to content

kraken.std.descriptors.resource

kraken.std.descriptors.resource

BinaryArtifact dataclass

Bases: Resource

A subclass of a resource that represents a binary artifact.

Source code in kraken/std/descriptors/resource.py
@dataclass
class BinaryArtifact(Resource):
    """A subclass of a resource that represents a binary artifact."""

LibraryArtifact dataclass

Bases: Resource

A subclass of a resource that represents a library artifact.

Source code in kraken/std/descriptors/resource.py
@dataclass
class LibraryArtifact(Resource):
    """A subclass of a resource that represents a library artifact."""

Resource dataclass

A resource represents a file or directory on the file system.

Source code in kraken/std/descriptors/resource.py
@dataclass
class Resource:
    """A resource represents a file or directory on the file system."""

    name: str
    path: Path

resource

resource(
    *,
    name: str,
    path: str | Path,
    project: Project | None = None
) -> Resource

Creates a task for the purpose of carrying a :class:Resource descriptor.

Source code in kraken/std/descriptors/resource.py
def resource(*, name: str, path: str | Path, project: Project | None = None) -> Resource:
    """Creates a task for the purpose of carrying a :class:`Resource` descriptor."""

    project = project or Project.current()
    resource = Resource(name, project.directory / path)
    task = project.task(name, VoidTask)
    task.outputs.append(resource)
    return resource