Bug 270608 - devel/py-stevedore: Fails with python 3.7
Summary: devel/py-stevedore: Fails with python 3.7
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: Nicola Vitale
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-02 20:50 UTC by Jonathan Chen
Modified: 2023-04-04 09:40 UTC (History)
0 users

See Also:
nivit: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Chen 2023-04-02 20:50:55 UTC
When running with < python 3.8 flavor, eg: py37-stevedore, a load eventually fails with:

...
  File "/usr/local/lib/python3.7/site-packages/stevedore/extension.py", line 19, in <module>
    from . import _cache
  File "/usr/local/lib/python3.7/site-packages/stevedore/_cache.py", line 18, in <module>
    import importlib.metadata as importlib_metadata
ModuleNotFoundError: No module named 'importlib.metadata'

The code line in _cache.py has:

import importlib.metadata as importlib_metadata

But in python versions before 3.8, importlib.metadata is stored under importlib_metadata.

Changing the line to read:

import importlib_metadata

fixes the problem.

I think a conditional patch depending on flavor is required for the port.
Comment 1 Nicola Vitale freebsd_committer freebsd_triage 2023-04-03 08:59:05 UTC
Hi, the support for Python 3.7 expires on 2023-06-27 (see https://cgit.freebsd.org/ports/tree/lang/python37/Makefile#n16 ), while stevedore dropped it with version 4.1.1. I can only add a temporary patch until that date.
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-04-03 15:23:07 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0780a2be805d9d57d0e395ab62eceac005940bf4

commit 0780a2be805d9d57d0e395ab62eceac005940bf4
Author:     Nicola Vitale <nivit@FreeBSD.org>
AuthorDate: 2023-04-03 15:16:49 +0000
Commit:     Nicola Vitale <nivit@FreeBSD.org>
CommitDate: 2023-04-03 15:16:49 +0000

    devel/py-stevedore: Update to 5.0.0

    - Add a set of patches for supporting Python 3.7 until 2023-06-27
      when lang/python37 expires.  [1]
      Those patches are taken from:

      https ://opendev.org/openstack/stevedore/commit/ccd17543a37143913e886f9306be10d40260fdf3

    PR:             270608
    Reported by:    Jonathan Chen <jonc@chen.org.nz>  [1]

 devel/py-stevedore/Makefile                        |  4 ++--
 devel/py-stevedore/distinfo                        |  6 +++---
 .../files/patch-stevedore___cache.py (new)         | 25 ++++++++++++++++++++++
 .../patch-stevedore_tests_test__driver.py (new)    | 18 ++++++++++++++++
 .../patch-stevedore_tests_test__extension.py (new) | 21 ++++++++++++++++++
 .../patch-stevedore_tests_test__sphinxext.py (new) | 18 ++++++++++++++++
 6 files changed, 87 insertions(+), 5 deletions(-)
Comment 3 Jonathan Chen 2023-04-03 20:03:57 UTC
Thanks for this!

Yes, I know that python 3.7 is out of date, but unfortunately I'm required to use it to support legacy systems :(
Comment 4 Nicola Vitale freebsd_committer freebsd_triage 2023-04-04 09:40:58 UTC
Thank you for the PR!