Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packvers-imports-instead-of-packaging #14

Closed
wants to merge 3 commits into from

Conversation

swastkk
Copy link
Contributor

@swastkk swastkk commented Jan 4, 2023

@swastkk
Copy link
Contributor Author

swastkk commented Jan 4, 2023

@pombredanne please have a look :")

@swastkk
Copy link
Contributor Author

swastkk commented Jan 4, 2023

After running pytest - getting this errors

============================================================================= warnings summary =============================================================================
tests/test_pip_api_parse_requirements.py: 1 warning
tests/test_requirements_parser.py: 1 warning
tests/pip_requirements_parser_tests/test_requirements_file.py: 8 warnings
  /home/swastik/Desktop/pip-requirements-parser/venv/lib/python3.10/site-packages/packvers/specifiers.py:255: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release
    warnings.warn(

tests/test_requirements_parser.py::test_RequirementsFile_to_dict[/home/swastik/Desktop/pip-requirements-parser/tests/requirements_parser_reqfiles/fail_1.txt]
tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_to_dict[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/more-requirements/nikdoof-test-auth-requirements.txt]
tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_to_dict[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/more-requirements/jacobzweig-RCNN_Toolbox-requirements.txt]
tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_to_dict[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/more-requirements/jacobzweig-RCNN_Toolbox-requirements.txt]
tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_to_dict[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/sc-requirements/invalid_spec-requirements.txt]
tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_dumps_unparse[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/more-requirements/nikdoof-test-auth-requirements.txt]
tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_dumps_unparse[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/sc-requirements/invalid_spec-requirements.txt]
  /home/swastik/Desktop/pip-requirements-parser/venv/lib/python3.10/site-packages/packvers/version.py:111: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= short test summary info ==========================================================================
FAILED tests/test_pip_api_parse_requirements.py::test_parse_requirements_PEP508[test_5082] - AssertionError: assert 0 == 1
FAILED tests/test_requirements_parser.py::test_RequirementsFile_to_dict[/home/swastik/Desktop/pip-requirements-parser/tests/requirements_parser_reqfiles/fail_1.txt] - assert {'comments': ...s': [], ...}]} == {'comments': ...irements': []}
FAILED tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_to_dict[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/requirements/requirement-parser-issues.txt] - assert {'comments': ...], ...}, ...]} == {'comments': ...], ...}, ...]}
FAILED tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_to_dict[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/requirements/pip-docs-examples.txt] - AssertionError: assert {'comments': ...], ...}, ...]} == {'comments': ...], ...}, ...]}
FAILED tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_to_dict[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/more-requirements/nikdoof-test-auth-requirements.txt] - AssertionError: assert {'comments': ...], ...}, ...]} == {'comments': ...], ...}, ...]}
FAILED tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_to_dict[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/more-requirements/jacobzweig-RCNN_Toolbox-requirements.txt] - AssertionError: assert {'comments': ...], ...}, ...]} == {'comments': ...], ...}, ...]}
FAILED tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_to_dict[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/sc-requirements/invalid_spec-requirements.txt] - assert {'comments': ...s': [], ...}]} == {'comments': ...irements': []}
FAILED tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_dumps_unparse[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/requirements/requirement-parser-issues.txt] - assert '# from https...sion >= "3"\n' == '# from https...sion >= "3"\n'
FAILED tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_dumps_unparse[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/requirements/pip-docs-examples.txt] - assert '# examples f...omePackage1\n' == '# examples f...omePackage1\n'
FAILED tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_dumps_unparse[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/more-requirements/nikdoof-test-auth-requirements.txt] - AssertionError: assert 'xmlrpclib\nx...aven>=2.0.3\n' == 'xmlrpclib\nx...aven>=2.0.3\n'
FAILED tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_dumps_unparse[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/more-requirements/jacobzweig-RCNN_Toolbox-requirements.txt] - AssertionError: assert '#\n# This fi...late==0.7.5\n' == '#\n# This fi...late==0.7.5\n'
FAILED tests/pip_requirements_parser_tests/test_requirements_file.py::test_RequirementsFile_dumps_unparse[/home/swastik/Desktop/pip-requirements-parser/tests/pip_requirements_parser_tests/data/sc-requirements/invalid_spec-requirements.txt] - assert 'test>>1.2.0\...test=>1.2.0\n' == '# Invalid re...test=>1.2.0\n'
FAILED tests/pip_requirements_parser_tests/unit/test_models_wheel.py::TestWheelFile::test_supported_single_version - assert False
FAILED tests/pip_requirements_parser_tests/unit/test_models_wheel.py::TestWheelFile::test_supported_multi_version - assert False
FAILED tests/pip_requirements_parser_tests/unit/test_models_wheel.py::TestWheelFile::test_supported_osx_version - assert False
FAILED tests/pip_requirements_parser_tests/unit/test_models_wheel.py::TestWheelFile::test_supported_multiarch_darwin - assert False
FAILED tests/pip_requirements_parser_tests/unit/test_models_wheel.py::TestWheelFile::test_support_index_min - ValueError: min() arg is an empty sequence
FAILED tests/pip_requirements_parser_tests/unit/test_req.py::TestInstallRequirement::test_wheel_requirement_sets_req_attribute - AssertionError: assert False
FAILED tests/pip_requirements_parser_tests/unit/test_req_file.py::TestParseRequirements::test_install_requirements_with_options - AssertionError: assert <SpecifierSet('==2.0')> == <SpecifierSet('==2.0')>
FAILED tests/pip_requirements_parser_tests/unit/test_req_install.py::TestInstallRequirementFrom::test_install_req_from_string_without_requirement_line - AssertionError: <Requirement('torch@ https://download.pytorch.org/whl/cu90/torch-1.0.0-cp36-cp36m-win_amd64.whl')>
FAILED tests/pip_requirements_parser_tests/unit/test_req_install.py::TestInstallRequirementFrom::test_install_req_from_string_with_requirement_line_without_link - AssertionError: <Requirement('torch@ https://download.pytorch.org/whl/cu90/torch-1.0.0-cp36-cp36m-win_amd64.whl')>
XFAIL tests/test_packvers_legacy_version.py::TestLegacyVersion::test_legacy_version_is_deprecated - We vendored packvers to reinstate LegacyVersion
==================================================== 21 failed, 8249 passed, 5 skipped, 1 xfailed, 17 warnings in 5.99s ====================================================

@pombredanne
Copy link
Member

@swastkk Thanks... but I am not sure I get the benefits?
packvers is a fork of packaging, but here I have already vendored a subset of packaging that deals with LegacyVersion. I am not sure there is a need to further rename this and remove the usage of the standard packaging otherwise.

@swastkk
Copy link
Contributor Author

swastkk commented Jan 5, 2023

@swastkk Thanks... but I am not sure I get the benefits? packvers is a fork of packaging, but here I have already vendored a subset of packaging that deals with LegacyVersion. I am not sure there is a need to further rename this and remove the usage of the standard packaging otherwise.

Actually I want to know why I am getting issues in python-inspector, since it used the package pip-requirments-parse , tests are also failing in that :")

@swastkk swastkk closed this Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants