Skip to content
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

Fix regression bug when using wrapper-prefix #1492

Closed
wants to merge 1 commit into from

Conversation

cokelaer
Copy link

Description

Since a few months, we sticked to version 6.7 due to a regression bug when using
--wrapper-prefix option. Here is a quick fix that should solve the issue in version 7.2.1+9

With version 7.2.1, this kind of run using snakemake

snakemake -s test.rules --wrapper-prefix git+file:///home/user/local_wrappers 

currently fails. The error is related to the fact that

TypeError in line XX of test.rules:
expected str, got NoneType

an is probably related to this PR: #1182

This happen in modules wrapper.py where and sourcecache.py in LocalGitFile

Indeed the function find_extension of wrappers.py return None (hence the error here above) because the LocalGitFile.get_path_or_uri does not return a valid file.

This may be due the fact that git+ is not recognised by smart_open as a valid protocol.

Therefore, I switched from git+ to file://

This fixes the issue and allows us to use --wrapper-prefix again.

I see two issues here:

  1. I had to remove the @ referring to the branch
  2. using file: does seem strange since the class is called LocalGitFile

There are maybe some side effects here and I do not know the snakemake code base enough so please take care if merging the PR but that will be super useful to have this feature back to the next snakemake release !

QC

  • The PR contains a test case for the changes or the changes are already covered by an existing test case.
  • The documentation (docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).

@cokelaer cokelaer changed the title Fix regression bug when using wrapper-prefix fix: regression bug when using wrapper-prefix Mar 16, 2022
@sonarcloud
Copy link

sonarcloud bot commented Mar 16, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@cokelaer cokelaer changed the title fix: regression bug when using wrapper-prefix Fix regression bug when using wrapper-prefix Mar 16, 2022
@johanneskoester
Copy link
Contributor

Thanks a lot @cokelaer for digging into this and providing a fix! I have now fixed this in a more general way in PR #1495.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants