Bug 262906 - net-mgmt/py-pysnmp: abandonned source used
Summary: net-mgmt/py-pysnmp: abandonned source used
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ruslan Makhmatkhanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-29 16:44 UTC by Kajetan Staszkiewicz
Modified: 2023-10-11 05:13 UTC (History)
6 users (show)

See Also:
mhjacks: maintainer-feedback+


Attachments
Update pysnmp to the latest version from GitHub (7.22 KB, patch)
2022-03-29 16:44 UTC, Kajetan Staszkiewicz
no flags Details | Diff
New pure-Python library pysnmp-lextudio forked from net-mgmt/py-pysnmp (3.63 KB, patch)
2023-07-25 11:10 UTC, Alastair Hogge
no flags Details | Diff
New pure-Python library py-pysnmp-lextudio forked from net-mgmt/py-pysnmp (3.66 KB, patch)
2023-07-30 14:13 UTC, Alastair Hogge
no flags Details | Diff
New pure-Python library py-pysnmplib forked from net-mgmt/py-pysnmp (3.28 KB, patch)
2023-07-31 00:26 UTC, Alastair Hogge
no flags Details | Diff
New pure-Python library py-pysnmp-lextudio forked from net-mgmt/py-pysnmp (3.69 KB, patch)
2023-07-31 00:27 UTC, Alastair Hogge
no flags Details | Diff
New pure-Python library py-pysnmp-lextudio forked from net-mgmt/py-pysnmp (4.05 KB, patch)
2023-07-31 02:38 UTC, Alastair Hogge
no flags Details | Diff
New pure-Python library py-pysnmplib forked from net-mgmt/py-pysnmp (3.63 KB, patch)
2023-07-31 02:38 UTC, Alastair Hogge
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kajetan Staszkiewicz 2022-03-29 16:44:30 UTC
Created attachment 232800 [details]
Update pysnmp to the latest version from GitHub

The site snmplabs.com is dead. The github repo has not received any updates in years. The original code does not work properly on Python 3.9 An actively developed fork can be found at https://github.com/pysnmp . 

I'm providing a patch which does the bare minimum to build the pysnmp and it's dependencies:
- pysnmp
- pysmi
- pyasn1
- pyasn1-modules

