discussion and development of Emacs Snakemake mode
 help / color / mirror / code / Atom feed
* Add 'envmodules' and 'containers' to list of top level commands
@ 2020-11-01 19:18 Nicholas Knoblauch
  2020-11-01 20:36 ` [PATCH] mode: Add "container" and "envmodules" keywords Kyle Meyer
  0 siblings, 1 reply; 4+ messages in thread
From: Nicholas Knoblauch @ 2020-11-01 19:18 UTC (permalink / raw)
  To: snakemake-mode

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

Hi,
It would be great if snakemake-mode could support `envmodules` and
`containers` as top level commands as per
https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html?highlight=envmodules#using-environment-modules
and
https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html?highlight=envmodules#running-jobs-in-containers

Also, maybe I should file a separate issue about this (maybe it isn't even
a snakemake-mode question), but is there a way to force the "rule" line to
never indent (even if I hit 'Tab' on that line)?
I consistently run into whitespace issues with org-mode+snakemake-mode.

Thanks!

[-- Attachment #2: Type: text/html, Size: 1013 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] mode: Add "container" and "envmodules" keywords
  2020-11-01 19:18 Add 'envmodules' and 'containers' to list of top level commands Nicholas Knoblauch
@ 2020-11-01 20:36 ` Kyle Meyer
  2020-11-01 21:04   ` Nicholas Knoblauch
  0 siblings, 1 reply; 4+ messages in thread
From: Kyle Meyer @ 2020-11-01 20:36 UTC (permalink / raw)
  To: Nicholas Knoblauch; +Cc: snakemake-mode

Nicholas Knoblauch writes:

> Hi,
> It would be great if snakemake-mode could support `envmodules` and
> `containers` as top level commands as per
> https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html?highlight=envmodules#using-environment-modules
> and
> https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html?highlight=envmodules#running-jobs-in-containers

Sure, thanks for noticing that they're missing.  Based on the docs, my
understanding is that "envmodules" can only be used within a rule:

    rule bwa:
        envmodules:
            "bio/bwa/0.7.9"
        [...]

On the other hand, it looks like "container" can be used either within a
rule or at the top-level.  Is that correct?

> Also, maybe I should file a separate issue about this (maybe it isn't even
> a snakemake-mode question), but is there a way to force the "rule" line to
> never indent (even if I hit 'Tab' on that line)?
> I consistently run into whitespace issues with org-mode+snakemake-mode.

Hmm, not sure.  Starting a separate thread with a minimal reproducer
would be great.  Thanks.

-- >8 --
Subject: [PATCH] mode: Add "container" and "envmodules" keywords

Register "container" as both a field key and a top-level command
because an example of both is present in the Snakemake docs.

Reported-by: Nicholas Knoblauch <knoblauch.nicholas@gene.com>
---
 NEWS              | 5 +++--
 snakemake-mode.el | 3 +++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index f046551..2743025 100644
--- a/NEWS
+++ b/NEWS
@@ -2,8 +2,9 @@ NEWS -- history of user-visible changes             -*- mode: org; -*-
 
 * master (unreleased)
 
-- Additional Snakemake keywords are now recognized: 'envvars' (new in
-  Snakemake v5.11.0) and 'cache' keyword (new in v5.12.0).
+- Additional Snakemake keywords are now recognized: 'envmodules' (new
+  in Snakemake v5.9.0), 'envvars' (new in v5.11.0), 'container' (new
+  in v5.11.0), and 'cache' (new in v5.12.0).
 
 * v1.7.0
 
diff --git a/snakemake-mode.el b/snakemake-mode.el
index 5f603ee..cc4d372 100644
--- a/snakemake-mode.el
+++ b/snakemake-mode.el
@@ -85,7 +85,9 @@ (eval-and-compile
                         (or "benchmark"
                             "cache"
                             "conda"
+                            "container"
                             "cwl"
+                            "envmodules"
                             "group"
                             "input"
                             "log"
@@ -110,6 +112,7 @@ (eval-and-compile
                         symbol-end))
       (sm-command . ,(rx symbol-start
                          (or "configfile"
+                             "container"
                              "envvars"
                              "include"
                              "localrules"

base-commit: 870e1f2379110e48c7f189832aa7663fcb0be836
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mode: Add "container" and "envmodules" keywords
  2020-11-01 20:36 ` [PATCH] mode: Add "container" and "envmodules" keywords Kyle Meyer
@ 2020-11-01 21:04   ` Nicholas Knoblauch
  2020-11-01 21:13     ` Kyle Meyer
  0 siblings, 1 reply; 4+ messages in thread
From: Nicholas Knoblauch @ 2020-11-01 21:04 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: snakemake-mode



