<gh_stars>1-10
import sys
import warnings

from pystow import module

forayer_stow = module("forayer")


def warning_formatter(msg, category, filename, lineno, line=None):
    """Format warning to only print filename, linenumber and message.

    Parameters
    ----------
    msg
        warning message
    category
        warning category
    filename
        filename of file where warning was raised
    lineno
        linenumber where warning was raised
    line
        line containing warning

    Returns
    -------
    str
        formatted warning message
    """
    return f"{filename}:L{lineno}: {msg}\n"


warnings.formatwarning = warning_formatter


if sys.version_info[1] > 7:
    from importlib.metadata import version  # pragma: no cover
else:
    from importlib_metadata import version  # pragma: no cover

__version__ = version(__package__)

import sys
import warnings

from pystow import module

forayer_stow = module("forayer")


def warning_formatter(msg, category, filename, lineno, line=None):
    """Format warning to only print filename, linenumber and message.

    Parameters
    ----------
    msg
        warning message
    category
        warning category
    filename
        filename of file where warning was raised
    lineno
        linenumber where warning was raised
    line
        line containing warning

    Returns
    -------
    str
        formatted warning message
    """
    return f"{filename}:L{lineno}: {msg}\n"


warnings.formatwarning = warning_formatter


if sys.version_info[1] > 7:
    from importlib.metadata import version  # pragma: no cover
else:
    from importlib_metadata import version  # pragma: no cover

__version__ = version(__package__)
Format warning to only print filename, linenumber and message.      Parameters     ----------     msg         warning message     category         warning category     filename         filename of file where warning was raised     lineno         linenumber where warning was raised     line         line containing warning      Returns     -------     str         formatted warning message # pragma: no cover # pragma: no cover