Skip to content

Commit

Permalink
cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
espenhgn committed Oct 2, 2024
1 parent ce496b9 commit ede9c73
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/test_container_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# If neither are found, tests will fall back to plain python.
# This may be useful for testing on a local machine, but should
# be revised for the particular usecase.
cwd = os.getcwd()
try:
pth = os.path.join('containers', 'container_template.sif')
try:
Expand All @@ -33,15 +34,13 @@
out = subprocess.run('apptainer', check=False)
except FileNotFoundError as exc:
raise FileNotFoundError from exc
cwd = os.getcwd()
PREFIX = f'singularity run {pth} python'
PREFIX_MOUNT = f'singularity run --home={cwd}:/home/ {pth} python'
PREFIX_CUSTOM_MOUNT = f'singularity run --home={cwd}:/home/ ' + \
'{custom_mount}' + f'{pth} python'
except FileNotFoundError:
try:
out = subprocess.run('docker', check=False)
cwd = os.getcwd()
PREFIX = (f'docker run -p {port}:{port} ' +
'ghcr.io/precimed/container_template python')
PREFIX_MOUNT = (
Expand Down

0 comments on commit ede9c73

Please sign in to comment.