nf-core / tools

Python package with helper tools for the nf-core community.
https://nf-co.re
MIT License
217 stars 182 forks source link

nf-core download should support local repos #2407

Open adamrtalbot opened 10 months ago

adamrtalbot commented 10 months ago

Description of feature

Related to #2406

nf-core download could support a local repo, by performing all the functions after retrieving the repository itself i.e. zipping it up, downloading the singularity containers. This could be part of #2406 or as a related method.

MatthiasZepper commented 10 months ago

For the --tower download, this is exactly what it already does. Check the WorkflowRepo class and associated methods. When DownloadWorkflow.download_workflow_tower() is executed, the repo is checked out at every requested tag/revision/commit and the container detection is run (if desired).

At the moment, WorkflowRepos are however initially downloaded from Github, unless there is already a cached version from a previous run. It would be relatively straightforward to adapt that class to support local repos at custom paths, yet it would somewhat contradict the purpose of a pipeline download tool if no pipeline is to be downloaded?

Some things that one would need to account for:

For now, I was very conservative and wrapped the old code into a download_workflow_static() method, but in the future it probably helps to always use local git repos (WorkflowRepo) and then to regular clones instead of bare clones for the static downloads. The only downside to that is, that this introduces git as a mandatory dependency - the static download still works on systems with no git installed.