From 1eb447479ccd504bcf082413a0eb2bd8fd13e348 Mon Sep 17 00:00:00 2001 From: Thomas Cokelaer Date: Fri, 5 Apr 2024 16:39:10 +0200 Subject: [PATCH] Fixes bug in profile creation --- README.rst | 2 ++ pyproject.toml | 2 +- sequana_pipetools/snaketools/profile.py | 14 +++++++------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index b7bc242..f4c3226 100644 --- a/README.rst +++ b/README.rst @@ -313,6 +313,8 @@ Changelog ========= ====================================================================== Version Description ========= ====================================================================== +1.0.1 * hot fix in the profile creation (regression) +1.0.0 * Stable release 0.17.3 * remove useless code and fix a requirement 0.17.2 * simpler logging 0.17.1 * remove the --use-singulariry (replaced by --use-apptainer in diff --git a/pyproject.toml b/pyproject.toml index ae715c7..ac8f3d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api" #maintainer ?#maintainer email [tool.poetry] name = "sequana_pipetools" -version = "1.0.0" +version = "1.0.1" description = "A set of tools to help building or using Sequana pipelines" authors = ["Sequana Team"] license = "BSD-3" diff --git a/sequana_pipetools/snaketools/profile.py b/sequana_pipetools/snaketools/profile.py index fe549d3..d17abc7 100644 --- a/sequana_pipetools/snaketools/profile.py +++ b/sequana_pipetools/snaketools/profile.py @@ -13,16 +13,16 @@ def create_profile(workdir: Path, profile: str, **kwargs) -> str: """Create profile config in working directory.""" try: - slurm_file = resources.files("sequana_pipetools.resources").joinpath(f"{profile}.yaml") - with open(slurm_file, "r") as fin: - slurm_text = fin.read() - slurl_text = slurm_text.format(**kwargs) + profile_file = resources.files("sequana_pipetools.resources").joinpath(f"{profile}.yaml") + with open(profile_file, "r") as fin: + profile_text = fin.read() + profile_text = profile_text.format(**kwargs) except AttributeError: # python 3.8 support for back compatibility - with resources.path("sequana_pipetools.resources", f"{profile}.yaml") as slurm_file: - slurm_text = slurm_file.read_text().format(**kwargs) + with resources.path("sequana_pipetools.resources", f"{profile}.yaml") as profile_file: + profile_text = profile_file.read_text().format(**kwargs) outfile = workdir / f".sequana/profile_{profile}" / "config.yaml" outfile.parent.mkdir(parents=True, exist_ok=True) - outfile.write_text(slurm_text) + outfile.write_text(profile_text) return f".sequana/profile_{profile}"