← GDG /

#212 gdtest_flit_enums

#212 gdtest_flit_enums OK CONFIG
Flit layout + enums + Google docstrings. Tests Flit build backend with enum type documentation.
View Site → Build Log ๐Ÿงช Test Coverage

Build Mode

● Has great-docs.yml

This package ships a pre-supplied config. The great-docs init step is skipped and great-docs build uses the spec-defined configuration directly. Tests specific config options and their rendered output.

Dimensions

A10 C6 D2
A10Flit buildlayout
C6Enumsobjects
D2Googledocstrings

Source Files

๐Ÿ“ gdtest_flit_enums/
๐Ÿ“„ __init__.py
"""Package with Flit layout and enums using Google docstrings."""

from gdtest_flit_enums.types import Color, Status, Priority, get_label

__version__ = "0.1.0"
__all__ = ["Color", "Status", "Priority", "get_label"]
๐Ÿ“„ types.py
"""Enum types for the application."""

from enum import Enum, auto


class Color(Enum):
    """Available color options.

    Each color maps to an RGB hex string value.

    Attributes:
        RED: Bright red (#FF0000).
        GREEN: Bright green (#00FF00).
        BLUE: Bright blue (#0000FF).
        YELLOW: Bright yellow (#FFFF00).
    """

    RED = "#FF0000"
    GREEN = "#00FF00"
    BLUE = "#0000FF"
    YELLOW = "#FFFF00"


class Status(Enum):
    """Task lifecycle status.

    Tracks the progression of a task from creation to completion.

    Attributes:
        PENDING: Task has been created but not started.
        RUNNING: Task is currently executing.
        COMPLETED: Task finished successfully.
        FAILED: Task encountered an error.
    """

    PENDING = auto()
    RUNNING = auto()
    COMPLETED = auto()
    FAILED = auto()


class Priority(Enum):
    """Task priority levels.

    Higher numeric values indicate greater urgency.

    Attributes:
        LOW: Low priority (1).
        MEDIUM: Medium priority (2).
        HIGH: High priority (3).
        CRITICAL: Critical priority (4).
    """

    LOW = 1
    MEDIUM = 2
    HIGH = 3
    CRITICAL = 4


def get_label(status: Status) -> str:
    """Get a human-readable label for a status.

    Args:
        status: The status enum value.

    Returns:
        A formatted label string.

    Example:
        >>> get_label(Status.RUNNING)
        'In Progress'
    """
    labels = {
        Status.PENDING: "Waiting",
        Status.RUNNING: "In Progress",
        Status.COMPLETED: "Done",
        Status.FAILED: "Error",
    }
    return labels.get(status, "Unknown")
๐Ÿ“„ README.md
# gdtest-flit-enums

Test package with Flit build backend, enum types, and Google docstrings.
๐Ÿ“„ great-docs.yml
parser: google