Skip to content

Commit

Permalink
redo to close #187 and to close #188
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsochat@stanford.edu>
  • Loading branch information
vsoch committed Mar 29, 2022
1 parent 6fb49da commit 02c5e57
Show file tree
Hide file tree
Showing 7 changed files with 3,109 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -17,6 +17,7 @@ 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)
- parser bugfixes, arg from Docker not properly parsed (0.2.1)
- version checks removed to support Singularity 3.x and above (0.2.0)
- adding support for SIF (oras pull) (0.1.18)
- updating CI/tests and fixing deprecations (warnings) (0.1.17)
Expand Down
1 change: 0 additions & 1 deletion setup.py
Expand Up @@ -104,7 +104,6 @@ def get_requirements(lookup=None):
"Topic :: Software Development",
"Topic :: Scientific/Engineering",
"Operating System :: Unix",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
],
entry_points={"console_scripts": ["spython=spython.client:main"]},
Expand Down
4 changes: 2 additions & 2 deletions spython/main/parse/parsers/base.py
Expand Up @@ -155,6 +155,6 @@ def _replace_from_dict(self, string, args):
string: the string with replacements made
"""
for key, value in args.items():
if re.search(r"\$(" + key + r"|\{[^}]*\})", string):
string = re.sub(r"\$(" + key + r"|\{[^}]*\})", value, string)
if re.search("([$]" + key + "|[$][{]" + key + "[}])", string):
string = re.sub("([$]" + key + "|[$]{" + key + "[}])", value, string)
return string
16 changes: 8 additions & 8 deletions spython/main/parse/writers/docker.py
Expand Up @@ -71,16 +71,16 @@ def validate_stage(self, parser):
if parser.fromHeader is None:
bot.exit("Dockerfile requires a fromHeader.")

# Parse the provided name
uri_regexes = [_reduced_uri, _default_uri, _docker_uri]
# Parse the provided name
uri_regexes = [_reduced_uri, _default_uri, _docker_uri]

for r in uri_regexes:
match = r.match(parser.fromHeader)
if match:
break
for r in uri_regexes:
match = r.match(parser.fromHeader)
if match:
break

if not match:
bot.exit("FROM header %s not valid." % parser.fromHeader)
if not match:
bot.exit("FROM header %s not valid." % parser.fromHeader)

def convert(self, runscript="/bin/bash", force=False):
"""convert is called by the parent class to convert the recipe object
Expand Down
1,575 changes: 1,575 additions & 0 deletions spython/tests/testdata/docker2singularity/argsub.def

Large diffs are not rendered by default.

1,522 changes: 1,522 additions & 0 deletions spython/tests/testdata/docker2singularity/argsub.docker

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spython/version.py
Expand Up @@ -5,7 +5,7 @@
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


__version__ = "0.2.0"
__version__ = "0.2.1"
AUTHOR = "Vanessa Sochat"
AUTHOR_EMAIL = "vsoch@users.noreply.github.com"
NAME = "spython"
Expand Down

0 comments on commit 02c5e57

Please sign in to comment.