Skip to content

Commit d8e9755

Browse files
authored
Change flake8 github action (#248)
Signed-off-by: jiyeong.seok <[email protected]>
1 parent a136449 commit d8e9755

File tree

11 files changed

+18
-15
lines changed

11 files changed

+18
-15
lines changed

.github/workflows/pull-request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
sudo npm install -g license-checker
3131
- name: Run Tox
3232
run: |
33+
tox -e release_flake8
3334
tox -e run_ubuntu
3435
build_windows:
3536
runs-on: windows-latest

src/fosslight_dependency/package_manager/Cargo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ def get_matched_dependencies(match_id, resolve_node):
132132
try:
133133
match = re.findall(r'^.*#(\S*)@(\S*)', dep_pkg)
134134
dependencies_list.append(f'{match[0][0]}({match[0][1]})')
135-
except:
135+
except Exception:
136136
try:
137137
match = re.findall(r'^(\S*)\s(\S*)\s', dep_pkg)
138138
dependencies_list.append(f'{match[0][0]}({match[0][1]})')
139-
except:
139+
except Exception:
140140
logger.info(f'cannot find name and version for dependencies: {match_id}')
141141
pass
142142
break

tests/pytest/package_manager/test_android.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77
import subprocess
88

9-
DIST_PATH = os.path.join(os.environ.get("TOX_PATH"), "dist", "cli.exe")
9+
DIST_PATH = os.path.join(os.environ.get("TOX_PATH", ""), "dist", "cli.exe")
1010

1111

1212
@pytest.mark.parametrize("input_path, output_path, extra_args", [

tests/pytest/package_manager/test_cargo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77
import subprocess
88

9-
DIST_PATH = os.path.join(os.environ.get("TOX_PATH"), "dist", "cli.exe")
9+
DIST_PATH = os.path.join(os.environ.get("TOX_PATH", ""), "dist", "cli.exe")
1010

1111

1212
@pytest.mark.parametrize("input_path, output_path", [

tests/pytest/package_manager/test_gradle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77
import subprocess
88

9-
DIST_PATH = os.path.join(os.environ.get("TOX_PATH"), "dist", "cli.exe")
9+
DIST_PATH = os.path.join(os.environ.get("TOX_PATH", ""), "dist", "cli.exe")
1010

1111

1212
@pytest.mark.parametrize("input_path, output_path", [

tests/pytest/package_manager/test_maven.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77
import subprocess
88

9-
DIST_PATH = os.path.join(os.environ.get("TOX_PATH"), "dist", "cli.exe")
9+
DIST_PATH = os.path.join(os.environ.get("TOX_PATH", ""), "dist", "cli.exe")
1010

1111

1212
@pytest.mark.parametrize("input_path, output_path", [

tests/pytest/package_manager/test_mod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import subprocess
88

99

10-
DIST_PATH = os.path.join(os.environ.get("TOX_PATH"), "dist", "cli.exe")
10+
DIST_PATH = os.path.join(os.environ.get("TOX_PATH", ""), "dist", "cli.exe")
1111

1212

1313
@pytest.mark.parametrize("input_path, output_path, extra_args", [

tests/pytest/package_manager/test_nuget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"fosslight_dependency -p tests/test_nuget2 -o tests/result/nuget2"
1212
]
1313

14-
DIST_PATH = os.path.join(os.environ.get("TOX_PATH"), "dist", "cli.exe")
14+
DIST_PATH = os.path.join(os.environ.get("TOX_PATH", ""), "dist", "cli.exe")
1515

1616

1717
@pytest.mark.parametrize("input_path, output_path", [

tests/pytest/package_manager/test_pub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77
import subprocess
88

9-
DIST_PATH = os.path.join(os.environ.get("TOX_PATH"), "dist", "cli.exe")
9+
DIST_PATH = os.path.join(os.environ.get("TOX_PATH", ""), "dist", "cli.exe")
1010

1111

1212
@pytest.mark.parametrize("input_path, output_path", [

tests/pytest/package_manager/test_pypi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77
import subprocess
88

9-
DIST_PATH = os.path.join(os.environ.get("TOX_PATH"), "dist", "cli.exe")
9+
DIST_PATH = os.path.join(os.environ.get("TOX_PATH", ""), "dist", "cli.exe")
1010

1111

1212
@pytest.mark.parametrize("input_path, output_path, extra_args", [

tox.ini

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,15 @@ markers =
2323
[flake8]
2424
max-line-length = 130
2525
exclude = .tox/*
26-
ignore = E722, W503
2726

2827
[testenv:test_run]
2928
deps =
3029
-r{toxinidir}/requirements-dev.txt
3130
commands =
3231
# Print Help Message
3332
fosslight_dependency -h
34-
# Print Current Version
35-
fosslight_dependency -v
3633
# Test for PEP8
37-
pytest -v --flake8
34+
pytest -v --flake8 src
3835

3936
[testenv:run_ubuntu]
4037
deps =
@@ -49,4 +46,9 @@ commands =
4946
# Test for making excutable file
5047
pyinstaller --onefile cli.py -n cli --additional-hooks-dir=hooks --add-binary=LICENSE:LICENSES --add-binary=LICENSES\LicenseRef-3rd_party_licenses.txt:LICENSES --collect-datas fosslight_util --hidden-import=_cffi_backend
5148
pytest -m "windows"
52-
pytest -v --flake8
49+
50+
[testenv:release_flake8]
51+
deps =
52+
-r{toxinidir}/requirements-dev.txt
53+
commands =
54+
pytest -v --flake8 src

0 commit comments

Comments
 (0)