Dwarshuis, Nathan J writes:
> This new keyword was added in snakemake 7.25.0
Thanks, applied with minor tweaks (repositioned entry to keep
alphabetical order and added NEWS entry) and pushed (0c4c5b6a2).
This new keyword was added in snakemake 7.25.0 diff --git a/snakemake-mode.el b/snakemake-mode.el index d7373f4..02a0d3a 100644 --- a/snakemake-mode.el +++ b/snakemake-mode.el @@ -110,6 +110,7 @@ "version" "wildcard_constraints" "wrapper" + "localrule" ;; Keys for subworkflow blocks "configfile" "snakefile" Thank you, Nate
Diane Trout writes: > I discovered the snakemake ert tests run on my Debian testing system > but fail in the unstable package build environment. > > I read through the snakemake.el code and figured out how it was calling > the snakemake executable. I found the problem, and it's not related to > snakemake-mode, it looks like snakemake executable has an > incompatibility with python3.11. I see. Thanks for investigating. > Upstream's solution is here and involves using a more recently updated > depedency. > https://github.com/snakemake/snakemake/issues/1952 It looks like the associated fix came in with 50b8f160 (fix: Change ratelimiter dependency to throttler (#1958), 2022-11-10), which was part of the v7.18.2 release. So, the issue should be resolved whenever unstable gets bumped to the latest Snakemake.
On Sat, 2023-01-07 at 19:09 -0500, Kyle Meyer wrote: > Diane Trout writes: > > > Hi, > > > > I noticed there's 3 ert test failures running Emacs 28.2 on Debian > > unstable. > > Thanks for reporting. > > With Emacs 28.2 and snakemake 7.7.0 from Guix, the tests pass on my > end. > It looks like Debian unstable currently has snakemake 7.12.1-1. My > guess is that these failures are triggered by a snakemake change. > > I'll try to look into that within the next couple of days. I discovered the snakemake ert tests run on my Debian testing system but fail in the unstable package build environment. I read through the snakemake.el code and figured out how it was calling the snakemake executable. I found the problem, and it's not related to snakemake-mode, it looks like snakemake executable has an incompatibility with python3.11. Upstream's solution is here and involves using a more recently updated depedency. https://github.com/snakemake/snakemake/issues/1952 $ python3.11 /usr/bin/snakemake --dryrun aa.out Building DAG of jobs... Traceback (most recent call last): File "/usr/lib/python3/dist-packages/snakemake/__init__.py", line 730, in snakemake success = workflow.execute( ^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/snakemake/workflow.py", line 942, in execute self.scheduler = JobScheduler( ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/snakemake/scheduler.py", line 105, in __init__ from ratelimiter import RateLimiter File "/usr/lib/python3/dist-packages/ratelimiter.py", line 36, in <module> class RateLimiter(object): File "/usr/lib/python3/dist-packages/ratelimiter.py", line 127, in RateLimiter __aexit__ = asyncio.coroutine(__exit__) ^^^^^^^^^^^^^^^^^ AttributeError: module 'asyncio' has no attribute 'coroutine' $ python3.10 -Wd /usr/bin/snakemake --dryrun aa.out Building DAG of jobs... /usr/lib/python3/dist-packages/ratelimiter.py:127: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead __aexit__ = asyncio.coroutine(__exit__) Job stats: job count min threads max threads ----- ------- ------------- ------------- aa 1 1 1 total 1 1 1 [Sat Jan 7 19:56:59 2023] rule aa: output: aa.out jobid: 0 reason: Missing output files: aa.out resources: tmpdir=/tmp Job stats: job count min threads max threads ----- ------- ------------- ------------- aa 1 1 1 total 1 1 1 Reasons: (check individual jobs above for details) missing output files: aa This was a dry-run (flag -n). The order of jobs does not reflect the order of execution. /usr/lib/python3.10/tempfile.py:999: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/home/diane/.cache/snakemake/snakemake/source-cache/runtime- cache/tmplqpvu6li'> _warnings.warn(warn_message, ResourceWarning)
Diane Trout writes:
> Hi,
>
> I noticed there's 3 ert test failures running Emacs 28.2 on Debian
> unstable.
Thanks for reporting.
With Emacs 28.2 and snakemake 7.7.0 from Guix, the tests pass on my end.
It looks like Debian unstable currently has snakemake 7.12.1-1. My
guess is that these failures are triggered by a snakemake change.
I'll try to look into that within the next couple of days.
Hi, I noticed there's 3 ert test failures running Emacs 28.2 on Debian unstable. My knowledge of elisp is pretty poor so I'm not entirely sure what's broken, but to start the debugging process here's the errors reported from running M-x ert RET t RET after having run this command emacs -Q -l package --eval "(add-to-list 'package-directory-list \"/usr/share/emacs/site-lisp/elpa\")" --eval "(add-to-list 'package- directory-list \"/usr/share/emacs/site-lisp/elpa-src\")" -f package- initialize -L . -l snakemake-test.el --eval \(ert-run-tests-batch-and- exit\) F snakemake-test-check-target (ert-test-failed ((should (snakemake-with-temp-dir (snakemake-check-target "aa.out"))) :form (let* ((vnew #'...) (old (symbol-function ...))) (unwind-protect (progn (fset ... vnew) (let* ... ...)) (fset 'message old))) :value nil)) F snakemake-test-file-targets-at-point (ert-test-failed ((should (equal '("aa.out") (snakemake-with-temp-dir (with-temp-buffer ... ... ...)))) :form (equal ("aa.out") nil) :value nil :explanation (different-types ("aa.out") nil))) F snakemake-test-rule-at-point (ert-test-failed ((should (equal '("aa") (snakemake-with-temp-dir (with-temp-buffer ... ... ... ...)))) :form (equal ("aa") nil) :value nil :explanation (different-types ("aa") nil))) Thanks for any advice you can offer. Diane
Snakemake mode v2.0.0 has been released, with a corresponding tag pushed to <https://git.kyleam.com/snakemake-mode/>. Bug reports, patches, questions, and other feedback are welcome. Please send a plain-text email to snakemake-mode@inbox.kyleam.com Messages that include this address are public and available as public-inbox archives at https://inbox.kyleam.com/snakemake-mode/ ------------------------------------------------------------------------ Changes since v1.8.0: * Support for Emacs versions older than 26.1 has been dropped. * The Magit Popup command `snakemake-popup' has been rewritten as a transient, `snakemake'. snakemake.el now depends on Transient rather than Magit Popup. * The `--jobs' argument in the `snakemake' transient has been replaced by `--cores' to follow upstream changes. `--cores' is bound to `-c', and `--use-conda' has been moved from `-c' to `-C'. * Snakemake's new module syntax (added in v6.0) is now supported. * Additional Snakemake keywords are now recognized: 'containerized' (new in Snakemake v6.0.0), 'default_target' (new in Snakemake v6.15.0), 'handover' (new in Snakemake v6.2.0), 'name' (new in Snakemake v5.31.0), and 'notebook' (new in Snakemake v5.10.0). * The `snakemake-compile' command, marked obsolete in v1.2.0 in favor of `snakemake-build', has been removed. ------------------------------------------------------------------------ Kyle Meyer (15): mode: Add "name" to the list of field keys make: Load autoload.el before calling update-directory-autoloads ci: Switch to GitHub Actions Rework copyright lines Rewrite snakemake-popup as a transient transient: Replace --jobs with --cores transient: Use --cores=all by default Drop cl-lib from Package-Requires header Increase minimum required Emacs version to 26.1 mode: Add support for some newer keywords snakemake-rx-constituents: Drop deprecated sm-func Delete snakemake-compile compatibility alias mode: Add support for new module syntax make: Drop transient from the load path Release 2.0.0
26.1 was released in 2018 and is in the current Debian oldstable (Buster). I'm unlikely to build an older Emacs version than that in order to investigate and work around any incompatibilities that are reported, so mark it as the minimum. --- .github/workflows/test.yml | 2 +- NEWS | 2 ++ snakemake-mode.el | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a6d0ef2..17e4f0b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ jobs: strategy: matrix: emacs_version: - - 25.3 + - 26.1 - 27.2 - snapshot steps: diff --git a/NEWS b/NEWS index 64db66f..22b05e8 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ NEWS -- history of user-visible changes -*- mode: org; -*- * master (unreleased) +- Support for Emacs versions older than 26.1 has been dropped. + - The Magit Popup command ~snakemake-popup~ has been rewritten as a transient, ~snakemake~. snakemake.el now depends on Transient rather than Magit Popup. diff --git a/snakemake-mode.el b/snakemake-mode.el index 58d70bf..29b2544 100644 --- a/snakemake-mode.el +++ b/snakemake-mode.el @@ -6,7 +6,7 @@ ;; URL: https://git.kyleam.com/snakemake-mode/about ;; Keywords: tools ;; Version: 1.8.0 -;; Package-Requires: ((emacs "24.5") (transient "0.3.0")) +;; Package-Requires: ((emacs "26.1") (transient "0.3.0")) ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by base-commit: e76889ffdff100409fb7ac8a31e6814643658a3e -- 2.34.0
--cores has been a mandatory argument since v5.11. Set the default to something that can actually build targets. --- snakemake.el | 1 + 1 file changed, 1 insertion(+) diff --git a/snakemake.el b/snakemake.el index 91fef4f..98467ce 100644 --- a/snakemake.el +++ b/snakemake.el @@ -742,6 +742,7 @@ (transient-define-argument snakemake:--cores () ;;;###autoload (autoload 'snakemake "snakemake" nil t) (transient-define-prefix snakemake "Transient for running Snakemake." + :value '("--cores=all") ["Arguments" ("-C" "Use conda" "--use-conda") ("-f" "Force" "--force") -- 2.34.0
--cores was added as a synonym for --jobs in v3.10.0 (2012), and, as of v6.5.0, --cores and --jobs are distinct things for cloud/cluster jobs. Wait to add --jobs until it's requested. --- NEWS | 4 ++++ snakemake.el | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 73e2e20..64db66f 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,10 @@ NEWS -- history of user-visible changes -*- mode: org; -*- transient, ~snakemake~. snakemake.el now depends on Transient rather than Magit Popup. +- The ~--jobs~ argument in the ~snakemake~ transient has been replaced + by ~--cores~ to follow upstream changes. ~--cores~ is bound to + ~-c~, and ~--use-conda~ has been moved from ~-c~ to ~-C~. + - The 'name' keyword (new in Snakemake v5.31.0) is now recognized. * v1.8.0 diff --git a/snakemake.el b/snakemake.el index 61f6cbb..91fef4f 100644 --- a/snakemake.el +++ b/snakemake.el @@ -733,17 +733,17 @@ (transient-define-argument snakemake:--allowed-rules () :argument "--allowed-rules=" :reader 'snakemake-read-rules) -(transient-define-argument snakemake:--jobs () - :description "Number of jobs" +(transient-define-argument snakemake:--cores () + :description "Number of cores" :class 'transient-option - :key "-j" - :argument "--jobs=") + :key "-c" + :argument "--cores=") ;;;###autoload (autoload 'snakemake "snakemake" nil t) (transient-define-prefix snakemake "Transient for running Snakemake." ["Arguments" - ("-c" "Use conda" "--use-conda") + ("-C" "Use conda" "--use-conda") ("-f" "Force" "--force") ("-i" "Ignore temp()" "--notemp") ("-n" "Dry run" "--dryrun") @@ -751,7 +751,7 @@ (transient-define-prefix snakemake ("-r" "Print reason" "--reason") ("-t" "Touch files" "--touch") (snakemake:--allowed-rules) - (snakemake:--jobs)] + (snakemake:--cores)] ["Actions" [("c" "Edit and run command" snakemake-build)] [("p" "Build target at point" snakemake-build-targets-at-point) -- 2.34.0
Magit switched to Transient for its popups a while go. Magit Popup is still around for third-party libraries that may use it, but it's not actively developed. At the moment, this switch is trading one external library for another (improved) one. However, Transient will ship with Emacs starting with the upcoming 28.1 release. --- .github/workflows/test.yml | 6 +-- Makefile | 2 +- NEWS | 4 ++ README | 7 +-- snakemake-mode.el | 2 +- snakemake.el | 90 +++++++++++++++++++++----------------- 6 files changed, 64 insertions(+), 47 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6772f36..a6d0ef2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,11 +19,11 @@ jobs: with: repository: magnars/dash.el path: dash.el - - name: Check out magit-popup + - name: Check out transient uses: actions/checkout@v2 with: - repository: magit/magit-popup - path: magit-popup + repository: magit/transient + path: transient - name: Check out snakemake-mode uses: actions/checkout@v2 with: diff --git a/Makefile b/Makefile index d93192a..8dd1437 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -LOAD_PATH = -L ../magit-popup -L ../dash.el -L . +LOAD_PATH = -L ../transient/lisp -L ../dash.el -L . EMACS = emacs BATCH = $(EMACS) -Q --batch $(LOAD_PATH) CURL := curl --silent diff --git a/NEWS b/NEWS index 2674114..73e2e20 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ NEWS -- history of user-visible changes -*- mode: org; -*- * master (unreleased) +- The Magit Popup command ~snakemake-popup~ has been rewritten as a + transient, ~snakemake~. snakemake.el now depends on Transient + rather than Magit Popup. + - The 'name' keyword (new in Snakemake v5.31.0) is now recognized. * v1.8.0 diff --git a/README b/README index 56b368d..556bdc2 100644 --- a/README +++ b/README @@ -7,7 +7,7 @@ This repo contains two Emacs libraries for Snakemake [^1]. * snakemake-mode.el provides a major mode for editing Snakemake files. - * snakemake.el defines a popup interface for calling Snakemake. + * snakemake.el defines a transient [^2] for calling Snakemake. See the header of each file for more information. @@ -16,6 +16,7 @@ Both of these are available on MELPA under the snakemake-mode package: https://melpa.org/#/snakemake-mode [^1]: https://snakemake.readthedocs.io/en/stable/ +[^2]: https://magit.vc/manual/transient/ Contributing @@ -27,8 +28,8 @@ Please send a plain-text email to snakemake-mode@inbox.kyleam.com Messages that include this address are public and available as -public-inbox [^2] archives at +public-inbox [^3] archives at https://inbox.kyleam.com/snakemake-mode/ -[^2]: https://public-inbox.org/README +[^3]: https://public-inbox.org/README diff --git a/snakemake-mode.el b/snakemake-mode.el index 5e4118b..dcf2bf0 100644 --- a/snakemake-mode.el +++ b/snakemake-mode.el @@ -6,7 +6,7 @@ ;; URL: https://git.kyleam.com/snakemake-mode/about ;; Keywords: tools ;; Version: 1.8.0 -;; Package-Requires: ((emacs "24.5") (cl-lib "0.5") (magit-popup "2.4.0")) +;; Package-Requires: ((emacs "24.5") (cl-lib "0.5") (transient "0.3.0")) ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by diff --git a/snakemake.el b/snakemake.el index e533def..61f6cbb 100644 --- a/snakemake.el +++ b/snakemake.el @@ -20,14 +20,13 @@ ;;; Commentary: -;; This package provides a popup interface, built on Magit's popup -;; library [1], for calling Snakemake [2]. The main entry point is -;; `snakemake-popup', which you should consider giving a global key -;; binding. +;; This package provides a Transient interface [1] for calling +;; Snakemake [2]. The main entry point is the `snakemake' command, +;; which you should consider giving a global key binding. ;; -;; The popup currently includes four actions, all which lead to a -;; Snakemake call. What's different between the actions is how -;; targets are selected. +;; The `snakemake' transient currently includes four actions, all +;; which lead to a Snakemake call. What's different between the +;; actions is how targets are selected. ;; ;; snakemake-build-targets-at-point ;; @@ -78,13 +77,13 @@ ;; terminal can be created with `snakemake-term-start', in which case ;; commands are sent there instead. ;; -;; In addition to the popup commands, there are commands for showing -;; and saving the dependency graph of a target. The command -;; `snakemake-graph' displays the graph in a buffer. From this -;; buffer, `snakemake-graph-save' can be called to save the graph to -;; an output file. +;; In addition to the commands in the transient, there are commands +;; for showing and saving the dependency graph of a target. The +;; command `snakemake-graph' displays the graph in a buffer. From +;; this buffer, `snakemake-graph-save' can be called to save the graph +;; to an output file. ;; -;; [1] https://magit.vc/manual/magit-popup.html +;; [1] https://magit.vc/manual/transient/ ;; [2] https://snakemake.github.io/ ;;; Code: @@ -92,7 +91,7 @@ (require 'cl-lib) (require 'compile) (require 'term) -(require 'magit-popup) +(require 'transient) (require 'snakemake-mode) @@ -672,7 +671,7 @@ (defun snakemake-build-targets-at-point (&optional args) "Build target(s) at point without any prompts. $ snakemake [ARGS] -- <targets>" - (interactive (list (snakemake-arguments))) + (interactive (list (transient-args 'snakemake))) (snakemake-build-targets (or (snakemake-file-targets-at-point 'check) (snakemake-rule-at-point 'target) @@ -684,7 +683,7 @@ (defun snakemake-build-file-target (&optional args) "Build target file. $ snakemake [ARGS] -- <file>" - (interactive (list (snakemake-arguments))) + (interactive (list (transient-args 'snakemake))) (snakemake-build-targets (list (snakemake-read-file-target)) args)) @@ -694,7 +693,7 @@ (defun snakemake-build-rule-target (&optional args) "Build target rule, prompting with known rules. $ snakemake [ARGS] -- <rule>" - (interactive (list (snakemake-arguments))) + (interactive (list (transient-args 'snakemake))) (snakemake-build-targets (list (snakemake-read-rule 'targets)) args)) @@ -711,7 +710,7 @@ (defun snakemake-build (&optional args) `\\[snakemake-term-start]'. $ snakemake [ARGS] -- <targets>" - (interactive (list (snakemake-arguments))) + (interactive (list (transient-args 'snakemake))) (let ((cmd (snakemake--make-command (or (snakemake-file-targets-at-point) (snakemake-rule-at-point) @@ -727,27 +726,40 @@ (defun snakemake-build (&optional args) (define-obsolete-function-alias 'snakemake-compile 'snakemake-build "1.2.0") -;;;###autoload (autoload 'snakemake-popup "snakemake" nil t) -(magit-define-popup snakemake-popup - "Popup console for running Snakemake." - :switches - '((?c "Use conda" "--use-conda") - (?f "Force" "--force") - (?i "Ignore temp()" "--notemp") - (?n "Dry run" "--dryrun") - (?p "Print shell commands" "-p") - (?r "Print reason" "--reason") - (?t "Touch files" "--touch")) - :options - '((?a "Allowed rules" "--allowed-rules " snakemake-read-rules) - (?j "Number of jobs" "-j")) - :actions - '((?c "Edit and run command" snakemake-build) nil nil - (?p "Build target at point" snakemake-build-targets-at-point) - (?f "Build file" snakemake-build-file-target) - (?r "Build rule" snakemake-build-rule-target)) - :default-action 'snakemake-compile - :max-action-columns 3) +(transient-define-argument snakemake:--allowed-rules () + :description "Allowed rules" + :class 'transient-option + :key "-a" + :argument "--allowed-rules=" + :reader 'snakemake-read-rules) + +(transient-define-argument snakemake:--jobs () + :description "Number of jobs" + :class 'transient-option + :key "-j" + :argument "--jobs=") + +;;;###autoload (autoload 'snakemake "snakemake" nil t) +(transient-define-prefix snakemake + "Transient for running Snakemake." + ["Arguments" + ("-c" "Use conda" "--use-conda") + ("-f" "Force" "--force") + ("-i" "Ignore temp()" "--notemp") + ("-n" "Dry run" "--dryrun") + ("-p" "Print shell commands" "-p") + ("-r" "Print reason" "--reason") + ("-t" "Touch files" "--touch") + (snakemake:--allowed-rules) + (snakemake:--jobs)] + ["Actions" + [("c" "Edit and run command" snakemake-build)] + [("p" "Build target at point" snakemake-build-targets-at-point) + ("f" "Build file" snakemake-build-file-target) + ("r" "Build rule" snakemake-build-rule-target)]]) + +;;;###autoload +(define-obsolete-function-alias 'snakemake-popup 'snakemake "2.0.0") (provide 'snakemake) ;;; snakemake.el ends here -- 2.34.0
The first patch makes the long overdue switch from Magit Popup to Transient. While working on that, I realized that the --jobs argument is now out of date. The second and third patches deal with that. [1/3] Rewrite snakemake-popup as a transient [2/3] transient: Replace --jobs with --cores [3/3] transient: Use --cores=all by default .github/workflows/test.yml | 6 +-- Makefile | 2 +- NEWS | 8 ++++ README | 7 +-- snakemake-mode.el | 2 +- snakemake.el | 91 ++++++++++++++++++++++---------------- 6 files changed, 69 insertions(+), 47 deletions(-) base-commit: 8684b45cf53e403c7b0ebf31d899aa239a821f45 -- 2.34.0
The only noteworthy change in this release is that snakemake-mode.el learned about a few more keywords. --- * 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).
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).
> 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 >
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
[-- 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 --]
Kyle Meyer <kyle@kyleam.com> writes:
> Kyle Meyer <kyle@kyleam.com> writes:
>
>> There's not _that_ many, so I may make some attempt to fill them in, at
>> least as new mails with links to or quotes of the previous discussion.
>
> I did a few, but I'll let this be for now.
I did a final pass that should cover nearly all of the remaining ones.
This time I lazily didn't include any quoted text. That's not ideal
because there's discussion that is not captured in this archive, but at
least the reader will know that the conversation is incomplete and that
they should follow a link from one of the messages to see more.
Some replies are missing, as described at https://inbox.kyleam.com/snakemake-mode/874ktmyh4u.fsf@kyleam.com/ Please visit the link in the parent message to see the full discussion.
Some replies are missing, as described at https://inbox.kyleam.com/snakemake-mode/874ktmyh4u.fsf@kyleam.com/ Please visit the link in the parent message to see the full discussion.
Some replies are missing, as described at https://inbox.kyleam.com/snakemake-mode/874ktmyh4u.fsf@kyleam.com/ Please visit the link in the parent message to see the full discussion.
Some replies are missing, as described at https://inbox.kyleam.com/snakemake-mode/874ktmyh4u.fsf@kyleam.com/ Please visit the link in the parent message to see the full discussion.
Some replies are missing, as described at https://inbox.kyleam.com/snakemake-mode/874ktmyh4u.fsf@kyleam.com/ Please visit the link in the parent message to see the full discussion.
Some replies are missing, as described at https://inbox.kyleam.com/snakemake-mode/874ktmyh4u.fsf@kyleam.com/ Please visit the link in the parent message to see the full discussion.
Some replies are missing, as described at https://inbox.kyleam.com/snakemake-mode/874ktmyh4u.fsf@kyleam.com/ Please visit the link in the parent message to see the full discussion.