I have not updated py-pysnmp-mibs as it seems not necessary since version 4 of pysnmp.
Comment 1 mhjacks 2022-03-29 21:51:13 UTC
OK, thanks for the contribution. Maintainer approved
Comment 2 Mikael Urankar freebsd_committer freebsd_triage 2022-04-01 11:10:17 UTC
cc'ing other involved maintainers
Comment 3 John W. O'Brien 2022-04-04 00:13:02 UTC
(In reply to Kajetan Staszkiewicz from comment #0)

I am glad that there is some apparent activity in the wider world surrounding PySNMP. Thank you for calling our attention to it.

As much as I have worried about the abandoned state of the project, and about its long-time author and maintainer, Ilya Etinof, this new project does not instill much confidence as a proper successor. At least not yet. The GitHub organization claims that "This organization has no public members.", the new project has disabled GitHub issues, and there have been only three active committers since Ilya's last tag on 2019-09-24, v4.4.12, one of them evidently a bot, the others ostensibly in the employ of Splunk.

The initial impression I get is that Splunk relies on PySNMP internally, and made the decision to allocate sufficient resources to mitigate its own risk with respect to an abandoned project. The fact that at least some of those commits appear in a public GitHub project is a nod to the wider PySNMP community, and for that I am grateful. Nevertheless, this is clearly not a healthy, thriving successor project at the moment.

I will be happy to prepare a patch to switch net-mgmt/py-pysmi over to the new upstream. I will also be thinking carefully about whether this port is one I should continue to maintain and depend upon.
Comment 4 John W. O'Brien 2023-05-03 16:34:53 UTC
LeXstudio has stepped [0] up to fill the large hole left by Ilya's sad and untimely passing. I have submitted an update to net-mgmt/py-pysmi (bug #271230) to follow the LeXstudio fork. If mhjacks agrees, this bug could be closed OBE.

[0] https://github.com/etingof/pysnmp/issues/429
Comment 5 mhjacks 2023-05-03 16:41:15 UTC
maintainer approved, thanks.

John and I have been discussing this offline; I work at Red Hat now and engineers who worked with Ilya have expressed their support and hope for the LeXtudio fork internally. (That's not a corporate endorsement; just a reflection of internal engineering discussions.)
Comment 6 Alastair Hogge 2023-07-18 14:25:12 UTC
Hello,

I had a look at updating the Port and switching to lextudio, however, I am running into the following error when building:

===>  License BSD2CLAUSE accepted by the user
===>   py39-pysnmp-5.0.28 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by py39-pysnmp-5.0.28 for building
===>  Extracting for py39-pysnmp-5.0.28
=> SHA256 Checksum OK for lextudio-pysnmp-v5.0.28_GH0.tar.gz.
===>  Patching for py39-pysnmp-5.0.28
===>   py39-pysnmp-5.0.28 depends on package: py39-setuptools>0 - found
===>   py39-pysnmp-5.0.28 depends on package: py39-poetry-core>0 - found
===>   py39-pysnmp-5.0.28 depends on file: /usr/local/bin/python3.9 - found
===>   py39-pysnmp-5.0.28 depends on package: py39-build>=0 - found
===>   py39-pysnmp-5.0.28 depends on package: py39-installer>=0 - found
===>  Configuring for py39-pysnmp-5.0.28
===>  Building for py39-pysnmp-5.0.28
* Getting build dependencies for wheel...
* Building wheel...
Successfully built pysnmp_lextudio-5.0.28-py3-none-any.whl
===>  Staging for py39-pysnmp-5.0.28
===>   py39-pysnmp-5.0.28 depends on package: py39-pyasn1>0 - found
===>   py39-pysnmp-5.0.28 depends on package: py39-pycryptodomex>0 - found
===>   py39-pysnmp-5.0.28 depends on package: py39-pysmi>0 - found
===>   py39-pysnmp-5.0.28 depends on file: /usr/local/bin/python3.9 - found
===>   Generating temporary packing list
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.9/site-packages/installer/__main__.py", line 98, in <module>
    _main(sys.argv[1:], "python -m installer")
  File "/usr/local/lib/python3.9/site-packages/installer/__main__.py", line 86, in _main
    with WheelFile.open(args.wheel) as source:
  File "/usr/local/lib/python3.9/contextlib.py", line 119, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.9/site-packages/installer/sources.py", line 162, in open
    with zipfile.ZipFile(path) as f:
  File "/usr/local/lib/python3.9/zipfile.py", line 1248, in __init__
    self.fp = io.open(file, filemode)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/py-pysnmp/net/fafnir/git/freebsd/ports/main/net-mgmt/py-pysnmp/work-py39/pysnmp-5.0.28/dist/pysnmp-5.0.28*.whl'
*** Error code 1

Stop.
make[1]: stopped in /net/fafnir/git/freebsd/ports/main/net-mgmt/py-pysnmp
*** Error code 1

Stop.
make: stopped in /net/fafnir/git/freebsd/ports/main/net-mgmt/py-pysnmp

Does that look familiar at all to anyone?
Comment 7 John W. O'Brien 2023-07-18 21:43:58 UTC
(In reply to Alastair Hogge from comment #6)

Thank you for your attention to this matter.

An email list or IRC would probably be a more appropriate venue for this kind of question.

So as not to let the opportunity go to waste, my best guess is that the name of the port and the name of the source tarball are different, and you haven't yet told the port that in a way that it understands. I would expect the top of your Makefile to look something like this:

PORTNAME=       pysnmp
DISTVERSION=    5.0.28
CATEGORIES=     net-mgmt python
MASTER_SITES=   PYPI
PKGNAMEPREFIX=  ${PYTHON_PKGNAMEPREFIX}
DISTNAME=       ${PORTNAME}_lextudio-${PORTVERSION}

See net-mgmt/py-pysmi for a working example of this.
Comment 8 Alastair Hogge 2023-07-19 00:51:28 UTC
(In reply to John W. O'Brien from comment #7)

Hi John,

Thanks for the advice, I have subscribed to freebsd-python@freebsd.org and will continue the thread there.
Comment 9 Charlie Li freebsd_committer freebsd_triage 2023-07-20 04:24:32 UTC
Please do not change the Python package name in pyproject.toml et al unless for name normalisation [0]. If anything, change the PORTNAME (or create a new port) to match the Python package metadata, which for https://github.com/lextudio/pysnmp is pysnmp-lextudio and https://github.com/pysnmp/pysnmp is pysnmplib. Not allowing any name overrides whatsoever in our PEP-517 support is deliberate not least for software supply chain security/integrity.

[0] https://packaging.python.org/en/latest/specifications/name-normalization/
Comment 10 Alastair Hogge 2023-07-20 05:39:56 UTC
(In reply to Charlie Li from comment #9)

Thanks Charlie, I like those suggestions and will work towards those aims.
Comment 11 Alastair Hogge 2023-07-25 11:10:14 UTC
Created attachment 243605 [details]
New pure-Python library pysnmp-lextudio forked from net-mgmt/py-pysnmp

Hello,

I have attempted a port of pysnmp-lextudio based on the current net-mgmt/py-pysnmp.
Comment 12 Alastair Hogge 2023-07-25 11:14:52 UTC
The lextudio fork of pysnmp requires another new (bug #272713) port to build the documentation.
Comment 13 Alastair Hogge 2023-07-30 14:13:47 UTC
Created attachment 243707 [details]
New pure-Python library py-pysnmp-lextudio forked from net-mgmt/py-pysnmp

Prefix py- to Port.
Comment 14 Alastair Hogge 2023-07-31 00:26:16 UTC
Created attachment 243722 [details]
New pure-Python library py-pysnmplib forked from net-mgmt/py-pysnmp

Here is the patch for py-snmplib.
Comment 15 Alastair Hogge 2023-07-31 00:27:30 UTC
Created attachment 243723 [details]
New pure-Python library py-pysnmp-lextudio forked from net-mgmt/py-pysnmp

Update with ${CONFLICTS_INSTALL} on the other Python SNMP library.
Comment 16 Alastair Hogge 2023-07-31 00:31:37 UTC
Ah damn, I forgot to include ${PORTS}/net-mgmt/Makefile additions. Will correct later.
Comment 17 Alastair Hogge 2023-07-31 02:38:15 UTC
Created attachment 243724 [details]
New pure-Python library py-pysnmp-lextudio forked from net-mgmt/py-pysnmp

Update net-mgmt/Makefile
Comment 18 Alastair Hogge 2023-07-31 02:38:41 UTC
Created attachment 243725 [details]
New pure-Python library py-pysnmplib forked from net-mgmt/py-pysnmp

Update net-mgmt/Makefile
Comment 19 Alastair Hogge 2023-10-11 05:13:16 UTC
Hello,

I created two separate reviews for the new Ports, review D42152 net-mgmt/py-pysnmplib, and review D42153 net-mgmt/py-pysnmp-lextudio. I do not know about maintainer status of the new ports, so I left them with ports@freebsd.org, if mhjacks@swbell.net, or no-one else wants to maintain both ports, I will look after them.

Thanks.