Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: eWaterCycle/setup-singularity@1631b12cf3878381179be0eab9624219bc12979e # v6 release

- uses: eWaterCycle/setup-singularity@bebf1d6f54f9d2d159ac5c15385912dc39b23711 # v7 release
with:
singularity-version: 3.8.4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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)
- adding support for SIF (oras pull) (0.1.18)
- updating CI/tests and fixing deprecations (warnings) (0.1.17)
- fixing bug with defining comments earlier (0.1.16)
- ensure options and args from instance init are honored (0.1.15)
Expand Down
2 changes: 1 addition & 1 deletion spython/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""

Copyright (C) 2017-2021 Vanessa Sochat.
Copyright (C) 2017-2022 Vanessa Sochat.

This Source Code Form is subject to the terms of the
Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/client/recipe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/client/shell.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/client/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/image/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/image/cmd/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/image/cmd/create.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/image/cmd/export.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/image/cmd/importcmd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/image/cmd/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/instance/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/instance/cmd/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/instance/cmd/logs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2019-2021 Vanessa Sochat.
# Copyright (C) 2019-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/instance/cmd/start.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/instance/cmd/stop.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/logger/compatibility.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/logger/message.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/logger/spinner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/apps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/base/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/base/command.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/base/flags.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/base/generate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/base/logger.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/base/sutils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Singularity Image utils for interacting with the Image/Instance
# classes from the client

# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/execute.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/export.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/help.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/inspect.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/instances.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/parse/parsers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/parse/parsers/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/parse/parsers/docker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/parse/parsers/singularity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/parse/recipe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/parse/writers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/parse/writers/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/parse/writers/docker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/main/parse/writers/singularity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
8 changes: 3 additions & 5 deletions spython/main/pull.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down Expand Up @@ -60,10 +60,8 @@ def pull(
bot.exit("You must provide an image uri, or use client.load() first.")

# Singularity Only supports shub, docker and library pull
if not re.search("^(shub|docker|library|https)://", image):
bot.exit(
"pull only valid for docker, https, shub and library. Use sregistry client."
)
if not re.search("^(shub|docker|library|https|oras)://", image):
bot.exit("pull only valid for docker, oras, https, shub and library.")

# If we still don't have a custom name, base off of image uri.
if name is None:
Expand Down
2 changes: 1 addition & 1 deletion spython/oci/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/oci/cmd/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/oci/cmd/actions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/oci/cmd/mounts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2019-2021 Vanessa Sochat.
# Copyright (C) 2019-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/oci/cmd/states.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
8 changes: 8 additions & 0 deletions spython/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ def test_data(installdir): # pylint: disable=redefined-outer-name
}


@pytest.fixture(scope="session")
def oras_container(tmp_path_factory):
folder = tmp_path_factory.mktemp("oras-img")
return folder, Client.pull(
"oras://ghcr.io/singularityhub/github-ci:latest", pull_folder=str(folder)
)


@pytest.fixture(scope="session")
def docker_container(tmp_path_factory):
folder = tmp_path_factory.mktemp("docker-img")
Expand Down
2 changes: 1 addition & 1 deletion spython/tests/test_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
12 changes: 9 additions & 3 deletions spython/tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down Expand Up @@ -35,8 +35,14 @@ def test_export():
def test_docker_pull(docker_container):
tmp_path, container = docker_container
print(container)
ext = "sif" if Client.version_info().major >= 3 else "simg"
assert container == str(tmp_path / ("busybox:1.30.1." + ext))
assert container == str(tmp_path / ("busybox:1.30.1.sif"))
assert os.path.exists(container)


def test_oras_pull(oras_container):
tmp_path, container = oras_container
print(container)
assert container == str(tmp_path / ("github-ci:latest.sif"))
assert os.path.exists(container)


Expand Down
2 changes: 1 addition & 1 deletion spython/tests/test_conversion.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
2 changes: 1 addition & 1 deletion spython/tests/test_instances.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# Copyright (C) 2017-2021 Vanessa Sochat.
# Copyright (C) 2017-2022 Vanessa Sochat.

# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
Expand Down
Loading