def METHOD_NAME(reference_deployment, tmpdir):
    # Typically, the requirements files install from pypi. For tests, we want to
    # build from source. This fixture copies any required Dagster source code
    # into tmpdir and rewrites requirements*.txt to install from the local copy.
    python_modules = file_relative_path(__file__, "../../../python_modules/")
    libraries = file_relative_path(python_modules, "libraries/")
    modules = reference_deployment / "modules"
    for path in reference_deployment.listdir():
        if not path.basename.startswith("requirements"):
            continue
        if not path.ext == ".txt":
            continue
        overrides = []
        for requirement in path.read().splitlines():
            # The source code lives in dagster/python_modules
            if requirement in os.listdir(python_modules):
                source = file_relative_path(python_modules, requirement)
            # The source code lives in dagster/python_modules/libraries
            elif requirement in os.listdir(libraries):
                source = file_relative_path(libraries, requirement)
            # It's not a dagster library; continue to install from pypi
            else:
                overrides.append(requirement + "\n")
                continue
            shutil.copytree(source, modules / requirement, ignore=shutil.ignore_patterns(".tox"))
            overrides.append(f"./modules/{requirement}\n")
        with open(path, "w", encoding="utf8") as f:
            f.writelines(overrides)
    return modules