Bug 263639 - devel/py-platformdirs: Fails to run after 2.5.2 update: ModuleNotFoundError: No module named 'platformdirs' (breaks consumer: devel/pylint (at least))
Summary: devel/py-platformdirs: Fails to run after 2.5.2 update: ModuleNotFoundError: ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Craig Leres
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2022-04-28 21:43 UTC by Craig Leres
Modified: 2022-04-28 22:44 UTC (History)
1 user (show)

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


Attachments
patch (759 bytes, text/plain)
2022-04-28 21:43 UTC, Craig Leres
koobs: maintainer-approval+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Leres freebsd_committer freebsd_triage 2022-04-28 21:43:19 UTC
The upgrade of py-platformdirs to 2.5.2 breaks pylint (and most certainly anything else that uses the module):

    lns 57 % pylint [...] lblcache.py
    [...]
        from pylint import utils
      File "/usr/local/lib/python3.9/site-packages/pylint/utils/__init__.py", line 10, in <module>
        from pylint.utils.docs import print_full_documentation
      File "/usr/local/lib/python3.9/site-packages/pylint/utils/docs.py", line 10, in <module>
        from pylint.constants import MAIN_CHECKER_NAME
      File "/usr/local/lib/python3.9/site-packages/pylint/constants.py", line 10, in <module>
        import platformdirs
    ModuleNotFoundError: No module named 'platformdirs'

Downgrading to 2.5.1 fixes this.

The problem appears to be that the platformdirs module installs in:

    /usr/local/lib/python3.9/site-packages/src/platformdirs 

(Note extra /src/ in the path.) Apparently 2.5.2 does not include setup.py so the port now supplies one but it needs the tweak described here to adjust for the "src" subdir in the distribution:

    https://stackoverflow.com/a/36012825/2994620

The attached patch implements this change.
Comment 1 Craig Leres freebsd_committer freebsd_triage 2022-04-28 21:43:48 UTC
Created attachment 233568 [details]
patch
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2022-04-28 22:31:47 UTC
@Craig Thanks for the report. Please commit (and merge if quarterly is affected) if it has been otherwise QA'd
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2022-04-28 22:32:34 UTC
Comment on attachment 233568 [details]
patch

Approved by: portmgr (blanket: runtime bugfix)
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-04-28 22:42:55 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=24c7573559e508cc0fa0746cf5d4e213cc79d127

commit 24c7573559e508cc0fa0746cf5d4e213cc79d127
Author:     Craig Leres <leres@FreeBSD.org>
AuthorDate: 2022-04-28 22:41:36 +0000
Commit:     Craig Leres <leres@FreeBSD.org>
CommitDate: 2022-04-28 22:41:36 +0000

    devel/py-platformdirs: Unbreak after 2.5.2 update

    The upgrade of py-platformdirs to 2.5.2 breaks pylint (and most
    certainly anything else that uses the module):

        lns 57 % pylint [...] lblcache.py
        [...]
        ModuleNotFoundError: No module named 'platformdirs'

    Apply the tweak described here to adjust for the "src" subdir in
    the distribution:

        https://stackoverflow.com/a/36012825/2994620

    PR:             263639
    Approved by:    koobs (portmgr blanket: runtime bugfix)

 devel/py-platformdirs/Makefile       | 1 +
 devel/py-platformdirs/files/setup.py | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)
Comment 5 Craig Leres freebsd_committer freebsd_triage 2022-04-28 22:44:59 UTC
2.5.2 was committed on April 28th so I don't think this impacts the quarterly.