Skip to content

v0.1.2 - Embed version in Snakefile (fixes remote-module deploys)

Choose a tag to compare

@loganylchen loganylchen released this 15 May 04:49
· 9 commits to main since this release

Why v0.1.2

v0.1.1 added a VERSION file lookup via __file__, but that doesn't help when the workflow is loaded via:

module NanoRNAMod:
    snakefile: github("loganylchen/NanoRNAMod", path="workflow/Snakefile", tag="v0.1.1")

Snakemake's source-cache only fetches the Snakefile and its explicit includes — sibling files like VERSION (and .git) are never materialised on the caller's filesystem, so __file__-based lookup found nothing and the resolver still returned "unknown".

Fix

The version is now embedded directly in the Snakefile as a top-level constant:

__WORKFLOW_VERSION__ = "v0.1.2"

The Snakefile itself is the one file guaranteed to be present regardless of how it was loaded, so the constant always survives the cache.

New Resolution Order

  1. __WORKFLOW_VERSION__ inline constant ← always works, source of truth
  2. VERSION file via __file__ (local clones / tarballs)
  3. .snakedeploy metadata
  4. git rev-parse HEAD (developer mode, with -dirty suffix)
  5. "unknown" fallback

Upgrading

Bump your wrapper Snakefile:

 module NanoRNAMod:
-    snakefile: github("loganylchen/NanoRNAMod", path="workflow/Snakefile", tag="v0.1.1")
+    snakefile: github("loganylchen/NanoRNAMod", path="workflow/Snakefile", tag="v0.1.2")

⚠️ Snakemake may cache the previous Snakefile. If you still see unknown after bumping, clear ~/.cache/snakemake/snakemake/source-cache/ and re-run.

Full Changelog

v0.1.1...v0.1.2