def get_version(search_dir: Path = _DEFAULT_SEARCH_DIR) -> str | None:
    """Check for all versions are the same and return that version.

    Lists all the modules within `search_dir` (default the current working directory), checks that
    all of them are the same version and returns that version. If no modules found, None is
    returned, if more than one, ValueError is raised.

    Args:
        search_dir: the search directory for modules.
    Returns:
        None if no modules are found, the version number if exactly one version number is found.
    Raises:
        ValueError: if more than one version numbers are found.
    """
    try:
        mods = list_modules(search_dir=search_dir, include_parent=True)
    except ValueError:
        return None
    versions = {m.name: m.version for m in mods}
    if len(set(versions.values())) > 1:
        raise ValueError(f"Versions should be the same, instead: \n{versions}")
    return list(set(versions.values()))[0]
Check for all versions are the same and return that version.

    Lists all the modules within `search_dir` (default the current working directory), checks that
    all of them are the same version and returns that version. If no modules found, None is
    returned, if more than one, ValueError is raised.

    Args:
        search_dir: the search directory for modules.
    Returns:
        None if no modules are found, the version number if exactly one version number is found.
    Raises:
        ValueError: if more than one version numbers are found.
    
dev_tools/modules.py