# Path: src/_pytest/compat.py
# LEGACY_PATH = py.path. local
# 
# Path: src/_pytest/compat.py
# def legacy_path(path: Union[str, "os.PathLike[str]"]) -> LEGACY_PATH:
#     """Internal wrapper to prepare lazy proxies for legacy_path instances"""
#     return LEGACY_PATH(path)
# 
# Path: src/_pytest/deprecated.py
# HOOK_LEGACY_PATH_ARG = UnformattedWarning(
#     PytestRemovedIn8Warning,
#     "The ({pylib_path_arg}: py.path.local) argument is deprecated, please use ({pathlib_path_arg}: pathlib.Path)\n"
#     "see https://docs.pytest.org/en/latest/deprecations.html"
#     "#py-path-local-arguments-for-hooks-replaced-with-pathlib-path",
# )


import functools
import warnings
from pathlib import Path
from typing import Optional
from ..compat import LEGACY_PATH
from ..compat import legacy_path
from ..deprecated import HOOK_LEGACY_PATH_ARG
from _pytest.nodes import _check_path
    def __init__(self, hook_caller):
        self.__hook_caller = hook_caller

    def __dir__(self):
        return dir(self.__hook_caller)

    def __getattr__(self, key, _wraps=functools.wraps):
        hook = getattr(self.__hook_caller, key)
        if key not in imply_paths_hooks:
            self.__dict__[key] = hook
            return hook
        else:
            path_var, fspath_var = imply_paths_hooks[key]

            @_wraps(hook)
            def fixed_hook(**kw):

                path_value: Optional[Path] = kw.pop(path_var, None)
                fspath_value: Optional[LEGACY_PATH] = kw.pop(fspath_var, None)
                if fspath_value is not None:
                    warnings.warn(
                        HOOK_LEGACY_PATH_ARG.format(
                            pylib_path_arg=fspath_var, pathlib_path_arg=path_var
                        ),
                        stacklevel=2,
                    )
                if path_value is not None:
                    if fspath_value is not None:
                        _check_path(path_value, fspath_value)
                    else:

# Path: src/_pytest/compat.py
# LEGACY_PATH = py.path. local
# 
# Path: src/_pytest/compat.py
# def legacy_path(path: Union[str, "os.PathLike[str]"]) -> LEGACY_PATH:
#     """Internal wrapper to prepare lazy proxies for legacy_path instances"""
#     return LEGACY_PATH(path)
# 
# Path: src/_pytest/deprecated.py
# HOOK_LEGACY_PATH_ARG = UnformattedWarning(
#     PytestRemovedIn8Warning,
#     "The ({pylib_path_arg}: py.path.local) argument is deprecated, please use ({pathlib_path_arg}: pathlib.Path)\n"
#     "see https://docs.pytest.org/en/latest/deprecations.html"
#     "#py-path-local-arguments-for-hooks-replaced-with-pathlib-path",
# )


# Path: src/_pytest/config/compat.py
import functools
import warnings
from pathlib import Path
from typing import Optional
from ..compat import LEGACY_PATH
from ..compat import legacy_path
from ..deprecated import HOOK_LEGACY_PATH_ARG
from _pytest.nodes import _check_path

    def __init__(self, hook_caller):
        self.__hook_caller = hook_caller

    def __dir__(self):
        return dir(self.__hook_caller)

    def __getattr__(self, key, _wraps=functools.wraps):
        hook = getattr(self.__hook_caller, key)
        if key not in imply_paths_hooks:
            self.__dict__[key] = hook
            return hook
        else:
            path_var, fspath_var = imply_paths_hooks[key]

            @_wraps(hook)
            def fixed_hook(**kw):

                path_value: Optional[Path] = kw.pop(path_var, None)
                fspath_value: Optional[LEGACY_PATH] = kw.pop(fspath_var, None)
                if fspath_value is not None:
                    warnings.warn(
                        HOOK_LEGACY_PATH_ARG.format(
                            pylib_path_arg=fspath_var, pathlib_path_arg=path_var
                        ),
                        stacklevel=2,
                    )
                if path_value is not None:
                    if fspath_value is not None:
                        _check_path(path_value, fspath_value)
                    else:

                        fspath_value = legacy_path(path_value)