Skip to content

Deplint cannot handle version string with '--no-binary' #2

@izikeros

Description

@izikeros

I'm using deplint 0.0.3 and I have virtual env with psycopg2-binary==2.7.4 installed. When running deplint upgrade InvalidVersion exception is raised since `'2.7.4 --no-binary psycopg2' is not recognized as valid string with version.

The full traceback is here:
Traceback (most recent call last):
  File "/home/izik/src/wx/venv/bin/deplint", line 241, in <module>
    exit_code = linter.run()
  File "/home/izik/src/wx/venv/bin/deplint", line 151, in run
    advice_lists = self.analyze_upgrade()
  File "/home/izik/src/wx/venv/bin/deplint", line 96, in analyze_upgrade
    advice_list = analyzer.analyze()
  File "/home/izik/src/wx/venv/lib/python3.6/site-packages/deplint/analyzers/can_be_upgraded.py", line 24, in analyze
    pkg_release = pkg_releases.get_more_recent_than_requirement(pkg_req)
  File "/home/izik/src/wx/venv/lib/python3.6/site-packages/deplint/model/package_releases.py", line 55, in get_more_recent_than_requirement
    requirement_version = Version(package_requirement.version)
  File "/home/izik/src/wx/venv/lib/python3.6/site-packages/packaging/version.py", line 227, in __init__
    raise InvalidVersion("Invalid version: '{0}'".format(version))
packaging.version.InvalidVersion: Invalid version: '2.7.4 --no-binary psycopg2'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions