Exemple #1
0
def test_relative_path(tmp_path, session_app_data, monkeypatch):
    sys_executable = Path(PythonInfo.current_system(app_data=session_app_data).system_executable)
    cwd = sys_executable.parents[1]
    monkeypatch.chdir(str(cwd))
    relative = str(sys_executable.relative_to(cwd))
    result = get_interpreter(relative, session_app_data)
    assert result is not None
    def sources(cls, interpreter):
        for src in super(CPython2PosixBase, cls).sources(interpreter):
            yield src

        # check if the makefile exists and if so make it available under the virtual environment
        make_file = Path(interpreter.sysconfig["makefile_filename"])
        if make_file.exists() and str(make_file).startswith(interpreter.prefix):
            under_prefix = make_file.relative_to(Path(interpreter.prefix))
            yield PathRefToDest(make_file, dest=lambda self, s: self.dest / under_prefix)