summary refs log tree commit diff
path: root/pkgs/development/python-modules/ansible/core.nix
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2021-05-17 23:01:41 +0200
committerMartin Weinelt <hexa@darmstadt.ccc.de>2021-05-23 18:37:51 +0200
commit8e390750e320741c54aeb41aa239ae5ac108687f (patch)
tree5bc58935c7a2c1fead043255fa4c2262131b6600 /pkgs/development/python-modules/ansible/core.nix
parent23414c5026bd1a2c612786053aa7c5a21b26378f (diff)
downloadnixpkgs-8e390750e320741c54aeb41aa239ae5ac108687f.tar
nixpkgs-8e390750e320741c54aeb41aa239ae5ac108687f.tar.gz
nixpkgs-8e390750e320741c54aeb41aa239ae5ac108687f.tar.bz2
nixpkgs-8e390750e320741c54aeb41aa239ae5ac108687f.tar.lz
nixpkgs-8e390750e320741c54aeb41aa239ae5ac108687f.tar.xz
nixpkgs-8e390750e320741c54aeb41aa239ae5ac108687f.tar.zst
nixpkgs-8e390750e320741c54aeb41aa239ae5ac108687f.zip
python3Packages.ansible-core: init at 2.11.0
Diffstat (limited to 'pkgs/development/python-modules/ansible/core.nix')
-rw-r--r--pkgs/development/python-modules/ansible/core.nix83
1 files changed, 83 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/ansible/core.nix b/pkgs/development/python-modules/ansible/core.nix
new file mode 100644
index 00000000000..690d5a1725d
--- /dev/null
+++ b/pkgs/development/python-modules/ansible/core.nix
@@ -0,0 +1,83 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, installShellFiles
+, ansible-collections
+, cryptography
+, jinja2
+, junit-xml
+, lxml
+, ncclient
+, packaging
+, paramiko
+, pexpect
+, psutil
+, pycrypto
+, pyyaml
+, requests
+, resolvelib
+, scp
+, windowsSupport ? false, pywinrm
+, xmltodict
+}:
+
+buildPythonPackage rec {
+  pname = "ansible-core";
+  version = "2.11.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1if9cybdicjhrfzi6nndqakb4sh3mw1fijhvbzbsq7ki22vwww4l";
+  };
+
+  # ansible_connection is already wrapped, so don't pass it through
+  # the python interpreter again, as it would break execution of
+  # connection plugins.
+  postPatch = ''
+    substituteInPlace lib/ansible/executor/task_executor.py \
+      --replace "[python," "["
+
+    substituteInPlace requirements.txt \
+      --replace "resolvelib >= 0.5.3, < 0.6.0" "resolvelib"
+  '';
+
+  nativeBuildInputs = [
+    installShellFiles
+  ];
+
+  propagatedBuildInputs = [
+    # depend on ansible-collections instead of the other way around
+    ansible-collections
+    # from requirements.txt
+    cryptography
+    jinja2
+    packaging
+    pyyaml
+    resolvelib
+    # optional dependencies
+    junit-xml
+    lxml
+    ncclient
+    paramiko
+    pexpect
+    psutil
+    pycrypto
+    requests
+    scp
+    xmltodict
+  ] ++ lib.optional windowsSupport pywinrm;
+
+  postInstall = ''
+    installManPage docs/man/man1/*.1
+  '';
+
+  # internal import errors, missing dependencies
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Radically simple IT automation";
+    homepage = "https://www.ansible.com";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ hexa ];
+  };
+}