diff options
author | Michał Górny <mgorny@gentoo.org> | 2024-09-03 10:51:43 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2024-09-03 11:20:51 +0200 |
commit | 32ddad21eadb3a3376da5e05db02eac425845952 (patch) | |
tree | f8a2ef685249778047a993e6c78cecfc9c38c378 /dev-python/pysmi | |
parent | dev-ruby/json: Stabilize 2.7.2-r1 arm, #938953 (diff) | |
download | gentoo-32ddad21eadb3a3376da5e05db02eac425845952.tar.gz gentoo-32ddad21eadb3a3376da5e05db02eac425845952.tar.bz2 gentoo-32ddad21eadb3a3376da5e05db02eac425845952.zip |
dev-python/pysmi: Bump to 1.5.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/pysmi')
-rw-r--r-- | dev-python/pysmi/Manifest | 1 | ||||
-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, 81 insertions, 0 deletions
diff --git a/dev-python/pysmi/Manifest b/dev-python/pysmi/Manifest index eede5251ad05..984e774ee43a 100644 --- a/dev-python/pysmi/Manifest +++ b/dev-python/pysmi/Manifest @@ -1,2 +1,3 @@ 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 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 +} |