Skip to content

Commit 67266de

Browse files
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 = <test_powerdriver.TestNetworkPowerDriver object at 0x7f84794bfdd0> 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 <module> from ...util.snmp import SimpleSNMP labgrid/util/snmp.py:1: in <module> from pysnmp import hlapi /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/hlapi/__init__.py:7: in <module> from pysnmp.proto.rfc1902 import * /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/proto/rfc1902.py:8: in <module> from pysnmp.proto import rfc1155, error /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/proto/rfc1155.py:10: in <module> from pysnmp.proto import error /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/proto/error.py:9: in <module> from pysnmp import debug _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ # # This file is part of pysnmp software. # # Copyright (c) 2005-2019, Ilya Etingof <[email protected]> # 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 = <test_powerdriver.TestNetworkPowerDriver object at 0x7f84794bd910> 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 <module> from ...util.snmp import SimpleSNMP labgrid/util/snmp.py:1: in <module> from pysnmp import hlapi /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/hlapi/__init__.py:7: in <module> from pysnmp.proto.rfc1902 import * /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/proto/rfc1902.py:8: in <module> from pysnmp.proto import rfc1155, error /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/proto/rfc1155.py:10: in <module> from pysnmp.proto import error /opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/pysnmp/proto/error.py:9: in <module> from pysnmp import debug _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ # # This file is part of pysnmp software. # # Copyright (c) 2005-2019, Ilya Etingof <[email protected]> # 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. Limit compatible pyasn1 versions to <0.6.1 until [5] switches labgrid to pysnmp's asyncio API, thereby dropping the upper bound introduced by [3]. While at it, switch from "pysnmp-lextudio" to "pysnmp". The original author of pysnmp passed away and the lextudio folks took over maintenanc. While the request to take over the pysnmp PyPi project was pending, the maintained fork was called pysnmp-lextudio (see #1186, aa2549c). Now that the migration is complete, let's move back to the original package name. See: [6] [1] https://github.com/pyasn1/pyasn1/releases/tag/v0.6.1 [2] pyasn1/pyasn1#76 [3] #1332 [4] lextudio/pysnmp#113 (comment) [5] #1497 [6] etingof/pysnmp#429 Signed-off-by: Bastian Krause <[email protected]>
1 parent b120654 commit 67266de

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pyproject.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ pyvisa = [
6969
"pyvisa>=1.11.3",
7070
"PyVISA-py>=0.5.2",
7171
]
72-
snmp = ["pysnmp-lextudio>=4.4.12, <6"]
72+
snmp = [
73+
"pysnmp>=4.4.12, <6",
74+
"pyasn1<0.6.1",
75+
]
7376
vxi11 = ["python-vxi11>=0.9"]
7477
xena = ["xenavalkyrie>=3.0.1"]
7578
deb = [
@@ -80,7 +83,8 @@ deb = [
8083
"onewire>=0.2",
8184

8285
# labgrid[snmp]
83-
"pysnmp-lextudio>=4.4.12, <6",
86+
"pysnmp>=4.4.12, <6",
87+
"pyasn1<0.6.1",
8488
]
8589
dev = [
8690
# references to other optional dependency groups
@@ -114,7 +118,8 @@ dev = [
114118
"PyVISA-py>=0.5.2",
115119

116120
# labgrid[snmp]
117-
"pysnmp-lextudio>=4.4.12, <6",
121+
"pysnmp>=4.4.12, <6",
122+
"pyasn1<0.6.1",
118123

119124
# labgrid[vxi11]
120125
"python-vxi11>=0.9",

0 commit comments

Comments
 (0)