Skip to content

Commit

Permalink
FIX: Revert wrapper to PY2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mgxd committed Aug 1, 2024
1 parent bcb6b0b commit 3881973
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wrapper/src/nibabies_wrapper/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def set_version(self):
elif self.service == 'singularity':
ret = subprocess.run(['singularity', 'version'], stdout=subprocess.PIPE)
version = ret.stdout.decode('ascii').strip()
version_env = f'{self.service.upper()}_VERSION_8395080871'
version_env = '%s_VERSION_8395080871' % self.service.upper()
self.add_envvar((version_env, version))

def add_envvar(self, envtuple):
Expand Down Expand Up @@ -378,7 +378,7 @@ def _is_file(path, parser):
'--image',
metavar='IMG',
type=str,
default=f'nipreps/nibabies:{__version__}',
default='nipreps/nibabies:%s' % __version__,
help='image name',
)

Expand Down Expand Up @@ -534,7 +534,7 @@ def main():
opts, unknown_args = parser.parse_known_args()

if opts.version:
print(f'nibabies wrapper {__version__!s}')
print('nibabies wrapper {!s}'.format(__version__))
return

# Set help if no directories set
Expand Down Expand Up @@ -605,7 +605,7 @@ def main():
# Patch working repositories into installed package directories
if opts.patch:
for pkg, repo_path in opts.patch.items():
container.add_mount(repo_path, f'{PKG_PATH}/{pkg}')
container.add_mount(repo_path, os.sep.join((PKG_PATH, pkg)))

if opts.env:
for envvar in opts.env:
Expand Down Expand Up @@ -724,7 +724,7 @@ def main():
print('RUNNING: ' + ' '.join(container.command))
ret = subprocess.run(container.command)
if ret.returncode:
print(f'nibabies: Please report errors to {__bugreports__}')
print('nibabies: Please report errors to %s' % __bugreports__)
return ret.returncode


Expand Down

0 comments on commit 3881973

Please sign in to comment.