aboutcode-org / python-inspector

Inspect Python code and PyPI package manifests. Resolve Python dependencies.
22 stars 19 forks source link

Add ignore_errors flag and update PythonUpdateProvider #157

Closed qequ closed 1 year ago

qequ commented 1 year ago

Add a flag to continue operating when non existang packages happen

Fixes https://github.com/nexB/python-inspector/issues/141

qequ commented 1 year ago

@TG1999 Added tests

TG1999 commented 1 year ago

@qequ DCO is failing, please add your sign-off

qequ commented 1 year ago

@TG1999 signed :+1:

TG1999 commented 1 year ago

@qequ the tests for CI doesn't seem to work can you please check once ?

qequ commented 1 year ago

@TG1999 I ran the tests with pytest -vvs ont he main branch and the branch of this feature and in both the same errors are happening

logs of the errors in both branches

this branch tests

============================================================================================= short test summary info =============================================================================================
FAILED tests/test_cli.py::test_cli_with_single_index_url_except_pypi_simple - assert {'files': [],\n 'headers': {'errors': [],\n             'notice': 'Dependency tree generated with python-inspector.\n'\n   ...
FAILED tests/test_cli.py::test_cli_with_azure_devops_with_python_310 - assert {'files': [{'package_data': [{'api_data_url': None,\n                              'bug_tracking_url': None,\n                    ...
FAILED tests/test_cli.py::test_cli_with_azure_devops_with_python_38 - assert {'files': [{'package_data': [{'api_data_url': None,\n                              'bug_tracking_url': None,\n                     ...
FAILED tests/test_cli.py::test_cli_with_insecure_option_testpkh - assert {'files': [{'package_data': [{'api_data_url': 'https://pypi.org/pypi/testpkh/0.0.1/json',\n                              'bug_tracking_...
FAILED tests/test_codestyle.py::BaseTests::test_codestyle - Exception: ('Code style check failed!', b'-> Run pycodestyle (PEP8) validation\n')
FAILED tests/test_resolution.py::test_get_resolved_dependencies_for_version_containing_local_version_identifier - AssertionError: assert ['pkg:pypi/filelock@3.9.0',\n 'pkg:pypi/jinja2@3.1.2',\n 'pkg:pypi/mark...
============================================================================ 6 failed, 161 passed, 1424 warnings in 292.36s (0:04:52) =============================================================================

main branch tests

============================================================================================= short test summary info =============================================================================================
FAILED tests/test_cli.py::test_cli_with_single_index_url_except_pypi_simple - assert {'files': [],\n 'headers': {'errors': [],\n             'notice': 'Dependency tree generated with python-inspector.\n'\n   ...
FAILED tests/test_cli.py::test_cli_with_azure_devops_with_python_310 - assert {'files': [{'package_data': [{'api_data_url': None,\n                              'bug_tracking_url': None,\n                    ...
FAILED tests/test_cli.py::test_cli_with_azure_devops_with_python_38 - assert {'files': [{'package_data': [{'api_data_url': None,\n                              'bug_tracking_url': None,\n                     ...
FAILED tests/test_cli.py::test_cli_with_insecure_option_testpkh - assert {'files': [{'package_data': [{'api_data_url': 'https://pypi.org/pypi/testpkh/0.0.1/json',\n                              'bug_tracking_...
FAILED tests/test_codestyle.py::BaseTests::test_codestyle - Exception: ('Code style check failed!', b'-> Run pycodestyle (PEP8) validation\n')
FAILED tests/test_resolution.py::test_get_resolved_dependencies_for_version_containing_local_version_identifier - AssertionError: assert ['pkg:pypi/filelock@3.9.0',\n 'pkg:pypi/jinja2@3.1.2',\n 'pkg:pypi/mark...
============================================================================ 6 failed, 160 passed, 1423 warnings in 158.86s (0:02:38) =============================================================================

it seems the main branch makes the tests fail. can you confirm this?

qequ commented 1 year ago

@TG1999 I have updated the expected outputs in tests. Most of failures were due to expected outputs being outdated for online tests like flask

TG1999 commented 1 year ago

@qequ please rebase and resolve conflicts