← GDG /

#047 gdtest_name_mismatch

#047 gdtest_name_mismatch OK CONFIG
Project name does not match module name; config overrides
Project name is 'gdtest-name-mismatch' but the module is 'gdtest_nm' (completely different). Config sets module: gdtest_nm. The site title should use the project name. The Reference page should show exports from gdtest_nm: Mapper (class) and transform (function). The key test: config-driven module name override.
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

A1 B1 C1 D1 E6 F6 G1 H7
A1Flat layoutlayout
B1Explicit __all__exports
C1Functions onlyobjects
D1NumPydocstrings
E6No directivesdirectives
F6No user guideuser_guide
G1README.mdlanding
H7No extrasextras

Source Files

๐Ÿ“ gdtest_nm/
๐Ÿ“„ __init__.py
"""A package with a mismatched project/module name."""

__version__ = "0.1.0"
__all__ = ["transform", "Mapper"]


def transform(data: list, func: object = None) -> list:
    """
    Transform data using a function.

    Parameters
    ----------
    data
        The data to transform.
    func
        Optional transformation function.

    Returns
    -------
    list
        Transformed data.
    """
    if func is None:
        return data
    return [func(item) for item in data]


class Mapper:
    """
    A data mapper.

    Parameters
    ----------
    mapping
        A dictionary mapping keys to values.
    """

    def __init__(self, mapping: dict):
        self.mapping = mapping

    def apply(self, key: str) -> object:
        """
        Look up a key in the mapping.

        Parameters
        ----------
        key
            The key to look up.

        Returns
        -------
        object
            The mapped value.
        """
        return self.mapping.get(key)

    def keys(self) -> list:
        """
        Get all keys.

        Returns
        -------
        list
            All mapping keys.
        """
        return list(self.mapping.keys())
๐Ÿ“„ README.md
# gdtest-name-mismatch

Project name and module name are different.
๐Ÿ“„ great-docs.yml
module: gdtest_nm