Skip to content

Commit c19a33d

Browse files
authored
adding pyflakes to check for unused imports and issues (#166)
* adding pyflakes to check for unused imports and issues Signed-off-by: vsoch <[email protected]>
1 parent 5287bbe commit c19a33d

File tree

9 files changed

+13
-14
lines changed

9 files changed

+13
-14
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@ jobs:
1111
formatting:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v1
14+
- uses: actions/checkout@v2
1515

1616
- name: Setup black linter
17-
run: conda create --quiet --name black black
17+
run: conda create --quiet --name black black pyflakes
1818

19-
- name: Lint python code
19+
- name: Lint python code with black
2020
run: |
2121
export PATH="/usr/share/miniconda/bin:$PATH"
2222
source activate black
2323
black --check spython
24+
25+
- name: Check unused imports with pyflakes
26+
run: |
27+
export PATH="/usr/share/miniconda/bin:$PATH"
28+
source activate black
29+
pyflakes spython/oci spython/image spython/instance spython/main

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to
1717
singularity on pypi), and the versions here will coincide with these releases.
1818

1919
## [master](https://github.com/singularityhub/singularity-cli/tree/master)
20+
- Small bugfix for docker writer and adding pyflakes for unused imports (0.0.84)
2021
- Adding support for multistage build parsing (0.0.83)
2122
- Singularity Python does not yet support multistage builds (0.0.82)
2223
- stream command should print to stdout given CalledProcessError (0.0.81)

spython/image/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import hashlib
88
import os
9-
import re
109
from spython.logger import bot
1110
from spython.utils import split_uri
1211

spython/instance/cmd/logs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def _logs(self, print_logs=False, ext="out"):
4141
"""A shared function to print log files. The only differing element is
4242
the extension (err or out)
4343
"""
44-
from spython.utils import check_install, run_command
44+
from spython.utils import check_install
4545

4646
check_install()
4747

spython/main/base/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
from .logger import println, init_level
1919
from .generate import RobotNamer
2020

21-
import json
22-
import sys
23-
import os
24-
import re
25-
2621

2722
class Client:
2823
def __str__(self):

spython/main/parse/parsers/docker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
from spython.logger import bot
1212
from .base import ParserBase
13-
from ..recipe import Recipe
1413

1514

1615
class DockerParser(ParserBase):

spython/main/parse/writers/docker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def validate_stage(self, parser):
7676
uri_regexes = [_reduced_uri, _default_uri, _docker_uri]
7777

7878
for r in uri_regexes:
79-
match = r.match(parse.fromHeader)
79+
match = r.match(parser.fromHeader)
8080
if match:
8181
break
8282

spython/oci/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from spython.image import ImageBase
88
from spython.logger import bot
9-
import os
109

1110

1211
class OciImage(ImageBase):

spython/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
66

77

8-
__version__ = "0.0.83"
8+
__version__ = "0.0.84"
99
AUTHOR = "Vanessa Sochat"
1010
AUTHOR_EMAIL = "[email protected]"
1111
NAME = "spython"

0 commit comments

Comments
 (0)