public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Maxwell G <maxwell@gtmx.me>
To: git-commits@fedoraproject.org
Subject: [rpms/scancode-toolkit] rawhide: Fix pluggy 1.7.0 compatibility
Date: Tue, 03 Nov 2026 23:18:10 GMT	[thread overview]
Message-ID: <179374789071.1.3849350678463464291.rpms-scancode-toolkit-97c6b4755abb@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/scancode-toolkit
Branch : rawhide
Commit : 97c6b4755abb2b650a2ccaf11d4009d7856de4c2
Author : Maxwell G <maxwell@gtmx.me>
Date   : 2026-11-03T17:17:52-06:00
Stats  : +98/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/scancode-toolkit/c/97c6b4755abb2b650a2ccaf11d4009d7856de4c2?branch=rawhide

Log:
Fix pluggy 1.7.0 compatibility

---
diff --git a/0001-Remove-duplicate-plugincode-plugin-manager-class.patch b/0001-Remove-duplicate-plugincode-plugin-manager-class.patch
new file mode 100644
index 0000000..fcb01e1
--- /dev/null
+++ b/0001-Remove-duplicate-plugincode-plugin-manager-class.patch
@@ -0,0 +1,95 @@
+From bbe00d867e5dbbd1e9c57df26f7ad2298f79b15e Mon Sep 17 00:00:00 2001
+From: Maxwell G <maxwell@gtmx.me>
+Date: Tue, 3 Nov 2026 16:09:15 -0600
+Subject: [PATCH] Remove duplicate plugincode plugin manager class
+
+Both classes are broken by recent changes in pluggy, and it would be
+easier to only fix the code in one place.
+---
+ .../additional_license_location_provider.py   | 60 +------------------
+ 1 file changed, 2 insertions(+), 58 deletions(-)
+
+diff --git a/src/licensedcode/additional_license_location_provider.py b/src/licensedcode/additional_license_location_provider.py
+index 778958cbdd..bfd2aa1753 100644
+--- a/src/licensedcode/additional_license_location_provider.py
++++ b/src/licensedcode/additional_license_location_provider.py
+@@ -7,12 +7,10 @@
+ 
+ import logging
+ import os
+-import sys
+-
+-from pluggy import PluginManager as PluggyPluginManager
+ 
+ from plugincode import HookimplMarker
+ from plugincode import HookspecMarker
++from plugincode.location_provider import SimplePluginManager
+ 
+ """
+ Support for plugins that provide one or more paths keys typically OS-specific
+@@ -63,61 +61,7 @@ class AdditionalLicenseLocationProviderPlugin(object):
+         raise NotImplementedError
+ 
+ 
+-class AdditionalLicensePluginManager(object):
+-    """
+-    A PluginManager class for simple, non-scanning related plugins.
+-    """
+-
+-    def __init__(self, project_name, entrypoint, plugin_base_class):
+-        """
+-        Initialize this plugin manager for the fully qualified Python module
+-        name `module_qname` with plugins loaded from the setuptools `entrypoint`
+-        that must subclass `plugin_base_class`.
+-        """
+-        self.manager = PluggyPluginManager(project_name=project_name)
+-        self.entrypoint = entrypoint
+-        self.plugin_base_class = plugin_base_class
+-        self.manager.add_hookspecs(sys.modules[project_name])
+-
+-        # set to True once this manager is initialized by running its setup()
+-        self.initialized = False
+-
+-        # mapping of {plugin.name: plugin_class} for all the loaded plugins of
+-        # this manager
+-        self.plugin_classes = dict()
+-
+-    def setup(self):
+-        """
+-        Load and validate available plugins for this PluginManager from its
+-        assigned `entrypoint`. Raise an Exception if a plugin is not valid such
+-        that when it does not subcclass the manager `plugin_base_class`.
+-        Must be called once to initialize the plugins if this manager.
+-        Return a list of all plugin classes for this manager.
+-        """
+-        if self.initialized:
+-            return self.plugin_classes.values()
+-
+-        entrypoint = self.entrypoint
+-        self.manager.load_setuptools_entrypoints(entrypoint)
+-
+-        plugin_classes = []
+-        for name, plugin_class in self.manager.list_name_plugin():
+-            if not issubclass(plugin_class, self.plugin_base_class):
+-                plugin_base_class = self.plugin_base_class
+-                raise Exception(
+-                    "Invalid plugin: %(name)r: %(plugin_class)r "
+-                    "must extend %(plugin_base_class)r." % locals()
+-                )
+-
+-            plugin_class.name = name
+-            plugin_classes.append(plugin_class)
+-
+-        self.plugin_classes = dict([(cls.name, cls) for cls in plugin_classes])
+-        self.initialized = True
+-        return self.plugin_classes.values()
+-
+-
+-additional_license_location_provider_plugins = AdditionalLicensePluginManager(
++additional_license_location_provider_plugins = SimplePluginManager(
+     project_name=project_name, entrypoint=entrypoint, plugin_base_class=AdditionalLicenseLocationProviderPlugin
+ )
+ 
+-- 
+2.56.0
+

diff --git a/scancode-toolkit.spec b/scancode-toolkit.spec
index 740f4b4..69c723c 100644
--- a/scancode-toolkit.spec
+++ b/scancode-toolkit.spec
@@ -24,6 +24,9 @@ Patch:          0002-Replace-pkginfo2-with-pkginfo.patch
 # Make 'no such option' assertion tolerant of newer click error format
 # https://github.com/aboutcode-org/scancode-toolkit/commit/a1c6435375866ae2fead2df2c967f2ba150f18e9
 Patch:          https://github.com/aboutcode-org/scancode-toolkit/commit/a1c6435375866ae2fead2df2c967f2ba150f18e9.patch
+# https://github.com/aboutcode-org/scancode-toolkit/issues/5363
+# https://github.com/aboutcode-org/scancode-toolkit/issues/5367
+Patch:          0001-Remove-duplicate-plugincode-plugin-manager-class.patch
 
 # scancode has dependencies that are not compatible with ix86
 ExcludeArch:    %{ix86}

                 reply	other threads:[~2026-11-03 23:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179374789071.1.3849350678463464291.rpms-scancode-toolkit-97c6b4755abb@fedoraproject.org \
    --to=maxwell@gtmx.me \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox