From 89d725c707629313d00c39e84898328cefb4bd67 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 1 Sep 2024 15:31:24 +0200 Subject: [PATCH] python312Packages.pysnmp: 4.4.2 -> 6.2.5 https://github.com/lextudio/pysnmp/blob/v6.2.5/CHANGES.rst https://github.com/etingof/pysnmp/issues/429 Promotes the lextudio fork to the the primary pysnmp package. --- .../python-modules/atenpdu/default.nix | 9 ++- .../python-modules/brother/default.nix | 9 ++- .../pysnmp-lextudio/default.nix | 72 ------------------- .../python-modules/pysnmp/default.nix | 70 +++++++++++++----- pkgs/top-level/python-aliases.nix | 1 + pkgs/top-level/python-packages.nix | 2 - 6 files changed, 67 insertions(+), 96 deletions(-) delete mode 100644 pkgs/development/python-modules/pysnmp-lextudio/default.nix diff --git a/pkgs/development/python-modules/atenpdu/default.nix b/pkgs/development/python-modules/atenpdu/default.nix index 1dde4152f0ace..f60b281112cd5 100644 --- a/pkgs/development/python-modules/atenpdu/default.nix +++ b/pkgs/development/python-modules/atenpdu/default.nix @@ -3,7 +3,7 @@ buildPythonPackage, fetchPypi, async-timeout, - pysnmp-lextudio, + pysnmp, pythonOlder, poetry-core, }: @@ -20,11 +20,16 @@ buildPythonPackage rec { hash = "sha256-KzRoE4tE/tQkKYroq5PbWKREmEl8AwbIOg3IHRZZtsQ="; }; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail pysnmp-lextudio pysnmp + ''; + nativeBuildInputs = [ poetry-core ]; propagatedBuildInputs = [ async-timeout - pysnmp-lextudio + pysnmp ]; # Module has no test diff --git a/pkgs/development/python-modules/brother/default.nix b/pkgs/development/python-modules/brother/default.nix index 94380a638c639..49a12f7c3a0c6 100644 --- a/pkgs/development/python-modules/brother/default.nix +++ b/pkgs/development/python-modules/brother/default.nix @@ -4,7 +4,7 @@ fetchFromGitHub, freezegun, dacite, - pysnmp-lextudio, + pysnmp, pytest-asyncio, pytest-error-for-skips, pytestCheckHook, @@ -27,11 +27,16 @@ buildPythonPackage rec { hash = "sha256-5fd+UznnOFnqYL8CPX90Y2z6q35oUH638mz4l+Ux6oE="; }; + postPatch = '' + substituteInPlace requirements.txt \ + --replace-fail pysnmp-lextudio pysnmp + ''; + nativeBuildInputs = [ setuptools ]; propagatedBuildInputs = [ dacite - pysnmp-lextudio + pysnmp ]; nativeCheckInputs = [ diff --git a/pkgs/development/python-modules/pysnmp-lextudio/default.nix b/pkgs/development/python-modules/pysnmp-lextudio/default.nix deleted file mode 100644 index abca059a59a21..0000000000000 --- a/pkgs/development/python-modules/pysnmp-lextudio/default.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ - lib, - buildPythonPackage, - fetchFromGitHub, - - # build-system - poetry-core, - - # dependencies - pyasn1, - pysmi, - pysnmpcrypto, - - # tests - pytestCheckHook, - pytest-asyncio, -}: - -buildPythonPackage rec { - pname = "pysnmp-lextudio"; - version = "6.1.2"; - pyproject = true; - - src = fetchFromGitHub { - owner = "lextudio"; - repo = "pysnmp"; - rev = "refs/tags/v${version}"; - hash = "sha256-iVej39OmTPiZL11+IetnqHaxFAhZ/YR7tjiRoc7pu8U="; - }; - - nativeBuildInputs = [ poetry-core ]; - - propagatedBuildInputs = [ - pyasn1 - pysmi - pysnmpcrypto - ]; - - nativeCheckInputs = [ - pytestCheckHook - pytest-asyncio - ]; - - disabledTests = [ - # Temporary failure in name resolutionc - "test_custom_asn1_mib_search_path" - "test_send_notification" - "test_send_trap" - "test_send_v3_inform_notification" - "test_send_v3_inform_sync" - "test_usm_sha_aes128" - "test_v1_get" - "test_v1_next" - "test_v1_set" - "test_v2c_bulk" - # pysnmp.smi.error.MibNotFoundError - "test_send_v3_trap_notification" - "test_addAsn1MibSource" - "test_v1_walk" - "test_v2_walk" - ]; - - pythonImportsCheck = [ "pysnmp" ]; - - meta = with lib; { - description = "Python SNMP library"; - homepage = "https://github.com/lextudio/pysnmp"; - changelog = "https://github.com/lextudio/pysnmp/blob/${src.rev}/CHANGES.txt"; - license = licenses.bsd2; - maintainers = with maintainers; [ hexa ]; - }; -} diff --git a/pkgs/development/python-modules/pysnmp/default.nix b/pkgs/development/python-modules/pysnmp/default.nix index 7bc9db63943a9..3fa3a1dfe700b 100644 --- a/pkgs/development/python-modules/pysnmp/default.nix +++ b/pkgs/development/python-modules/pysnmp/default.nix @@ -1,40 +1,74 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, + + # build-system + poetry-core, + + # dependencies pyasn1, - pycryptodomex, pysmi, + pysnmpcrypto, + + # tests + pytestCheckHook, + pytest-asyncio, }: buildPythonPackage rec { pname = "pysnmp"; - version = "4.4.12"; - format = "setuptools"; + version = "6.2.5"; + pyproject = true; - src = fetchPypi { - inherit pname version; - sha256 = "1acbfvpbr45i137s00mbhh21p71ywjfw3r8z0ybcmjjqz7rbwg8c"; + src = fetchFromGitHub { + owner = "lextudio"; + repo = "pysnmp"; + rev = "refs/tags/v${version}"; + hash = "sha256-EGMUTUN95wykU756GJSiXwr8Hi3kyaLPfqhuDgvhbBE="; }; - patches = [ ./setup.py-Fix-the-setuptools-version-check.patch ]; + pythonRemoveDeps = [ "pytest-cov" ]; - # NameError: name 'mibBuilder' is not defined - doCheck = false; + build-system = [ poetry-core ]; - propagatedBuildInputs = [ + dependencies = [ pyasn1 - pycryptodomex pysmi + pysnmpcrypto + ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-asyncio + ]; + + disabledTests = [ + # Temporary failure in name resolution + "test_custom_asn1_mib_search_path" + "test_send_notification" + "test_send_trap" + "test_send_v3_inform_notification" + "test_send_v3_inform_sync" + "test_usm_sha_aes128" + "test_v1_get" + "test_v1_next" + "test_v1_set" + "test_v2c_bulk" + # pysnmp.smi.error.MibNotFoundError + "test_send_v3_trap_notification" + "test_addAsn1MibSource" + "test_v1_walk" + "test_v2_walk" ]; + pythonImportsCheck = [ "pysnmp" ]; + meta = with lib; { - homepage = "http://snmplabs.com/pysnmp/index.html"; - description = "Pure-Python SNMPv1/v2c/v3 library"; + description = "Python SNMP library"; + homepage = "https://github.com/lextudio/pysnmp"; + changelog = "https://github.com/lextudio/pysnmp/blob/${src.rev}/CHANGES.txt"; license = licenses.bsd2; - maintainers = with maintainers; [ - primeos - koral - ]; + maintainers = with maintainers; [ hexa ]; }; } diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index fd9be8f4ebf6b..c75b4a0f6f0f4 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -462,6 +462,7 @@ mapAliases ({ pysmart-smartx = pysmart; # added 2021-10-22 pySmartDL = pysmartdl; # added 2023-10-11 pysmi-lextudio = pysmi; # added 2024-07-18 + pysnmp-lextudio = pysnmp; # added 2024-07-18 pysparse = throw "pysparse has been abandoned upstream."; # added 2023-02-28 pyspotify = throw "pyspotify has been removed because Spotify stopped supporting libspotify"; # added 2022-05-29 PyStemmer = pystemmer; # added 2023-02-19 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d1f661b36baf4..2566cd503aa47 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12433,8 +12433,6 @@ self: super: with self; { pysnmpcrypto = callPackage ../development/python-modules/pysnmpcrypto { }; - pysnmp-lextudio = callPackage ../development/python-modules/pysnmp-lextudio { }; - pysnmp-pyasn1 = callPackage ../development/python-modules/pysnmp-pyasn1 { }; pysnmp-pysmi = callPackage ../development/python-modules/pysnmp-pysmi { };