diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5cb6b75b..c96933f0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,13 +11,19 @@ jobs: formatting: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Setup black linter - run: conda create --quiet --name black black + run: conda create --quiet --name black black pyflakes - - name: Lint python code + - name: Lint python code with black run: | export PATH="/usr/share/miniconda/bin:$PATH" source activate black black --check spython + + - name: Check unused imports with pyflakes + run: | + export PATH="/usr/share/miniconda/bin:$PATH" + source activate black + pyflakes spython/oci spython/image spython/instance spython/main diff --git a/CHANGELOG.md b/CHANGELOG.md index c4d49d28..91fbad0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) + - Small bugfix for docker writer and adding pyflakes for unused imports (0.0.84) - Adding support for multistage build parsing (0.0.83) - Singularity Python does not yet support multistage builds (0.0.82) - stream command should print to stdout given CalledProcessError (0.0.81) diff --git a/spython/image/__init__.py b/spython/image/__init__.py index 28c25612..ac68b60e 100644 --- a/spython/image/__init__.py +++ b/spython/image/__init__.py @@ -6,7 +6,6 @@ import hashlib import os -import re from spython.logger import bot from spython.utils import split_uri diff --git a/spython/instance/cmd/logs.py b/spython/instance/cmd/logs.py index 58a0349b..2f005577 100644 --- a/spython/instance/cmd/logs.py +++ b/spython/instance/cmd/logs.py @@ -41,7 +41,7 @@ def _logs(self, print_logs=False, ext="out"): """A shared function to print log files. The only differing element is the extension (err or out) """ - from spython.utils import check_install, run_command + from spython.utils import check_install check_install() diff --git a/spython/main/base/__init__.py b/spython/main/base/__init__.py index e6ee3907..679ded74 100644 --- a/spython/main/base/__init__.py +++ b/spython/main/base/__init__.py @@ -18,11 +18,6 @@ from .logger import println, init_level from .generate import RobotNamer -import json -import sys -import os -import re - class Client: def __str__(self): diff --git a/spython/main/parse/parsers/docker.py b/spython/main/parse/parsers/docker.py index 6b76bd8b..38c2f473 100644 --- a/spython/main/parse/parsers/docker.py +++ b/spython/main/parse/parsers/docker.py @@ -10,7 +10,6 @@ from spython.logger import bot from .base import ParserBase -from ..recipe import Recipe class DockerParser(ParserBase): diff --git a/spython/main/parse/writers/docker.py b/spython/main/parse/writers/docker.py index e4f8c2a4..de0429a2 100644 --- a/spython/main/parse/writers/docker.py +++ b/spython/main/parse/writers/docker.py @@ -76,7 +76,7 @@ def validate_stage(self, parser): uri_regexes = [_reduced_uri, _default_uri, _docker_uri] for r in uri_regexes: - match = r.match(parse.fromHeader) + match = r.match(parser.fromHeader) if match: break diff --git a/spython/oci/__init__.py b/spython/oci/__init__.py index b33812c8..b464ddce 100644 --- a/spython/oci/__init__.py +++ b/spython/oci/__init__.py @@ -6,7 +6,6 @@ from spython.image import ImageBase from spython.logger import bot -import os class OciImage(ImageBase): diff --git a/spython/version.py b/spython/version.py index 2fdb0858..4d9d0dbb 100644 --- a/spython/version.py +++ b/spython/version.py @@ -5,7 +5,7 @@ # with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -__version__ = "0.0.83" +__version__ = "0.0.84" AUTHOR = "Vanessa Sochat" AUTHOR_EMAIL = "vsochat@stanford.edu" NAME = "spython"