From b4d3ab1f0d373583a68bb309a6bb79c84f06b402 Mon Sep 17 00:00:00 2001 From: Bastian Krause Date: Sat, 28 Sep 2024 17:53:05 +0200 Subject: [PATCH] pyproject.toml: limit pysnmp's pyasn1 dependency to <0.6.0 pysnmp depends on pyasn1. `pyasn1.compat.octets` was removed in pyasn1 0.6.1 [1] leading to ModuleNotFoundErrors in labgrid's "eaton" and "poe_mib" power backends: _______________ TestNetworkPowerDriver.test_import_backend_eaton _______________ self = def test_import_backend_eaton(self): pytest.importorskip("pysnmp") > import labgrid.driver.power.eaton tests/test_powerdriver.py:295: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ labgrid/driver/power/eaton.py:2: in from ...util.snmp import SimpleSNMP labgrid/util/snmp.py:1: in from pysnmp import hlapi /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/hlapi/__init__.py:7: in from pysnmp.proto.rfc1902 import * /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/proto/rfc1902.py:8: in from pysnmp.proto import rfc1155, error /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/proto/rfc1155.py:10: in from pysnmp.proto import error /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/proto/error.py:9: in from pysnmp import debug _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ # # This file is part of pysnmp software. # # Copyright (c) 2005-2019, Ilya Etingof # License: https://www.pysnmp.com/pysnmp/license.html # import logging > from pyasn1.compat.octets import octs2ints E ModuleNotFoundError: No module named 'pyasn1.compat.octets' /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/debug.py:8: ModuleNotFoundError ______________ TestNetworkPowerDriver.test_import_backend_poe_mib ______________ self = def test_import_backend_poe_mib(self): pytest.importorskip("pysnmp") > import labgrid.driver.power.poe_mib tests/test_powerdriver.py:307: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ labgrid/driver/power/poe_mib.py:4: in from ...util.snmp import SimpleSNMP labgrid/util/snmp.py:1: in from pysnmp import hlapi /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/hlapi/__init__.py:7: in from pysnmp.proto.rfc1902 import * /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/proto/rfc1902.py:8: in from pysnmp.proto import rfc1155, error /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/proto/rfc1155.py:10: in from pysnmp.proto import error /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/proto/error.py:9: in from pysnmp import debug _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ # # This file is part of pysnmp software. # # Copyright (c) 2005-2019, Ilya Etingof # License: https://www.pysnmp.com/pysnmp/license.html # import logging > from pyasn1.compat.octets import octs2ints E ModuleNotFoundError: No module named 'pyasn1.compat.octets' /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/debug.py:8: ModuleNotFoundError The issue is documented upstream [2]. [3] limited the pysnmp version to <6. pysnmp 6.1.4, 6.2.6, and 7.1.0 are not affected. For stable, limit compatible pyasn1 versions to <0.6.1. On master, [5] switches labgrid to pysnmp's asyncio API, thereby dropping the upper bound introduced by [3]. [1] https://github.com/pyasn1/pyasn1/releases/tag/v0.6.1 [2] https://github.com/pyasn1/pyasn1/issues/76 [3] https://github.com/labgrid-project/labgrid/pull/1332 [4] https://github.com/lextudio/pysnmp/issues/113#issuecomment-2342699222 [5] https://github.com/labgrid-project/labgrid/pull/1497 Signed-off-by: Bastian Krause --- pyproject.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a2c44cd05..30455fc9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,7 +70,10 @@ pyvisa = [ "pyvisa>=1.11.3", "PyVISA-py>=0.5.2", ] -snmp = ["pysnmp-lextudio>=4.4.12, <6"] +snmp = [ + "pysnmp-lextudio>=4.4.12, <6", + "pyasn1<0.6.1", +] vxi11 = ["python-vxi11>=0.9"] xena = ["xenavalkyrie>=3.0.1"] deb = [ @@ -82,6 +85,7 @@ deb = [ # labgrid[snmp] "pysnmp-lextudio>=4.4.12, <6", + "pyasn1<0.6.1", ] dev = [ # references to other optional dependency groups @@ -116,6 +120,7 @@ dev = [ # labgrid[snmp] "pysnmp-lextudio>=4.4.12, <6", + "pyasn1<0.6.1", # labgrid[vxi11] "python-vxi11>=0.9",