From be783050ec0fd81448641ac74cd451939fdf358a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Carretero?= Date: Wed, 1 Jul 2020 00:07:27 -0400 Subject: [PATCH] fixup revision --- distriploy/__main__.py | 4 ++-- distriploy/distriploy.py | 6 +++--- distriploy/mirror_academictorrents.py | 4 ++-- distriploy/mirror_osf.py | 2 +- distriploy/mirror_rsync.py | 2 +- distriploy/release_github.py | 1 + 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/distriploy/__main__.py b/distriploy/__main__.py index 6ce7783..5371dc1 100644 --- a/distriploy/__main__.py +++ b/distriploy/__main__.py @@ -58,9 +58,9 @@ def main(args_in=None): release_meta = release(args.repository, args.revision, config) - mirror_metas = mirror(args.repository, args.revision, config, release_meta) + mirror_metas = mirror(args.repository, config, release_meta) - postrelease_meta = postrelease(args.repository, args.revision, config, release_meta, mirror_metas) + postrelease_meta = postrelease(args.repository, config, release_meta, mirror_metas) if __name__ == "__main__": diff --git a/distriploy/distriploy.py b/distriploy/distriploy.py index 6e4ced4..1f56d33 100644 --- a/distriploy/distriploy.py +++ b/distriploy/distriploy.py @@ -40,7 +40,7 @@ def release(repo_path, revision, config): raise -def mirror(repo_path, revision, config, release_meta): +def mirror(repo_path, config, release_meta): """ Handle mirroring of a release. """ @@ -58,7 +58,7 @@ def mirror(repo_path, revision, config, release_meta): continue try: - mirror_meta = mod.mirror(repo_path, revision, info, release_meta) + mirror_meta = mod.mirror(repo_path, info, release_meta) mirror_metas[mirror] = mirror_meta except Exception as e: logger.exception("Error running %s: %s", mirror_method_name, e) @@ -67,7 +67,7 @@ def mirror(repo_path, revision, config, release_meta): return mirror_metas -def postrelease(repo_path, revision, config, release_meta, mirror_metas): +def postrelease(repo_path, config, release_meta, mirror_metas): """ """ postrelease_meta = dict() diff --git a/distriploy/mirror_academictorrents.py b/distriploy/mirror_academictorrents.py index 4a3f8ff..43536d6 100644 --- a/distriploy/mirror_academictorrents.py +++ b/distriploy/mirror_academictorrents.py @@ -10,7 +10,7 @@ logger = logging.getLogger(__name__) -def mirror(repo_path, revision, config, release_meta): +def mirror(repo_path, config, release_meta): """ """ @@ -43,7 +43,7 @@ def mirror(repo_path, revision, config, release_meta): b64_torrent = base64.b64encode(data).decode() post_params = config["params"].copy() - post_params["name"] = "{} (revision: {})".format(post_params["name"], revision) + post_params["name"] = "{} (revision: {})".format(post_params["name"], release_meta["revision"]) post_params["uid"] = username post_params["pass"] = password post_params["file"] = b64_torrent diff --git a/distriploy/mirror_osf.py b/distriploy/mirror_osf.py index ad6553d..f3a09a8 100644 --- a/distriploy/mirror_osf.py +++ b/distriploy/mirror_osf.py @@ -5,7 +5,7 @@ from .osf import * -def mirror(repo_path, revision, config, release_meta): +def mirror(repo_path, config, release_meta): """ """ ret = dict() diff --git a/distriploy/mirror_rsync.py b/distriploy/mirror_rsync.py index 101e56f..d5ae810 100644 --- a/distriploy/mirror_rsync.py +++ b/distriploy/mirror_rsync.py @@ -8,7 +8,7 @@ logger = logging.getLogger(__name__) -def mirror(repo_path, revision, config, release_meta): +def mirror(repo_path, config, release_meta): """ """ diff --git a/distriploy/release_github.py b/distriploy/release_github.py index d691753..d56ed90 100644 --- a/distriploy/release_github.py +++ b/distriploy/release_github.py @@ -38,6 +38,7 @@ def release(repo_path, revision, cfg_root) -> dict: ret["release_id"] = release_id + ret["revision"] = git_tag tmpdir = "." local_path = download_default_release_asset(github_repo, release_id, github_token, tmpdir)