From 583448d56385d2ae2d633eb1cea3c835223b6cee Mon Sep 17 00:00:00 2001 From: vsoch Date: Mon, 13 Sep 2021 17:00:19 -0600 Subject: [PATCH] fixing parsing bug with singularity cli currently, it is assumed the comments and sections come after the header. However, we need to allow comments before because it is not unheard of (although it seems rare) Signed-off-by: vsoch --- CHANGELOG.md | 5 +++-- spython/main/parse/parsers/singularity.py | 4 ++-- spython/version.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 014a167..6fd8bbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,8 +17,9 @@ The client here will eventually be released as "spython" (and eventually to singularity on pypi), and the versions here will coincide with these releases. ## [master](https://github.com/singularityhub/singularity-cli/tree/master) - - ensure options and args from instance init are honored (0.0.15) - - choose output for stream_command (0.0.14) + - fixing bug with defining comments earlier (0.1.16) + - ensure options and args from instance init are honored (0.1.15) + - choose output for stream_command (0.1.14) - adding support to pull from a url (0.1.13) - add more verbosity to instance start/stop (0.1.12) - adding more verbosity to running commands (0.1.11) diff --git a/spython/main/parse/parsers/singularity.py b/spython/main/parse/parsers/singularity.py index f60788a..3f70971 100644 --- a/spython/main/parse/parsers/singularity.py +++ b/spython/main/parse/parsers/singularity.py @@ -304,6 +304,8 @@ def load_recipe(self): lines = self.lines[:] fromHeader = None stage = None + section = None + comments = [] while lines: @@ -314,8 +316,6 @@ def load_recipe(self): # Bootstrap Line if re.search("bootstrap", line, re.IGNORECASE): self._check_bootstrap(stripped) - section = None - comments = [] # From Line elif re.search("from:", stripped, re.IGNORECASE): diff --git a/spython/version.py b/spython/version.py index f8c2ce9..febad1a 100644 --- a/spython/version.py +++ b/spython/version.py @@ -5,7 +5,7 @@ # with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -__version__ = "0.1.15" +__version__ = "0.1.16" AUTHOR = "Vanessa Sochat" AUTHOR_EMAIL = "vsochat@stanford.edu" NAME = "spython"