Пример #1
0
def upstream_distgit_remote(tmpdir) -> Tuple[Path, Path, Path]:
    t = Path(str(tmpdir))

    u_remote_path = t / "upstream_remote"
    u_remote_path.mkdir(parents=True, exist_ok=True)

    subprocess.check_call(["git", "init", "--bare", "."], cwd=u_remote_path)

    u = t / "upstream_git"
    shutil.copytree(UPSTREAM, u)
    initiate_git_repo(u, tag="0.1.0")

    d = t / "dist_git"
    shutil.copytree(DISTGIT, d)
    initiate_git_repo(d, push=True, upstream_remote=str(u_remote_path))
    prepare_dist_git_repo(d)

    return u, d, u_remote_path
Пример #2
0
def ogr_distgit_and_remote(tmpdir) -> Tuple[Path, Path]:
    temp_dir = Path(str(tmpdir))

    d_remote_path = temp_dir / "ogr_dist_git_remote"
    d_remote_path.mkdir(parents=True, exist_ok=True)
    subprocess.check_call(["git", "init", "--bare", "."], cwd=d_remote_path)

    d = temp_dir / "ogr_dist_git"
    shutil.copytree(DG_OGR, d)
    initiate_git_repo(
        d,
        push=True,
        remotes=[
            ("origin", str(d_remote_path)),
            ("i_am_distgit", "https://src.fedoraproject.org/rpms/python-ogr"),
        ],
    )
    prepare_dist_git_repo(d)
    return d, d_remote_path
Пример #3
0
def sourcegit_n_distgit(tmpdir):
    temp_dir = Path(str(tmpdir))

    sourcegit_remote = temp_dir / "source_git_remote"
    sourcegit_remote.mkdir()
    subprocess.check_call(["git", "init", "--bare", "."], cwd=sourcegit_remote)

    sourcegit_dir = temp_dir / "source_git"
    shutil.copytree(SOURCEGIT_UPSTREAM, sourcegit_dir)
    initiate_git_repo(sourcegit_dir, tag="0.1.0")
    subprocess.check_call(
        ["cp", "-R", SOURCEGIT_SOURCEGIT, temp_dir], cwd=sourcegit_remote
    )
    git_add_and_commit(directory=sourcegit_dir, message="sourcegit content")

    distgit_dir = temp_dir / "dist_git"
    shutil.copytree(DISTGIT, distgit_dir)
    initiate_git_repo(distgit_dir, push=True, upstream_remote=str(sourcegit_remote))
    prepare_dist_git_repo(distgit_dir)

    return sourcegit_dir, distgit_dir