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

Invalid version: '1.1build1' (package: distro-info) #235

Closed
FallenKhadgar opened this issue May 12, 2023 · 4 comments
Closed

Invalid version: '1.1build1' (package: distro-info) #235

FallenKhadgar opened this issue May 12, 2023 · 4 comments

Comments

@FallenKhadgar
Copy link

$ pipdeptree --version
2.7.1
$ python3 --version
Python 3.10.10
$ uname -a   # Ubuntu 22.04.2 LTS
Linux u 5.15.0-69-generic #76-Ubuntu SMP Fri Mar 17 17:19:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
$ pipdeptree -r   # same result for "pipdeptree -rp distro-info"
Traceback (most recent call last):
  File "/home/u/.local/bin/pipdeptree", line 8, in <module>
    sys.exit(main())
  File "/home/u/.local/lib/python3.10/site-packages/pipdeptree/__init__.py", line 988, in main
    tree = tree.reverse()
  File "/home/u/.local/lib/python3.10/site-packages/pipdeptree/__init__.py", line 406, in reverse
    m[k.as_requirement()] = []
  File "/home/u/.local/lib/python3.10/site-packages/pipdeptree/__init__.py", line 164, in as_requirement
    return ReqPackage(self._obj.as_requirement(), dist=self)
  File "/home/u/.local/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2918, in as_requirement
    if isinstance(self.parsed_version, packaging.version.Version):
  File "/home/u/.local/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2734, in parsed_version
    raise packaging.version.InvalidVersion(f"{str(ex)} {info}") from None
pip._vendor.packaging.version.InvalidVersion: Invalid version: '1.1build1' (package: distro-info)
$ pipdeptree --json-tree -p distro-info
[
    {
        "key": "distro-info",
        "package_name": "distro-info",
        "installed_version": "1.1build1",
        "required_version": "1.1build1",
        "dependencies": []
    }
]

Package: https://launchpad.net/ubuntu/+source/distro-info/1.1build1

@gaborbernat
Copy link
Member

That is an invalid version and not much we can do about it 🤔

@ShadowMitia
Copy link

ShadowMitia commented May 22, 2023

Getting the same issue with devscripts:

Invalid version: '2.22.1ubuntu1' (package: devscripts)

I can't even target specific packages using pipdeptree -r -p <pkg>...

Full traceback:


Traceback (most recent call last):
  File "/home/dbelopopsky/.local/bin/pipdeptree", line 8, in <module>
    sys.exit(main())
  File "/home/dbelopopsky/.local/lib/python3.10/site-packages/pipdeptree/__init__.py", line 988, in main
    tree = tree.reverse()
  File "/home/dbelopopsky/.local/lib/python3.10/site-packages/pipdeptree/__init__.py", line 406, in reverse
    m[k.as_requirement()] = []
  File "/home/dbelopopsky/.local/lib/python3.10/site-packages/pipdeptree/__init__.py", line 164, in as_requirement
    return ReqPackage(self._obj.as_requirement(), dist=self)
  File "/home/dbelopopsky/.local/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2918, in as_requirement
    if isinstance(self.parsed_version, packaging.version.Version):
  File "/home/dbelopopsky/.local/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2734, in parsed_version
    raise packaging.version.InvalidVersion(f"{str(ex)} {info}") from None
pip._vendor.packaging.version.InvalidVersion: Invalid version: '2.22.1ubuntu1' (package: devscripts)

Perhaps packages with an invalid versions could be skipped with a warning?

@gaborbernat
Copy link
Member

Perhaps Ubuntu could use valid python versions instead?

@philippewarren
Copy link

Perhaps Ubuntu could use valid python versions instead?

The progress on this can be tracked here.

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

No branches or pull requests

4 participants