示例#1
0
    def test_install_junit4_plugin(self, mocker):
        version = "v1.0.0"
        mocker.patch("bullet.Bullet.launch", side_effect=["junit4", version])

        repobee.run("plugin install".split())

        assert get_pkg_version("repobee-junit4") == version.lstrip("v")
示例#2
0
async def generate(hub, **pkginfo):
    user = "******"
    repo = "kitty"
    releases_data = await query_github_api(user, repo, "releases")
    latest_release = get_release(releases_data)
    if latest_release is None:
        raise hub.pkgtools.ebuild.BreezyError(
            f"Can't find a suitable release of {repo}")
    version = latest_release["tag_name"]
    commits_data = await query_github_api(user, repo, "commits")
    safe_commits = (commit for commit in commits_data
                    if await is_commit_safe(user, repo, commit["sha"]))
    target_commit = await safe_commits.__anext__()
    commit_date = datetime.strptime(
        target_commit["commit"]["committer"]["date"], "%Y-%m-%dT%H:%M:%SZ")
    commit_hash = target_commit["sha"]
    version += "." + commit_date.strftime("%Y%m%d")
    ebuild = hub.pkgtools.ebuild.BreezyBuild(
        **pkginfo,
        version=version.lstrip("v"),
        artifacts=[
            hub.pkgtools.ebuild.Artifact(
                url=
                f"https://github.com/{user}/{repo}/archive/{commit_hash}.tar.gz"
            )
        ],
    )
    ebuild.push()
示例#3
0
async def generate(hub, **pkginfo):
    github_user = "******"
    github_repo = pkginfo["name"]
    json_list = await hub.pkgtools.fetch.get_page(
        f"https://api.github.com/repos/{github_user}/{github_repo}/releases",
        is_json=True)
    latest_release = get_release(json_list)
    if latest_release is None:
        raise hub.pkgtools.ebuild.BreezyError(
            f"Can't find a suitable release of {github_repo}")
    version = latest_release["tag_name"]
    url = latest_release["tarball_url"]
    final_name = f"{github_repo}-{version}.tar.gz"
    src_artifact = hub.pkgtools.ebuild.Artifact(url=url, final_name=final_name)
    artifacts = await hub.pkgtools.rust.generate_crates_from_artifact(
        src_artifact)
    ebuild = hub.pkgtools.ebuild.BreezyBuild(
        **pkginfo,
        version=version.lstrip("v"),
        crates=artifacts["crates"],
        github_user=github_user,
        github_repo=github_repo,
        artifacts=[
            src_artifact,
            *artifacts["crates_artifacts"],
        ],
    )
    ebuild.push()
示例#4
0
async def generate(hub, **pkginfo):
    user = "******"
    repo = "Arduino"
    name = pkginfo["name"]
    releases_data = await hub.pkgtools.fetch.get_page(
        f"https://api.github.com/repos/{user}/{repo}/releases", is_json=True)
    latest_release = get_release(releases_data)
    if latest_release is None:
        raise hub.pkgtools.ebuild.BreezyError(
            f"Can't find a suitable release of {repo}")
    version = latest_release["tag_name"]
    ebuild_version = version.lstrip("v")
    arches = [("linux64", "amd64", "amd64"), ("linux32", "i386", "x86")]
    artifacts = [
        hub.pkgtools.ebuild.Artifact(
            url=
            f"http://www.arduino.cc/download.php?f=/arduino-{version}-{arch_url}.tar.xz",
            final_name=f"{name}_{arch_name}-{version}.tar.xz",
        ) for arch_url, arch_name, _ in arches
    ]
    ebuild = hub.pkgtools.ebuild.BreezyBuild(
        **pkginfo,
        version=ebuild_version,
        sources=zip([x[2] for x in arches], artifacts),
        artifacts=artifacts,
    )
    ebuild.push()
示例#5
0
    def test_install_specific_version_from_remote_git_repository(self):
        url = "https://github.com/repobee/repobee-junit4.git"
        version = "v1.0.0"

        repobee.run(f"plugin install --git-url {url}@{version}".split())

        install_info = disthelpers.get_installed_plugins()["junit4"]
        assert install_info["version"] == f"{url}@{version}"
        assert get_pkg_version("repobee-junit4") == version.lstrip("v")
示例#6
0
async def generate(hub, **pkginfo):
	user = "******"
	repo = pkginfo["name"]
	json_dict = await hub.pkgtools.fetch.get_page(f"https://api.github.com/repos/{user}/{repo}/releases", is_json=True)
	latest_release = get_release(json_dict)
	if latest_release is None:
		raise hub.pkgtools.ebuild.BreezyError(f"Can't find a suitable release of {repo}")
	version = latest_release["tag_name"]
	artifacts = await get_gosum_artifacts(hub, user, repo, version)
	ebuild = hub.pkgtools.ebuild.BreezyBuild(
		**pkginfo,
		version=version.lstrip("v"),
		gosum=artifacts["gosum"],
		artifacts=[
			hub.pkgtools.ebuild.Artifact(url=f"https://github.com/{user}/{repo}/archive/{version}.tar.gz",final_name=f"{repo}-{version}.tar.gz"),
			*artifacts["gosum_artifacts"],
		],
	)
	ebuild.push()
示例#7
0
async def generate(hub, **pkginfo):
	name = pkginfo["name"]
	releases_data = await hub.pkgtools.fetch.get_page(
		f"https://api.github.com/repos/{name}/{name}/releases", is_json=True
	)
	latest_release = get_release(releases_data)
	if latest_release is None:
		raise hub.pkgtools.ebuild.BreezyError(f"Can't find a suitable release of {name}")
	version = latest_release["tag_name"]
	ebuild_version = version.lstrip("v")
	ebuild = hub.pkgtools.ebuild.BreezyBuild(
		**pkginfo,
		version=ebuild_version,
		artifacts=[
			hub.pkgtools.ebuild.Artifact(
				url=f"https://github.com/{name}/{name}/archive/{version}.tar.gz",
				final_name=f"{name}-{ebuild_version}.tar.gz",
			)
		],
	)
	ebuild.push()
示例#8
0
async def generate(hub, **pkginfo):
    user = repo = "cli"
    release_data = await hub.pkgtools.fetch.get_page(
        f"https://api.github.com/repos/{user}/{repo}/releases", is_json=True)
    latest_release = get_release(release_data)
    if latest_release is None:
        raise hub.pkgtools.ebuild.BreezyError(
            f"Can't find a suitable release of {repo}")
    version = latest_release["tag_name"]
    url = latest_release["tarball_url"]
    final_name = f"{repo}-{version}.tar.gz"
    src_artifact = hub.pkgtools.ebuild.Artifact(url=url, final_name=final_name)
    artifacts = await hub.pkgtools.golang.generate_gosum_from_artifact(
        src_artifact)
    ebuild = hub.pkgtools.ebuild.BreezyBuild(
        **pkginfo,
        version=version.lstrip("v"),
        github_user=user,
        github_repo=repo,
        gosum=artifacts["gosum"],
        artifacts=[src_artifact, *artifacts["gosum_artifacts"]],
    )
    ebuild.push()
示例#9
0
async def generate(hub, **pkginfo):
    removal_list = ["_flameshot"]
    user = "******"
    repo = pkginfo["name"]
    releases_data = await hub.pkgtools.fetch.get_page(
        f"https://api.github.com/repos/{user}/{repo}/tags", is_json=True)
    latest_release = get_release(releases_data)
    if latest_release is None:
        raise hub.pkgtools.ebuild.BreezyError(
            f"Can't find a suitable release of {repo}")
    version = latest_release["name"]
    ebuild_version = version.lstrip("v")
    ebuild = hub.pkgtools.ebuild.BreezyBuild(
        **pkginfo,
        version=ebuild_version,
        removal_list=removal_list,
        artifacts=[
            hub.pkgtools.ebuild.Artifact(
                url=
                f"https://github.com/{user}/{repo}/archive/refs/tags/{version}.tar.gz"
            )
        ],
    )
    ebuild.push()
示例#10
0
async def generate(hub, **pkginfo):
    user = "******"
    name = pkginfo["name"]
    repo = name.rstrip("-bin")
    releases_data = await hub.pkgtools.fetch.get_page(
        f"https://api.github.com/repos/{user}/{repo}/releases", is_json=True)
    latest_release = get_release(releases_data)
    if latest_release is None:
        raise hub.pkgtools.ebuild.BreezyError(
            f"Can't find a suitable release of {repo}")
    version = latest_release["tag_name"]
    ebuild_version = version.lstrip("v")
    ebuild = hub.pkgtools.ebuild.BreezyBuild(
        **pkginfo,
        version=ebuild_version,
        artifacts=[
            hub.pkgtools.ebuild.Artifact(
                url=
                f"https://github.com/balena-io/{repo}/releases/download/{version}/balena-{repo}-electron_{ebuild_version}_amd64.deb",
                final_name=f"{name}-{ebuild_version}.deb",
            )
        ],
    )
    ebuild.push()