import pathlib


def build_filename(working_directory,  # type: str
                   tag_name,           # type: str
                   extension='.in',    # type: str
                   prefix='src',       # type: str
                   ):
    # type: (...) -> pathlib.Path
    """Constructs a path to a tagged requirement source file.

    Args:
        working_directory: The parent directory of the source file.
        tag_name: The tag name.
        extension: The file extension. Defaults to *.in*.
        prefix: The subdirectory under the working directory to create
            the source file in. Defaults to *src*.

    """
    wd = pathlib.Path(working_directory) / prefix
    return wd / ''.join((tag_name, extension))