> On Nov 1, 2020, at 2:36 PM, Kyle Meyer <kyle@kyleam.com> wrote:
> 
> Nicholas Knoblauch writes:
> 
>> Hi,
>> It would be great if snakemake-mode could support `envmodules` and
>> `containers` as top level commands as per
>> https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html?highlight=envmodules#using-environment-modules
>> and
>> https://snakemake.readthedocs.io/en/latest/snakefiles/deployment.html?highlight=envmodules#running-jobs-in-containers
> 
> Sure, thanks for noticing that they're missing.  Based on the docs, my
> understanding is that "envmodules" can only be used within a rule:
> 
>    rule bwa:
>        envmodules:
>            "bio/bwa/0.7.9"
>        [...]
> 
> On the other hand, it looks like "container" can be used either within a
> rule or at the top-level.  Is that correct?
> 

I believe you’re right.


>> Also, maybe I should file a separate issue about this (maybe it isn't even
>> a snakemake-mode question), but is there a way to force the "rule" line to
>> never indent (even if I hit 'Tab' on that line)?
>> I consistently run into whitespace issues with org-mode+snakemake-mode.
> 
> Hmm, not sure.  Starting a separate thread with a minimal reproducer
> would be great.  Thanks.
> 

Will do.  Thanks again!

> -- >8 --
> Subject: [PATCH] mode: Add "container" and "envmodules" keywords
> 
> Register "container" as both a field key and a top-level command
> because an example of both is present in the Snakemake docs.
> 
> Reported-by: Nicholas Knoblauch <knoblauch.nicholas@gene.com>
> ---
> NEWS              | 5 +++--
> snakemake-mode.el | 3 +++
> 2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/NEWS b/NEWS
> index f046551..2743025 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -2,8 +2,9 @@ NEWS -- history of user-visible changes             -*- mode: org; -*-
> 
> * master (unreleased)
> 
> -- Additional Snakemake keywords are now recognized: 'envvars' (new in
> -  Snakemake v5.11.0) and 'cache' keyword (new in v5.12.0).
> +- Additional Snakemake keywords are now recognized: 'envmodules' (new
> +  in Snakemake v5.9.0), 'envvars' (new in v5.11.0), 'container' (new
> +  in v5.11.0), and 'cache' (new in v5.12.0).
> 
> * v1.7.0
> 
> diff --git a/snakemake-mode.el b/snakemake-mode.el
> index 5f603ee..cc4d372 100644
> --- a/snakemake-mode.el
> +++ b/snakemake-mode.el
> @@ -85,7 +85,9 @@ (eval-and-compile
>                         (or "benchmark"
>                             "cache"
>                             "conda"
> +                            "container"
>                             "cwl"
> +                            "envmodules"
>                             "group"
>                             "input"
>                             "log"
> @@ -110,6 +112,7 @@ (eval-and-compile
>                         symbol-end))
>       (sm-command . ,(rx symbol-start
>                          (or "configfile"
> +                             "container"
>                              "envvars"
>                              "include"
>                              "localrules"
> 
> base-commit: 870e1f2379110e48c7f189832aa7663fcb0be836
> -- 
> 2.28.0
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mode: Add "container" and "envmodules" keywords
  2020-11-01 21:04   ` Nicholas Knoblauch
@ 2020-11-01 21:13     ` Kyle Meyer
  0 siblings, 0 replies; 4+ messages in thread
From: Kyle Meyer @ 2020-11-01 21:13 UTC (permalink / raw)
  To: Nicholas Knoblauch; +Cc: snakemake-mode

Nicholas Knoblauch writes:

>> On Nov 1, 2020, at 2:36 PM, Kyle Meyer <kyle@kyleam.com> wrote:
>> Sure, thanks for noticing that they're missing.  Based on the docs, my
>> understanding is that "envmodules" can only be used within a rule:
>> 
>>    rule bwa:
>>        envmodules:
>>            "bio/bwa/0.7.9"
>>        [...]
>> 
>> On the other hand, it looks like "container" can be used either within a
>> rule or at the top-level.  Is that correct?
>> 
>
> I believe you’re right.

Okay, pushed (7cf04e2).

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-01 21:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-01 19:18 Add 'envmodules' and 'containers' to list of top level commands Nicholas Knoblauch
2020-11-01 20:36 ` [PATCH] mode: Add "container" and "envmodules" keywords Kyle Meyer
2020-11-01 21:04   ` Nicholas Knoblauch
2020-11-01 21:13     ` Kyle Meyer

Code repositories for project(s) associated with this public inbox

	https://git.kyleam.com/snakemake-mode/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).