Bug 274101 - devel/py-pipdeptree: update to 2.13.0
Summary: devel/py-pipdeptree: update to 2.13.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Muhammad Moinur Rahman
URL: https://github.com/tox-dev/pipdeptree...
Keywords: needs-patch
Depends on:
Blocks:
 
Reported: 2023-09-26 07:46 UTC by Vedran Miletic
Modified: 2023-11-03 11:35 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (bofh)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vedran Miletic 2023-09-26 07:46:37 UTC
The latest stable upstream version is 2.13.0 and the current version in Ports is 0.13.2 (note the interesting reversal of the version numbers between the two).

The version 0.13.2 installed from Ports fails with the latest pip, also from Ports:

% pipdeptree
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pipdeptree.py", line 17, in <module>
from pip._internal.utils.misc import get_installed_distributions
ImportError: cannot import name 'get_installed_distributions' from 'pip._internal.utils.misc' (/usr/local/lib/python3.9/site-packages/pip/_internal/utils/misc.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/pipdeptree", line 33, in <module>
sys.exit(load_entry_point('pipdeptree==0.13.2', 'console_scripts', 'pipdeptree')())
File "/usr/local/bin/pipdeptree", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/local/lib/python3.9/importlib/metadata.py", line 86, in load
module = import_module(match.group('module'))
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/usr/local/lib/python3.9/site-packages/pipdeptree.py", line 20, in <module>
from pip import get_installed_distributions, FrozenRequirement
ImportError: cannot import name 'get_installed_distributions' from 'pip' (/usr/local/lib/python3.9/site-packages/pip/__init__.py)

This was fixed upstream more than a year ago: https://github.com/tox-dev/pipdeptree/issues/155
Comment 2 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2023-10-01 18:28:21 UTC
I am not sure why portscout never catch it. I will push an update on my next batch of commit.
Comment 3 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2023-10-02 19:38:06 UTC
Committed at:
https://cgit.FreeBSD.org/ports/commit/?id=a63c06a95f86146ea17dc6bac40da59a47c16b4c
Comment 4 Vedran Miletic 2023-10-13 10:19:32 UTC
I installed the latest version:

% pkg info py39-pipdeptree
py39-pipdeptree-2.13.0
Name           : py39-pipdeptree
Version        : 2.13.0
Installed on   : Wed Oct 11 08:29:48 2023 CEST
Origin         : devel/py-pipdeptree
Architecture   : FreeBSD:14:*
Prefix         : /usr/local
Categories     : python devel
Licenses       : MIT
Maintainer     : bofh@FreeBSD.org
WWW            : https://github.com/naiquevin/pipdeptree
Comment        : Command line utility to show dependency tree of packages
Annotations    :
flavor         : py39
repo_type      : binary
repository     : FreeBSD
Flat size      : 156KiB
Description    :
pipdeptree is a command line utility for displaying the installed python
packages in form of a dependency tree. It works for packages installed globally
on a machine as well as in a virtualenv.

But it fails to run with ImportError:

% pipdeptree
Traceback (most recent call last):
File "/usr/local/bin/pipdeptree", line 5, in <module>
from pipdeptree.__main__ import main
File "/usr/local/lib/python3.9/site-packages/pipdeptree/__main__.py", line 6, in <module>
from pipdeptree._cli import get_options
File "/usr/local/lib/python3.9/site-packages/pipdeptree/_cli.py", line 7, in <module>
from .version import __version__
ImportError: cannot import name '__version__' from 'pipdeptree.version' (/usr/local/lib/python3.9/site-packages/pipdeptree/version.py)

Any ideas why?
Comment 5 Vedran Miletic 2023-10-18 18:09:13 UTC
Reopening per comment #4.
Comment 6 commit-hook freebsd_committer freebsd_triage 2023-10-18 21:16:38 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=935065c7f7b49fc512df152f12859fcdd3ba476d

commit 935065c7f7b49fc512df152f12859fcdd3ba476d
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2023-10-18 20:47:30 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-10-18 21:15:32 +0000

    devel/py-pipdeptree: Fix runtime

    At runtime the program crashes due to an error like the following:
    ImportError: cannot import name '__version__' from 'pipdeptree.version'

    Which is caused due to the new template format of the setuptools_scm.
    Currently this is just a dirty hack to support older(<7) setuptools_scm
    format.

    PR:             274101
    Reported by:    vedran@miletic.net

 devel/py-pipdeptree/Makefile | 5 +++++
 1 file changed, 5 insertions(+)
Comment 7 Vedran Miletic 2023-11-03 11:35:42 UTC
Works great, thank you!