Skip to content

Commit f6d6d70

Browse files
authored
Merge pull request #118 from cokelaer/main
Fixing #116
2 parents f685275 + 60f1e77 commit f6d6d70

File tree

8 files changed

+17
-27
lines changed

8 files changed

+17
-27
lines changed

.github/workflows/pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
runs-on: ubuntu-20.04
1212
steps:
1313
- uses: actions/checkout@main
14-
- name: Set up Python 3.8
14+
- name: Set up Python 3.10
1515
uses: actions/setup-python@v2
1616
with:
17-
python-version: 3.8
17+
python-version: '3.10'
1818

1919
- name: Install package
2020
run: |

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,9 @@ Changelog
317317
========= ======================================================================
318318
Version Description
319319
========= ======================================================================
320+
1.2.1 * create apptainer directory if it does not exist
321+
* --use-apptainer set to True internally is --apptainer-prefix is used
322+
* do not store conda env anymore since we are using containers
320323
1.2.0 * update to be compatible with poetry 2.0
321324
* print container size when initiating a pipeline
322325
1.1.1 * symlink creation on apptainers skipped if permission error (file

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
55

66
[project]
77
name = "sequana_pipetools"
8-
version = "1.2.0"
8+
version = "1.2.1"
99
description = "A set of tools to help building or using Sequana pipelines"
1010
authors = [{name="Sequana Team", email="[email protected]"}]
1111
license = "BSD-3"

sequana_pipetools/info.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
sequana_epilog = Colors().purple(
21-
"""\U00002139\U0000FE0F To use completion, type 'sequana_pipetools --completion NAME'
21+
"""\U00002139\U0000FE0F To use completion, type 'sequana_pipetools --completion {name}'
2222
2323
\u2705 If you use or like the Sequana project,
2424
please consider citing us (visit sequana.readthedocs.io for details) or use this
@@ -33,8 +33,8 @@
3333

3434
sequana_prolog = """Welcome to Sequana project (https://sequana.readthedocs.io)
3535
36-
This script prepares the pipeline sequana_{name}. It stores the pipeline and its
37-
configuration file in the requested working directory ({name} by default).
36+
This script prepares the pipeline sequana_{name}. It stores the pipeline and its
37+
configuration file in the requested working directory ({name} by default).
3838
Please check out the documentation carefully. In case of issues, please report
3939
on https://github.com/sequana/sequana/issues or https://github.com/sequana/{name}/issues
4040

sequana_pipetools/options.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def main(**kwargs):
6767
6868
"""
6969
click.rich_click.HEADER_TEXT = sequana_prolog.format(name=NAME)
70+
click.rich_click.FOOTER_TEXT = sequana_epilog.format(name=NAME)
7071
click.rich_click.OPTION_GROUPS[f"sequana_{NAME}"] = []
7172

7273
click.rich_context.RichContext.NAME = NAME

sequana_pipetools/sequana_manager.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,11 @@ def __init__(self):
139139

140140
if self.options.apptainer_prefix: # pragma: no cover
141141
self.apptainer_prefix = Path(self.options.apptainer_prefix).resolve()
142+
self.options.use_apptainer = True
143+
142144
if self.apptainer_prefix.exists() is False:
143-
logger.error(f"{self.apptainer_prefix} does not exist")
144-
sys.exit(1)
145+
logger.warning(f"Creating {self.apptainer_prefix} to store containers (does not exist)")
146+
os.makedirs(self.apptainer_prefix)
145147
self.local_apptainers = False
146148
else: # pragma: no cover
147149
self.apptainer_prefix = os.environ.get("SEQUANA_SINGULARITY_PREFIX", f"{self.workdir}/.sequana/apptainers")
@@ -444,22 +446,11 @@ def teardown(self, check_schema=True, check_input_files=True):
444446
with open(self.workdir / "unlock.sh", "w") as fout:
445447
fout.write(f"#!/bin/sh\nsnakemake -s {snakefilename} --unlock -j 1")
446448

447-
# save environment
448-
if shutil.which("conda"):
449-
print(self.colors.purple("Saving current conda environment information"))
450-
cmd = "conda list"
451-
with open(f"{self.workdir}/.sequana/env.yml", "w") as fout:
452-
subprocess.call(cmd.split(), stdout=fout)
453-
logger.debug("Saved your conda environment into env.yml")
454-
else:
455-
with open(f"{self.workdir}/.sequana/env.yml", "w") as fout:
456-
fout.write("Conda standalone not found")
457-
458449
if shutil.which("pip"):
459450
cmd = f"{sys.executable} -m pip freeze"
460451
with open(f"{self.workdir}/.sequana/pip.yml", "w") as fout:
461452
subprocess.call(cmd.split(), stdout=fout)
462-
logger.debug("Saved your pip environment into pip.txt (conda not found)")
453+
logger.debug("Saved your pip environment into pip.txt")
463454
else: # pragma: no cover
464455
with open(f"{self.workdir}/.sequana/pip.yml", "w") as fout:
465456
fout.write("pip not found")

sequana_pipetools/snaketools/dot_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class DOTParser:
5353
5454
"""
5555

56-
_name_to_drops = {"dag", "conda", "rulegraph", "copy_multiple_files"}
56+
_name_to_drops = {"dag", "rulegraph", "copy_multiple_files"}
5757

5858
def __init__(self, filename):
5959
""".. rubric:: constructor

sequana_pipetools/snaketools/module.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,12 @@ def check(self, mode="warning"):
255255
# _ = self.is_executable()
256256
missing = " ".join(missing)
257257
txt = f"""Some executable or Python packages are not available: {missing}
258-
Some functionalities may not work. Consider adding them with conda or set the --use-apptainer options.
258+
Some functionalities may not work. Consider using apptainer by setting a host directory with --apptainer-prefix
259259
260260
"""
261261

262262
if mode == "warning":
263263
logger.critical(txt)
264-
elif mode == "error": # pragma: no cover
265-
txt += "you may want to use \n conda install {missing};"
266-
for this in missing:
267-
txt += "- %s\n" % this
268-
raise ValueError(txt)
269264

270265
def md5(self):
271266
"""return md5 of snakefile and its default configuration file

0 commit comments

Comments
 (0)