-
Notifications
You must be signed in to change notification settings - Fork 176
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
Removing snakemake.shell from wrappers #160
Conversation
…nakemake pickle object Signed-off-by: vsoch <vsochat@stanford.edu>
Ahhh every line needs formatting, so if we have:
It needs to be
I have a loooooooooot of work to do, lol. |
Signed-off-by: vsoch <vsochat@stanford.edu>
Signed-off-by: vsoch <vsochat@stanford.edu>
Signed-off-by: vsoch <vsochat@stanford.edu>
I am not skilled enough to know if this leads to unexpected behavior. I just wanted to hint, that we prevent the f"{something}" strings for backward compatibility for python < 3.6. |
Hmm @johanneskoester said explicitly to use them, e.g snakemake/snakemake#532 (comment). Also the setup.py of Snakemake indicates minimum Python of 3.5 so this would make sense. |
-.- He should have also told the others, we are always removing them, thanks! |
I'm going to hold off working on this further then, it could have been an oversight. I wish I had known before putting about 5 hours into this! Thanks for the insight! |
But hey, at least we can all agree it's no longer reasonable to support Python 2 :P |
@christopher-schroeder that advice is still correct in general. However, what @vsoch is working on here is a change in how wrappers are used. So far, Snakemake had to invoke them with its own Python binary, thereby pickling the job properties into the script. @vsoch is working on lifting this requirement, so that the job properties are put into the script via code generation. Once that is done, one can also safely switch to a later Python in the wrapper script, because it does not anymore need to work together with the Python from the Snakemake that is invoking it. |
Signed-off-by: vsoch <vsochat@stanford.edu>
okay I think we might have a missing dependency install in the conda recipe - with this updated snakemake (using a library called pulp in the scheduler) installing from conda has this error for every job:
This must be a new release because it wasn't needed for the last test! @johanneskoester want to bring this to your attention! In the meantime I'll install pulp for the CI. |
Signed-off-by: vsoch <vsochat@stanford.edu>
I don't see pulp here https://bioconda.github.io/recipes/snakemake/README.html. |
Signed-off-by: vsoch <vsochat@stanford.edu>
This should be fixed now. |
Signed-off-by: vsoch <vsochat@stanford.edu>
Thank you @FelixMoelder ! I just removed it from here so we can test. |
Signed-off-by: vsoch <vsochat@stanford.edu>
@FelixMoelder I added it back, removing it made all tests fail, so possibly it's not being grabbed from conda. I'll leave this for now and we can address after the wrappers are finished being updated. |
So close! Just one failed, samtools. I need to figure out the issue - it previously used bash, but when I used |
…iple lines Signed-off-by: vsoch <vsochat@stanford.edu>
That's odd. |
I think we shouldn't worry for now, it's likely a delay like that. :) |
It looks like snakemake-minimal is installed and also requires pulp. I‘ll update the recipe later. Thank‘s for bringing that to the table! |
Holy cow all tests passed! Converting from draft now... |
If you don't mind you could try removing pulp as dependency again. ;) |
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.
All the wrappers now additionally need python >=3.6
in their environment.yaml.
Signed-off-by: vsoch <vsochat@stanford.edu>
Leaving a note for myself - several packages have dependency issues that can't be resolved with adding python. I'll need to remove this addition and rewrite the shell commands to not require format strings.
This shouldn't take too long - will try to make some time toward end of today! |
Signed-off-by: vsoch <vsochat@stanford.edu>
All set! We're green again! |
Ok, that's unfortunate. Since we anyway do code generation for the dynamically generated preamble of the wrapper script, we could generate a Python-version-independent
This should work on Python 2 as well. Further, it makes the wrappers a bit more readable again because the |
@johanneskoester I already fixed the Python 2 errors above - but are you changing your mind that you want none of them to use format strings now? It’s a lot of (different) work and probably means starting over... :( So far this has easily been about 8-10 hours of work. |
I don't have much issues with the format strings, but the Python 2 wrappers really lack a bit of readability - maybe Johannes' idea can be applied only on those wrappers? However, if you guys decide on removing the format strings again, I could probably chime in and take some wrappers - I'm sure this is a task that can be parallelized. |
Yes, I am indeed changing my mind (for the sake of readability). Sorry for that. However, you don't need to do it, I can do it, no worries. Also, adding this code-generated shell function means that the wrappers can basically stay the same as in the master branch now. The only thing to change is to remove the line |
Nevertheless, I am deeply sorry to hear that you already worked >8 hours on this. I wished there was a way to keep this, but it just feels better to have a consistent and nicely readable shell function for all python wrappers. I can take over any other future boring task and you can sit on the sofa and relax while I am working on it. Would that be ok? |
haha, I don’t mind the tasks, it just feels sad to not use the work, or think about the opportunity cost of the time. I’m not one to sit on a couch, I don’t own one actually :p |
If you're inside, you are always on this treadmill, right :-)? |
Correct :) |
This will prepare the snakemake-wrappers repository to not require the pickled Snakemake object. There were also a few snakemake.utils makedirs and I replaced those with os.makedirs. For some of the wrappers there was a line like:
which I'm guessing ensures we use bash and not /bin/sh, but I'm not sure how to replicate that without the special snakemake function. I would suspect it mostly works removing it, but let's discuss how to address. If it's absolutely required might want to do like:
but I'm hoping that's overkill, it certainly doesn't seem safe or reliable to get back a return code, and maybe we'd even totally lose the child shell.
Signed-off-by: vsoch vsochat@stanford.edu