-
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
Check 'modules' directory structure #1867
Conversation
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.
Reading the code looks good 👍🏻
# If there are modules installed in the wrong location | ||
if len(wrong_location_modules) > 0: | ||
log.info("The modules folder structure is outdated. Reinstalling modules.") | ||
# Remove the local copy of the modules repository |
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.
Can we not just git pull
update it? 👀
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.
I did it like this in case there is a patch file
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.
This is the cached modules repo though, right? ~/.config/nfcore/nf-core/modules/
?
Patch files are held in the pipeline repo, so the central cache location should be unaffected by those.
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.
Oh yes you are right, I mixed things.
So for this I copied code from you 😇 from #1851
But if there's a better way of doing it, let's change!
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.
Yeah but #1851 was for a modules clone that is corrupted, so no git operations would work.
Here the git repo is presumably just behind, so doing a git pull
should fix stuff, right? I think the code in self.modules_repo.setup_local_repo()
should already be pulling the latest changes:
tools/nf_core/modules/modules_repo.py
Lines 182 to 195 in 227e400
# If the repo is already cloned, fetch the latest changes from the remote | |
if not ModulesRepo.local_repo_synced(self.fullname): | |
pbar = rich.progress.Progress( | |
"[bold blue]{task.description}", | |
rich.progress.BarColumn(bar_width=None), | |
"[bold yellow]{task.fields[state]}", | |
transient=True, | |
disable=hide_progress, | |
) | |
with pbar: | |
self.repo.remotes.origin.fetch( | |
progress=RemoteProgressbar(pbar, self.fullname, self.remote_url, "Pulling") | |
) | |
ModulesRepo.update_local_repo_status(self.fullname, True) |
Is this not already working? If so it could be because it's doing git fetch
rather than git pull
. In other words, it's not checking out the latest commit, it's only downloading them 🤔 I don't think that there's any reason not to change this to a pull...
Codecov Report
@@ Coverage Diff @@
## dev #1867 +/- ##
==========================================
- Coverage 64.49% 64.44% -0.05%
==========================================
Files 34 35 +1
Lines 4137 4180 +43
==========================================
+ Hits 2668 2694 +26
- Misses 1469 1486 +17
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Co-authored-by: Phil Ewels <phil.ewels@scilifelab.se>
Ran python make_lint_md.py in api docs dir
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.
Can probably refine the clone update code instead of deleting and redownloading, but can leave that to another day.
Add a step in all
nf-core modules
commands to check if the modules directory of a pipeline has the correct structure. See slack discussionPR checklist
CHANGELOG.md
is updateddocs
is updated