-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow nf-core pipelines download -r
to download commits
#3374
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files☔ View full report in Codecov by Sentry. |
28d0305
to
ec254d0
Compare
ec254d0
to
b0b9559
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I only made a couple of clean-up code suggestions.
Also tagging @MatthiasZepper in case you want to have a quick look
pipeline = "exoseq" | ||
|
||
download_obj = DownloadWorkflow(pipeline="exoseq", revision="819cbac792b76cf66c840b567ed0ee9a2f620db7") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pipeline = "exoseq" | |
download_obj = DownloadWorkflow(pipeline="exoseq", revision="819cbac792b76cf66c840b567ed0ee9a2f620db7") | |
pipeline = "exoseq" | |
revision = "819cbac792b76cf66c840b567ed0ee9a2f620db7" | |
download_obj = DownloadWorkflow(pipeline=pipeline, revision=revision) |
) = nf_core.utils.get_repo_releases_branches(pipeline, wfs) | ||
download_obj.get_revision_hash() | ||
print(download_obj) | ||
assert download_obj.wf_sha[download_obj.revision[0]] == "819cbac792b76cf66c840b567ed0ee9a2f620db7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert download_obj.wf_sha[download_obj.revision[0]] == "819cbac792b76cf66c840b567ed0ee9a2f620db7" | |
assert download_obj.wf_sha[download_obj.revision[0]] == revision |
download_obj.get_revision_hash() | ||
print(download_obj) | ||
assert download_obj.wf_sha[download_obj.revision[0]] == "819cbac792b76cf66c840b567ed0ee9a2f620db7" | ||
assert download_obj.outdir == "nf-core-exoseq_819cbac792b76cf66c840b567ed0ee9a2f620db7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert download_obj.outdir == "nf-core-exoseq_819cbac792b76cf66c840b567ed0ee9a2f620db7" | |
assert download_obj.outdir == f"nf-core-exoseq_{revision}" |
assert download_obj.outdir == "nf-core-exoseq_819cbac792b76cf66c840b567ed0ee9a2f620db7" | ||
assert ( | ||
download_obj.wf_download_url[download_obj.revision[0]] | ||
== "https://github.com/nf-core/exoseq/archive/819cbac792b76cf66c840b567ed0ee9a2f620db7.zip" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
== "https://github.com/nf-core/exoseq/archive/819cbac792b76cf66c840b567ed0ee9a2f620db7.zip" | |
== f"https://github.com/nf-core/exoseq/archive/{revision}.zip" |
wfs = nf_core.pipelines.list.Workflows() | ||
wfs.get_remote_workflows() | ||
# Exoseq pipeline is archived, so `dev` branch should be stable | ||
pipeline = "exoseq" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same suggestions from test_get_release_hash_long_commit
can also be applied here
download_obj.wf_branches, | ||
) = nf_core.utils.get_repo_releases_branches(pipeline, wfs) | ||
download_obj.get_revision_hash() | ||
print(download_obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print(download_obj) |
Thanks for tagging. I took a brief look and have no objections. |
Supersedes #2906
This is to allow downloading a specific commit of a pipeline, instead of only a branch / tag.
As @ewels suggested in the original pull-request, I only check the commit once we know it's neither a branch nor a tag. It's a single extra query, and it won't download the whole list of possible commits.
I could reuse the tests @fellen31 wrote. Credits to them
PR checklist
CHANGELOG.md
is updateddocs
is updated