diff options
Diffstat (limited to 'dev-python/pysmi')
-rw-r--r-- | dev-python/pysmi/Manifest | 3 | ||||
-rw-r--r-- | dev-python/pysmi/files/pysmi-1.5.0-py313.patch | 36 | ||||
-rw-r--r-- | dev-python/pysmi/pysmi-1.5.0.ebuild | 44 |
3 files changed, 83 insertions, 0 deletions
diff --git a/dev-python/pysmi/Manifest b/dev-python/pysmi/Manifest index 8ecc679ae8cb..8307a7c617f6 100644 --- a/dev-python/pysmi/Manifest +++ b/dev-python/pysmi/Manifest @@ -1,5 +1,8 @@ +AUX pysmi-1.5.0-py313.patch 1750 BLAKE2B ad4a49c9e8e37728a0b07fdcc561b0933681abee0a8759f47039a519d7104d7508835a7f1add3c7eb5375075ab027133e490a4f07426439c1ee831456e514823 SHA512 3c7d9dbf97ed9f284fef69253095a7ffe0e5bae7a36ece7c5ddb0fbd2d7e9055748aabbf461ced5d68eecf670baabb699e97dc570e2b327e77acb67cdb74a4ff DIST pysmi-0.3.4.tar.gz 93985 BLAKE2B 71b0ed936c196381f895b4f56e8e2e328ac274b08801a77b404b964201e00f8da2cbce2719414da358a4feb7992a3d04e732942f6e7006a0cceea4496f96b758 SHA512 720c8948a590130583d6ea388f0ade5d3bfe9e845821add7ffbf1b5495b5fe00b768ffb94f67b82465c6d86234f5306c6e1a5c2e49f4825bb9c31a0df629f7bd DIST pysmi-1.4.4.tar.gz 117164 BLAKE2B 2ef1c2fc58ee90ad052fec5f0aa08fc128cc041e24dc74d8942ff81912e7e45b480e5a125e412e0c52818670dafbd9bee310a863f9a5b898c8a67a18492897ae SHA512 9ce5665d1db147cb80fe7ef17981a4231a25a8b25cfafb14784acc0355fbd0296070a7da67a7f6b1e738e0f5f1249f871ee29a72da546e639ad4d2f2e8b00c43 +DIST pysmi-1.5.0.tar.gz 124064 BLAKE2B 763501b0fd575e356944372f0f173857d8a982a1cc7342636807d7147f7b6615d9c9518f099fb3071356957f0775e7bbd6b5f37d2110947ad22585cc44dff461 SHA512 f99fbc186b2fd481b16269e5b3622821b932459ec97023968ce8e0ae5c2d863702122a44fafb26d901b8a0b03c02f97e60c6999bdde0f19d551a61daf4e926b5 EBUILD pysmi-0.3.4-r1.ebuild 572 BLAKE2B f8ccd02e09eb4358e6d93314678bd8e16e946c2d38241f0f9a283fdb84fb0567f7557bf5b05967f791611e5eb8b59d3b45258c579583aa321637fd03fafbf5e7 SHA512 44ff8a20d166809bb6fe0cb82e7c942b18de15749050571058c0b97a83c7c1948b2ad783a2a1d34a7de49e01d611060418e51b9fdcd765a670034ce146dd3500 EBUILD pysmi-1.4.4.ebuild 798 BLAKE2B dfcfab8fccf1404e04d8f57a7dc09fbfe761779f8124a9d01467507533369afa6b8f3fda1e33f6846fe42cf27d99d7aa7e342beb22b44ba8d68f593c584ecd8e SHA512 cf6750f59fbab51696867b64a3c012a532f2e351ccb73c84adfecb8438971a8768a972871bbc56e6d1ccff0b5909f62fc2881336aeb0e5e0ee6e74af9f559ab2 +EBUILD pysmi-1.5.0.ebuild 974 BLAKE2B 437ed286809f828344ff36c74f73637461e9e0f68be6a4c0847db55f46a907a5a2a9883ea39376335d45457cef23614cf973ac554b0beeb1101aac6f9e308eed SHA512 9c7904f99387f86cbcb2c979f60d748616dee617f834dea2856cfd0eb162d4c5c9b6948526dbe3477aaca88fa68e81437d27a765e1f80ed0b943580b4f67e9cc MISC metadata.xml 387 BLAKE2B 3435c6cc7ebd04242a6529a751eeacc132dbdf473c3b5f68558e97457376e81175f51e3bee10b315b4bbf4c5ac0ddc31ed16ee6a7e8ef92ac1f5b51ce70c11b0 SHA512 15561667591496522b4662368bc9db35327bd7483e3d7411fb4d227129b02f67e042299af44203baea4a1bbd4ba3fe6c74aabb4a598a748788f2077a51571f14 diff --git a/dev-python/pysmi/files/pysmi-1.5.0-py313.patch b/dev-python/pysmi/files/pysmi-1.5.0-py313.patch new file mode 100644 index 000000000000..bebd360593f1 --- /dev/null +++ b/dev-python/pysmi/files/pysmi-1.5.0-py313.patch @@ -0,0 +1,36 @@ +From 1e9c2f7a3cc2ee78caa79d0602f3afe2030dcf5e Mon Sep 17 00:00:00 2001 +From: David van Moolenbroek <david.vanmoolenbroek@aimvalley.com> +Date: Tue, 3 Sep 2024 07:54:12 +0000 +Subject: [PATCH] Fix unit test for Python 3.13 + +As of Python 3.13, tabs in docstrings are expanded to spaces, thereby +breaking one of the unit tests. This commit fixes the unit test. Note +that neither the problem nor this fix affect the main pysmi code. +--- + tests/test_moduleidentity_smiv2_pysnmp.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/tests/test_moduleidentity_smiv2_pysnmp.py b/tests/test_moduleidentity_smiv2_pysnmp.py +index 8c181a8..eeee0f5 100644 +--- a/tests/test_moduleidentity_smiv2_pysnmp.py ++++ b/tests/test_moduleidentity_smiv2_pysnmp.py +@@ -157,7 +157,7 @@ class ModuleIdentityTextTestCase(unittest.TestCase): + organization" + CONTACT-INFO "WG-email:\\n agentx@dorothy.bmc.com\\" + DESCRIPTION " +- A\tdescription with\\n ++ A<TAB>description with\\n + various characters: 0~`!@#$%^&*()-_=+[]{}\\|;:'<>,.?/ + and a very long line that must not be wrapped despite exceeding the threshold of default word wrap filters. + +@@ -170,7 +170,9 @@ class ModuleIdentityTextTestCase(unittest.TestCase): + """ + + def setUp(self): +- docstring = textwrap.dedent(self.__class__.__doc__) ++ # As of Python 3.13, tabs are expanded in docstrings, so we have to use ++ # a placeholder and replace it with real tab here. ++ docstring = textwrap.dedent(self.__class__.__doc__.replace("<TAB>", "\t")) + ast = parserFactory()().parse(docstring)[0] + mibInfo, symtable = SymtableCodeGen().genCode(ast, {}, genTexts=True) + self.mibInfo, pycode = PySnmpCodeGen().genCode( diff --git a/dev-python/pysmi/pysmi-1.5.0.ebuild b/dev-python/pysmi/pysmi-1.5.0.ebuild new file mode 100644 index 000000000000..8a27a701a3fe --- /dev/null +++ b/dev-python/pysmi/pysmi-1.5.0.ebuild @@ -0,0 +1,44 @@ +# Copyright 2017-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=poetry +PYTHON_COMPAT=( python3_{10..13} ) +inherit distutils-r1 pypi + +DESCRIPTION="Pure-Python implementation of SNMP/SMI MIB parsing and conversion library" +HOMEPAGE=" + https://github.com/lextudio/pysmi/ + https://pypi.org/project/pysmi/ +" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~sparc ~x86" + +RDEPEND=" + >=dev-python/jinja-3.1.3[${PYTHON_USEDEP}] + >=dev-python/ply-3.11[${PYTHON_USEDEP}] + >=dev-python/requests-2.26.0[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + >=dev-python/pysnmp-5.0.0[${PYTHON_USEDEP}] + ) +" + +EPYTEST_XDIST=1 +distutils_enable_tests pytest +# TODO: doc +# distutils_enable_sphinx docs/source dev-python/sphinx-copybutton dev-python/sphinx-sitemap + +PATCHES=( + # https://github.com/lextudio/pysmi/pull/4 + "${FILESDIR}/${P}-py313.patch" +) + +python_test() { + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest +} |