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
1 change: 1 addition & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
sudo npm install -g license-checker
- name: Run Tox
run: |
tox -e release_flake8
tox -e run_ubuntu
build_windows:
runs-on: windows-latest
Expand Down
4 changes: 2 additions & 2 deletions src/fosslight_dependency/package_manager/Cargo.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ def get_matched_dependencies(match_id, resolve_node):
try:
match = re.findall(r'^.*#(\S*)@(\S*)', dep_pkg)
dependencies_list.append(f'{match[0][0]}({match[0][1]})')
except:
except Exception:
try:
match = re.findall(r'^(\S*)\s(\S*)\s', dep_pkg)
dependencies_list.append(f'{match[0][0]}({match[0][1]})')
except:
except Exception:
logger.info(f'cannot find name and version for dependencies: {match_id}')
pass
break
Expand Down
2 changes: 1 addition & 1 deletion tests/pytest/package_manager/test_android.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest
import subprocess

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


@pytest.mark.parametrize("input_path, output_path, extra_args", [
Expand Down
2 changes: 1 addition & 1 deletion tests/pytest/package_manager/test_cargo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest
import subprocess

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


@pytest.mark.parametrize("input_path, output_path", [
Expand Down
2 changes: 1 addition & 1 deletion tests/pytest/package_manager/test_gradle.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest
import subprocess

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


@pytest.mark.parametrize("input_path, output_path", [
Expand Down
2 changes: 1 addition & 1 deletion tests/pytest/package_manager/test_maven.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest
import subprocess

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


@pytest.mark.parametrize("input_path, output_path", [
Expand Down
2 changes: 1 addition & 1 deletion tests/pytest/package_manager/test_mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import subprocess


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


@pytest.mark.parametrize("input_path, output_path, extra_args", [
Expand Down
2 changes: 1 addition & 1 deletion tests/pytest/package_manager/test_nuget.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"fosslight_dependency -p tests/test_nuget2 -o tests/result/nuget2"
]

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


@pytest.mark.parametrize("input_path, output_path", [
Expand Down
2 changes: 1 addition & 1 deletion tests/pytest/package_manager/test_pub.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest
import subprocess

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


@pytest.mark.parametrize("input_path, output_path", [
Expand Down
2 changes: 1 addition & 1 deletion tests/pytest/package_manager/test_pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest
import subprocess

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


@pytest.mark.parametrize("input_path, output_path, extra_args", [
Expand Down
12 changes: 7 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,15 @@ markers =
[flake8]
max-line-length = 130
exclude = .tox/*
ignore = E722, W503

[testenv:test_run]
deps =
-r{toxinidir}/requirements-dev.txt
commands =
# Print Help Message
fosslight_dependency -h
# Print Current Version
fosslight_dependency -v
# Test for PEP8
pytest -v --flake8
pytest -v --flake8 src

[testenv:run_ubuntu]
deps =
Expand All @@ -49,4 +46,9 @@ commands =
# Test for making excutable file
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
pytest -m "windows"
pytest -v --flake8

[testenv:release_flake8]
deps =
-r{toxinidir}/requirements-dev.txt
commands =
pytest -v --flake8 src
Loading