From 39ca6159b9ac903dc56818918d9f97bc831f0955 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 4 Nov 2023 22:13:37 +0000 Subject: gentoo auto-resync : 04:11:2023 - 22:13:37 --- dev-python/yapsy/Manifest | 4 +- dev-python/yapsy/files/yapsy-1.12.2-py312.patch | 138 ++++++++++++++++++++++++ dev-python/yapsy/metadata.xml | 2 +- dev-python/yapsy/yapsy-1.12.2-r2.ebuild | 34 ++++++ 4 files changed, 176 insertions(+), 2 deletions(-) create mode 100644 dev-python/yapsy/files/yapsy-1.12.2-py312.patch create mode 100644 dev-python/yapsy/yapsy-1.12.2-r2.ebuild (limited to 'dev-python/yapsy') diff --git a/dev-python/yapsy/Manifest b/dev-python/yapsy/Manifest index 60bab23d2787..5732adbee33c 100644 --- a/dev-python/yapsy/Manifest +++ b/dev-python/yapsy/Manifest @@ -1,3 +1,5 @@ +AUX yapsy-1.12.2-py312.patch 4860 BLAKE2B de06e1a4c9d653add9dd79b774d3e9d42e5d2b0bfe201888c432d4596898764e60624859da8d659965750a1a762cc0452d5490a7aab95e02a64002dcae7aa9c9 SHA512 884584625dc602faf2ede7b241c106817f402ddec4892fa4b159ca3205dcd9e00e52f840de1619a3c60dcc45ae8ead25a8798b204c8f1101ca78199d6382eef2 DIST Yapsy-1.12.2.tar.gz 83986 BLAKE2B e6a2650383a7f0c9bf72d4abf21fffb2abcfdc4115a2a1578a2987b7eef1fc04de9099947c1b9dd510d54a89d9b11f86ac0ca3b13510c6417e94ff92dfec12b6 SHA512 3fdb4de1a6d8f836e22d82354492b99ec9883443c389393d25ea40a08bb0b6ae03db9c947af55237b67764facd4d55a09a36cdba107c8d9202f3700fd55c31fa EBUILD yapsy-1.12.2-r1.ebuild 555 BLAKE2B d3000a284a7ead59b4a78bc2f5fab06521570dd9ad31c12f1237595bda82f18dbe5f64dc59d0cb0fa4f329d386fdbde06b61656affd5dd11253f18b9593e9a0a SHA512 32b922c056824681fa16726c54cb8667e9e0714f94f0adc8a261e56875da14e34034ac6162f7518f31a6558ca487a4f9fb3f9b4a78eba3c0440c4ce1005ba3c1 -MISC metadata.xml 359 BLAKE2B e8cae7666c659e493130a23f7f7531531d2378ec6ef2f206d22f2170b9b53bdf3ec309665a4f9ca808fb4b78b0176e11f6297069490313c95c28e681078d1362 SHA512 9ba8d02382321b37d03cb898b4b04486e750c9cc214b2fe306c70af71e0662918283638af385788b90e4250d5515e956deae855bca34a0543d0f5cb012910249 +EBUILD yapsy-1.12.2-r2.ebuild 747 BLAKE2B c6b8df2c8ebd74ad27c0814166a402b7c950686d2e9499c6363784b770430ec59a474b447edff97433a8ab39ace847b559a5f1ec8b590bddbd5eed47fd3f46c3 SHA512 fecf4dcfbba130cbc66a27265104ff7b00da99845542b2c9e95644b7fbb0690ab1363bbde27d042b90366c0d4a3b3f13023baef7695a0e851d03394dcfaf97d5 +MISC metadata.xml 364 BLAKE2B eccd40249935516f78022285c6981250a831820f616564783608c6a7d2a903b9597e21cb64b1b9a195f4890b7e4d3bf3ba0a84c9e8c04c7d97d2e95a0ac927f6 SHA512 06037cf1c1f77a64e73279907ee9dd41f5f18df8b4045a52efb00d54f3c27c82e800d2030fb52dab672d7646ae2be71435c22d877c959012f4aa41e99cf7e051 diff --git a/dev-python/yapsy/files/yapsy-1.12.2-py312.patch b/dev-python/yapsy/files/yapsy-1.12.2-py312.patch new file mode 100644 index 000000000000..6842a495af2d --- /dev/null +++ b/dev-python/yapsy/files/yapsy-1.12.2-py312.patch @@ -0,0 +1,138 @@ +From 29286320673f9e853559cf20aeb3456e541afbd4 Mon Sep 17 00:00:00 2001 +From: Ameya Vikram Singh +Date: Mon, 6 Feb 2023 13:31:23 +0530 +Subject: [PATCH] Remove Deprecated API's + +* Replaced packaging.version instead of distutils.version +* Replaced imp module to importlib + +**Note:** Probably Deprecates Python 2.7 supports, and maybe some initial versions of Python 3.x. + +Signed-off-by: Ameya Vikram Singh +--- + test/test_PluginInfo.py | 3 ++- + yapsy/PluginInfo.py | 6 +++--- + yapsy/PluginManager.py | 17 ++++++++++------- + yapsy/VersionedPluginManager.py | 8 ++++---- + 4 files changed, 19 insertions(+), 15 deletions(-) + +diff --git a/test/test_PluginInfo.py b/test/test_PluginInfo.py +index 0863671..29c736a 100644 +--- a/test/test_PluginInfo.py ++++ b/test/test_PluginInfo.py +@@ -6,6 +6,7 @@ import unittest + + + from yapsy.PluginInfo import PluginInfo ++from packaging.version import Version + + + class PluginInfoTest(unittest.TestCase): +@@ -20,7 +21,7 @@ class PluginInfoTest(unittest.TestCase): + self.assertEqual(None,pi.plugin_object) + self.assertEqual([],pi.categories) + self.assertEqual(None,pi.error) +- self.assertEqual("0.0",pi.version) ++ self.assertEqual(Version("0.0"),pi.version) + self.assertEqual("Unknown",pi.author) + self.assertEqual("Unknown",pi.copyright) + self.assertEqual("None",pi.website) +diff --git a/yapsy/PluginInfo.py b/yapsy/PluginInfo.py +index 69d220e..700374e 100644 +--- a/yapsy/PluginInfo.py ++++ b/yapsy/PluginInfo.py +@@ -12,7 +12,7 @@ API + """ + + from yapsy.compat import ConfigParser +-from distutils.version import StrictVersion ++from packaging.version import Version + + + class PluginInfo(object): +@@ -105,7 +105,7 @@ class PluginInfo(object): + + + def __getVersion(self): +- return StrictVersion(self.details.get("Documentation","Version")) ++ return Version(self.details.get("Documentation","Version")) + + def setVersion(self, vstring): + """ +@@ -114,7 +114,7 @@ class PluginInfo(object): + Used by subclasses to provide different handling of the + version number. + """ +- if isinstance(vstring,StrictVersion): ++ if isinstance(vstring,Version): + vstring = str(vstring) + if not self.details.has_section("Documentation"): + self.details.add_section("Documentation") +diff --git a/yapsy/PluginManager.py b/yapsy/PluginManager.py +index 81a7c2b..b72de93 100644 +--- a/yapsy/PluginManager.py ++++ b/yapsy/PluginManager.py +@@ -128,10 +128,7 @@ API + + import sys + import os +-try: +- import importlib.abc.Loader as imp +-except ImportError: +- import imp ++import importlib + + from yapsy import log + from yapsy import NormalizePluginNameForModuleName +@@ -577,11 +574,17 @@ class PluginManager(object): + .. note:: Isolated and provided to be reused, but not to be reimplemented ! + """ + # use imp to correctly load the plugin as a module ++ candidate_module = None + if os.path.isdir(candidate_filepath): +- candidate_module = imp.load_module(plugin_module_name,None,candidate_filepath,("py","r",imp.PKG_DIRECTORY)) ++ if (spec := importlib.util.spec_from_file_location(candidate_filepath.split('/')[-1], candidate_filepath + "/__init__.py")) is not None: ++ candidate_module = importlib.util.module_from_spec(spec) ++ sys.modules[plugin_module_name] = candidate_module ++ spec.loader.exec_module(candidate_module) + else: +- with open(candidate_filepath+".py","r") as plugin_file: +- candidate_module = imp.load_module(plugin_module_name,plugin_file,candidate_filepath+".py",("py","r",imp.PY_SOURCE)) ++ if (spec := importlib.util.spec_from_file_location(candidate_filepath.split('/')[-1], candidate_filepath + ".py")) is not None: ++ candidate_module = importlib.util.module_from_spec(spec) ++ sys.modules[plugin_module_name] = candidate_module ++ spec.loader.exec_module(candidate_module) + return candidate_module + + def instanciateElementWithImportInfo(self, element, element_name, +diff --git a/yapsy/VersionedPluginManager.py b/yapsy/VersionedPluginManager.py +index 83ad4fd..686a52a 100644 +--- a/yapsy/VersionedPluginManager.py ++++ b/yapsy/VersionedPluginManager.py +@@ -12,7 +12,7 @@ API + """ + + +-from distutils.version import StrictVersion ++from packaging.version import Version + + from yapsy.PluginInfo import PluginInfo + from yapsy.IPlugin import IPlugin +@@ -27,11 +27,11 @@ class VersionedPluginInfo(PluginInfo): + + def __init__(self, plugin_name, plugin_path): + PluginInfo.__init__(self, plugin_name, plugin_path) +- # version number is now required to be a StrictVersion object +- self.version = StrictVersion("0.0") ++ # version number is now required to be a Version object ++ self.version = Version("0.0") + + def setVersion(self, vstring): +- self.version = StrictVersion(vstring) ++ self.version = Version(vstring) + + + class VersionedPluginManager(PluginManagerDecorator): +-- +2.42.0 + diff --git a/dev-python/yapsy/metadata.xml b/dev-python/yapsy/metadata.xml index 8c2be5a80f4c..8d49735ada95 100644 --- a/dev-python/yapsy/metadata.xml +++ b/dev-python/yapsy/metadata.xml @@ -6,7 +6,7 @@ Python - yapsy + tibonihoo/yapsy Yapsy diff --git a/dev-python/yapsy/yapsy-1.12.2-r2.ebuild b/dev-python/yapsy/yapsy-1.12.2-r2.ebuild new file mode 100644 index 000000000000..54be1b3e434d --- /dev/null +++ b/dev-python/yapsy/yapsy-1.12.2-r2.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..12} ) + +inherit distutils-r1 + +MY_P="Yapsy-${PV}" +DESCRIPTION="A fat-free DIY Python plugin management toolkit" +HOMEPAGE=" + https://github.com/tibonihoo/yapsy/ + https://pypi.org/project/Yapsy/ +" +SRC_URI="mirror://sourceforge/yapsy/${MY_P}/${MY_P}.tar.gz" +S=${WORKDIR}/${MY_P} + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~riscv ~x86" + +RDEPEND=" + dev-python/packaging[${PYTHON_USEDEP}] +" + +distutils_enable_sphinx doc +distutils_enable_tests unittest + +PATCHES=( + # https://github.com/tibonihoo/yapsy/commit/29286320673f9e853559cf20aeb3456e541afbd4 + "${FILESDIR}/${P}-py312.patch" +) -- cgit v1.2.3