Skip to content

Commit

Permalink
python312Packages.pysnmp: 4.4.2 -> 6.2.5
Browse files Browse the repository at this point in the history
https://github.com/lextudio/pysnmp/blob/v6.2.5/CHANGES.rst
etingof/pysnmp#429

Promotes the lextudio fork to the the primary pysnmp package.
  • Loading branch information
mweinelt committed Sep 1, 2024
1 parent ee09228 commit e00cd21
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 96 deletions.
9 changes: 7 additions & 2 deletions pkgs/development/python-modules/atenpdu/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
buildPythonPackage,
fetchPypi,
async-timeout,
pysnmp-lextudio,
pysnmp,
pythonOlder,
poetry-core,
}:
Expand All @@ -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
Expand Down
9 changes: 7 additions & 2 deletions pkgs/development/python-modules/brother/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
fetchFromGitHub,
freezegun,
dacite,
pysnmp-lextudio,
pysnmp,
pytest-asyncio,
pytest-error-for-skips,
pytestCheckHook,
Expand All @@ -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 = [
Expand Down
72 changes: 0 additions & 72 deletions pkgs/development/python-modules/pysnmp-lextudio/default.nix

This file was deleted.

70 changes: 52 additions & 18 deletions pkgs/development/python-modules/pysnmp/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
1 change: 1 addition & 0 deletions pkgs/top-level/python-aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down

0 comments on commit e00cd21

Please sign in to comment.