Skip to content

sphpkg

Type part of a name or a dotted path

Small package with sphinx-style docstrings.

Exists so the parser tests cover the reStructuredText field list syntax (:param x:, :returns:, :raises:).

Classes

NameDescription
JobA unit of queued work.

Functions

NameDescription
submitQueue a job for execution.

Jobclass#

class Job(label: str, priority: int = 0)

A unit of queued work.

Parameters

NameTypeDefaultDescription
labelstrrequiredHuman readable job label.
priorityint0Queue priority, higher runs first.

labelattributeinstance attribute#

label = label

priorityattributeinstance attribute#

priority = priority

describemethod#

def describe() -> str

Summarise the job.

Returns

str
A single line of plain text.

submitfunction#

def submit(job: Job, *, dry_run: bool = False) -> str

Queue a job for execution.

Parameters

NameTypeDefaultDescription
jobJobrequiredThe job to queue.
dry_runboolFalseWhen true, validate without queueing.

Returns

str
The identifier assigned to the job.

Raises

ValueError
If the job has an empty label.