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
23 changes: 23 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: spython-ci

on:
push:
branches:
- master
pull_request:
branches_ignore: []

jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Setup black linter
run: conda create --quiet --name black black

- name: Lint python code
run: |
export PATH="/usr/share/miniconda/bin:$PATH"
source activate black
black --check spython
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)
- export lines aren't ignored from environment, but replaced (0.0.75)
- instance logging functions for Singularity 3.5 and up (0.0.74)
- add sudo_options option to spython.main.Client.build (0.0.73)
- list of options and writable added to shell, execute, and run (0.0.72)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Singularity Python

[![Build Status](https://travis-ci.org/singularityhub/singularity-cli.svg?branch=master)](https://travis-ci.org/singularityhub/singularity-cli)
[![GitHub actions status](https://github.com/singularityhub/singularity-cli/workflows/spython-ci/badge.svg?branch=master)](https://github.com/singularityhub/singularity-cli/actions?query=branch%3Amaster+workflow%3Aspython-ci)

Singularity Python (spython) is the Python API for working with <a href="sylabs.io/guides/latest/user-guide/" target="_blank">Singularity</a> containers. See
the [documentation](https://singularityhub.github.io/singularity-cli) for installation and usage, and
Expand Down
4 changes: 2 additions & 2 deletions spython/main/parse/parsers/singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ def _test(self, lines):

def _env(self, lines):
"""env will parse a list of environment lines and simply remove any
blank lines, or those with export. Dockerfiles don't usually
blank lines, and exports. Dockerfiles don't usually
have exports.

Parameters
==========
lines: A list of environment pair lines.

"""
environ = [x for x in lines if not x.startswith("export")]
environ = [re.sub("^export", "", x).strip() for x in lines if "=" in x]
self.recipe.environ += environ

# Files for container
Expand Down
13 changes: 0 additions & 13 deletions spython/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,6 @@ def test_export():
shutil.rmtree(created_sandbox)


def test_pull_and_run(tmp_path):
pass
image = Client.pull("shub://vsoch/singularity-images", pull_folder=str(tmp_path))
print(image)
assert os.path.exists(image)
ext = "sif" if Client.version_info().major >= 3 else "simg"
assert image == str(tmp_path / ("singularity-images." + ext))

result = Client.run(image)
print(result)
assert "You say please, but all I see is pizza.." in result


def test_docker_pull(docker_container):
tmp_path, container = docker_container
print(container)
Expand Down
2 changes: 1 addition & 1 deletion spython/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


__version__ = "0.0.74"
__version__ = "0.0.75"
AUTHOR = "Vanessa Sochat"
AUTHOR_EMAIL = "vsochat@stanford.edu"
NAME = "spython"
Expand Down