Skip to content

Commit b272589

Browse files
committed
Lint with pyflakes
1 parent 118ec32 commit b272589

File tree

5 files changed

+16
-20
lines changed

5 files changed

+16
-20
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ jobs:
3535
pip install -e .
3636
- name: Install pytest
3737
run: |
38-
mamba install -c conda-forge pytest black
38+
mamba install -c conda-forge black pyflakes pytest
3939
- name: Test with pytest
4040
run: |
4141
pytest
42-
- name: Lint with black
42+
- name: Lint with pyflakes and black
43+
shell: bash
4344
run: |
45+
pyflakes jgo/*.py
4446
black --check .

jgo/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,11 @@
44
maven_scijava_repository,
55
add_jvm_args_as_necessary,
66
)
7+
8+
__all__ = (
9+
"add_jvm_args_as_necessary",
10+
"main_from_endpoint",
11+
"main",
12+
"maven_scijava_repository",
13+
"resolve_dependencies",
14+
)

jgo/jgo.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import shutil
99
import subprocess
1010
import sys
11-
import traceback
1211
import zipfile
1312
import hashlib
1413

@@ -216,7 +215,7 @@ def link(source, link_name, link_type="auto"):
216215
raise e
217216
try:
218217
return link(source=source, link_name=link_name, link_type="soft")
219-
except OSError as e:
218+
except OSError:
220219
pass
221220

222221
return link(source=source, link_name=link_name, link_type="copy")
@@ -233,17 +232,6 @@ def m2_path():
233232
return os.getenv("M2_REPO", (pathlib.Path.home() / ".m2").absolute())
234233

235234

236-
def expand(string, **shortcuts):
237-
238-
for (k, v) in shortcuts.items():
239-
if string in k:
240-
return "{}{}".format(
241-
v,
242-
)
243-
244-
return string
245-
246-
247235
def launch_java(
248236
jar_dir,
249237
jvm_args,
@@ -706,8 +694,8 @@ def resolve_dependencies(
706694
jar_file_in_workspace,
707695
link_type=link_type,
708696
)
709-
except FileExistsError as e:
710-
# Do not throw exceptionif target file exists.
697+
except FileExistsError:
698+
# Do not throw exception if target file exists.
711699
pass
712700
pathlib.Path(build_success_file).touch(exist_ok=True)
713701
return primary_endpoint, workspace

tests/test_managed.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import glob
22
from jgo.jgo import InvalidEndpoint
33
import jgo
4-
import re
54
import os
65
import pathlib
76
import unittest
@@ -87,7 +86,7 @@ def test_managed_primary(self):
8786
tmp_dir = tempfile.mkdtemp(prefix="jgo-test-cache-dir")
8887
m2_repo = os.path.join(str(pathlib.Path.home()), ".m2", "repository")
8988
try:
90-
with self.assertRaises(InvalidEndpoint) as context:
89+
with self.assertRaises(InvalidEndpoint):
9190
resolve_managed(
9291
MANAGED_PRIMARY_ENDPOINT, cache_dir=tmp_dir, m2_repo=m2_repo
9392
)

tests/test_parsington.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import glob
2-
import io
32
import jgo
43
import os
54
import pathlib

0 commit comments

Comments
 (0)