From ea42333fce1ddcc88cf551345e320fa878b07ca5 Mon Sep 17 00:00:00 2001 From: Johan Geluk Date: Sat, 5 Aug 2023 15:51:10 +0200 Subject: [PATCH 1/4] maintainers: add geluk --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 6d1f11d2b32e8..0b82c9c59f773 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -6113,6 +6113,12 @@ githubId = 313929; name = "Gabriel Ebner"; }; + geluk = { + email = "johan+nix@geluk.io"; + github = "geluk"; + githubId = 1516985; + name = "Johan Geluk"; + }; genericnerdyusername = { name = "GenericNerdyUsername"; email = "genericnerdyusername@proton.me"; From eee8771175004efc538c01923a12826233dbc0ea Mon Sep 17 00:00:00 2001 From: Johan Geluk Date: Sat, 5 Aug 2023 15:52:43 +0200 Subject: [PATCH 2/4] pythonPackages.expandvars: init at 0.11.0 --- .../python-modules/expandvars/default.nix | 39 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/development/python-modules/expandvars/default.nix diff --git a/pkgs/development/python-modules/expandvars/default.nix b/pkgs/development/python-modules/expandvars/default.nix new file mode 100644 index 0000000000000..60055c6547ba3 --- /dev/null +++ b/pkgs/development/python-modules/expandvars/default.nix @@ -0,0 +1,39 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +, setuptools +, wheel +}: + +buildPythonPackage rec { + pname = "expandvars"; + version = "0.11.0"; + format = "pyproject"; + + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-Q7Qn9dMnqzYAY98mFR+Y0qbwj+GPKJWjKn9fDxF7W1I="; + }; + + nativeBuildInputs = [ + setuptools + wheel + ]; + + # The PyPi package does not supply any tests + doCheck = false; + + pythonImportsCheck = [ + "expandvars" + ]; + + meta = with lib; { + description = "Expand system variables Unix style"; + homepage = "https://github.com/sayanarijit/expandvars"; + license = licenses.mit; + maintainers = with maintainers; [ geluk ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 06f6e8ae32ea7..96d0ff2a24eb8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3532,6 +3532,8 @@ self: super: with self; { exifread = callPackage ../development/python-modules/exifread { }; + expandvars = callPackage ../development/python-modules/expandvars { }; + expects = callPackage ../development/python-modules/expects { }; expecttest = callPackage ../development/python-modules/expecttest { }; From aebb003f2f9b40823ea6da62dea6945f92c9722f Mon Sep 17 00:00:00 2001 From: Johan Geluk Date: Sat, 5 Aug 2023 17:13:24 +0200 Subject: [PATCH 3/4] pythonPackages.ansible-pylibssh: init at 1.1.0 This allows usage of pylibssh in Ansible instead of paramiko. --- .../ansible-pylibssh/default.nix | 49 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 51 insertions(+) create mode 100644 pkgs/development/python-modules/ansible-pylibssh/default.nix diff --git a/pkgs/development/python-modules/ansible-pylibssh/default.nix b/pkgs/development/python-modules/ansible-pylibssh/default.nix new file mode 100644 index 0000000000000..5eb60419fcf7a --- /dev/null +++ b/pkgs/development/python-modules/ansible-pylibssh/default.nix @@ -0,0 +1,49 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +, libssh +, cython +, wheel +, setuptools +, setuptools-scm +, toml +, expandvars +}: + +buildPythonPackage rec { + pname = "ansible-pylibssh"; + version = "1.1.0"; + format = "pyproject"; + + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-spaGux6dYvtUtpOdU6oN7SEn8IgBof2NpQSPvr+Zplg="; + }; + + nativeBuildInputs = [ + cython + wheel + setuptools + setuptools-scm + toml + expandvars + ]; + + propagatedBuildInputs = [ + libssh + ]; + + pythonImportsCheck = [ + "pylibsshext" + ]; + + meta = with lib; { + description = "Python bindings to client functionality of libssh specific to Ansible use case"; + homepage = "https://github.com/ansible/pylibssh"; + license = licenses.lgpl21Plus; + maintainers = with maintainers; [ geluk ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 96d0ff2a24eb8..36c7f74c66142 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -522,6 +522,8 @@ self: super: with self; { ansible-kernel = callPackage ../development/python-modules/ansible-kernel { }; + ansible-pylibssh = callPackage ../development/python-modules/ansible-pylibssh { }; + ansible-runner = callPackage ../development/python-modules/ansible-runner { }; ansible-vault-rw = callPackage ../development/python-modules/ansible-vault-rw { }; From 98f5022d678aac2b0c395694bf49c745ece6eacd Mon Sep 17 00:00:00 2001 From: Johan Geluk Date: Sun, 6 Aug 2023 11:49:42 +0200 Subject: [PATCH 4/4] pythonPackages.ansible,pythonPackages.ansible-core: add ansible-pylibssh dependency --- pkgs/development/python-modules/ansible/core.nix | 2 ++ pkgs/development/python-modules/ansible/default.nix | 3 +++ 2 files changed, 5 insertions(+) diff --git a/pkgs/development/python-modules/ansible/core.nix b/pkgs/development/python-modules/ansible/core.nix index 241e9cbd034f5..17bfb4203720a 100644 --- a/pkgs/development/python-modules/ansible/core.nix +++ b/pkgs/development/python-modules/ansible/core.nix @@ -13,6 +13,7 @@ , ncclient , packaging , paramiko +, ansible-pylibssh , passlib , pexpect , psutil @@ -63,6 +64,7 @@ buildPythonPackage rec { lxml ncclient paramiko + ansible-pylibssh pexpect psutil pycrypto diff --git a/pkgs/development/python-modules/ansible/default.nix b/pkgs/development/python-modules/ansible/default.nix index f4fed78d6204c..9da23d3fc09bf 100644 --- a/pkgs/development/python-modules/ansible/default.nix +++ b/pkgs/development/python-modules/ansible/default.nix @@ -7,6 +7,7 @@ , ncclient , netaddr , paramiko +, ansible-pylibssh , pynetbox , scp , textfsm @@ -45,6 +46,7 @@ buildPythonPackage { ncclient netaddr paramiko + ansible-pylibssh xmltodict # ansible.posix # ansible.utils @@ -62,6 +64,7 @@ buildPythonPackage { jxmlease ncclient paramiko + ansible-pylibssh scp xmltodict ] ++ lib.optionals (withNetbox) [