Skip to content

Commit

Permalink
Fixes bug in profile creation
Browse files Browse the repository at this point in the history
  • Loading branch information
cokelaer committed Apr 5, 2024
1 parent 5fca981 commit 1eb4474
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 7 additions & 7 deletions sequana_pipetools/snaketools/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

0 comments on commit 1eb4474

Please sign in to comment.