コード例 #1
0
ファイル: conftest.py プロジェクト: G-girl85/packit
def upstream_n_distgit(tmpdir):
    t = Path(str(tmpdir))

    u_remote = t / "upstream_remote"
    u_remote.mkdir()
    subprocess.check_call(["git", "init", "--bare", "."], cwd=u_remote)

    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))
    prepare_dist_git_repo(d)

    return u, d
コード例 #2
0
ファイル: conftest.py プロジェクト: cheese/packit
def ogr_distgit_and_remote(tmp_path) -> Tuple[Path, Path]:
    d_remote_path = tmp_path / "ogr_dist_git_remote"
    d_remote_path.mkdir(parents=True, exist_ok=True)
    subprocess.check_call(["git", "init", "--bare", "."], cwd=d_remote_path)

    d = tmp_path / "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
ファイル: conftest.py プロジェクト: FrNecas/packit
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
コード例 #4
0
ファイル: conftest.py プロジェクト: packit/packit
def distgit_and_remote(tmp_path) -> Tuple[Path, Path]:
    d_remote_path = tmp_path / "dist_git_remote"
    d_remote_path.mkdir(parents=True, exist_ok=True)
    create_new_repo(d_remote_path, ["--bare"])

    d = tmp_path / "dist_git"
    shutil.copytree(DISTGIT, 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
コード例 #5
0
ファイル: conftest.py プロジェクト: G-girl85/packit
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