summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Weinelt <mweinelt@users.noreply.github.com>2021-09-20 02:39:37 +0200
committerGitHub <noreply@github.com>2021-09-20 02:39:37 +0200
commit60f651c2769ae36b0a7ad25a4a5398d3d93cfb67 (patch)
treec59e470674022880971c07aeca193c511d5f3ee3
parentMerge pull request #138593 from NixOS/backport-138546-to-release-21.05 (diff)
parentansible_2_9: 2.9.25 -> 2.9.26 (diff)
downloadnixpkgs-60f651c2769ae36b0a7ad25a4a5398d3d93cfb67.tar.gz
Merge pull request #138355 from mweinelt/21.05/ansible
-rw-r--r--pkgs/development/python-modules/ansible/base.nix16
-rw-r--r--pkgs/development/python-modules/ansible/collections.nix12
-rw-r--r--pkgs/development/python-modules/ansible/core.nix90
-rw-r--r--pkgs/development/python-modules/ansible/legacy.nix14
-rw-r--r--pkgs/development/python-modules/commentjson/default.nix34
-rw-r--r--pkgs/development/python-modules/resolvelib/default.nix35
-rw-r--r--pkgs/tools/admin/ansible/default.nix2
-rw-r--r--pkgs/top-level/all-packages.nix3
-rw-r--r--pkgs/top-level/python-packages.nix6
9 files changed, 194 insertions, 18 deletions
diff --git a/pkgs/development/python-modules/ansible/base.nix b/pkgs/development/python-modules/ansible/base.nix
index 06f534232195..3156ba18e106 100644
--- a/pkgs/development/python-modules/ansible/base.nix
+++ b/pkgs/development/python-modules/ansible/base.nix
@@ -1,8 +1,8 @@
{ lib
+, callPackage
, buildPythonPackage
, fetchPypi
, installShellFiles
-, ansible-collections
, cryptography
, jinja2
, junit-xml
@@ -20,13 +20,19 @@
, xmltodict
}:
+let
+ ansible-collections = callPackage ./collections.nix {
+ version = "3.4.0"; # must be < 4.0
+ sha256 = "096rbgz730njk0pg8qnc27mmz110wqrw354ca9gasb7rqg0f4d6a";
+ };
+in
buildPythonPackage rec {
pname = "ansible-base";
- version = "2.10.11";
+ version = "2.10.14";
src = fetchPypi {
inherit pname version;
- sha256 = "0jr3cxqiami9k07g2kmvfp54iafbcnd1d66l8fdnaqka5bc19wdw";
+ sha256 = "sha256-gAxGRsWKWJf3HyIwFn21YmoZbeuiCPDvRWChg//Z39o=";
};
# ansible_connection is already wrapped, so don't pass it through
@@ -69,6 +75,10 @@ buildPythonPackage rec {
# internal import errors, missing dependencies
doCheck = false;
+ passthru = {
+ collections = ansible-collections;
+ };
+
meta = with lib; {
description = "Radically simple IT automation";
homepage = "https://www.ansible.com";
diff --git a/pkgs/development/python-modules/ansible/collections.nix b/pkgs/development/python-modules/ansible/collections.nix
index 9547b9a09187..0c58defb583f 100644
--- a/pkgs/development/python-modules/ansible/collections.nix
+++ b/pkgs/development/python-modules/ansible/collections.nix
@@ -14,21 +14,23 @@
, xmltodict
, withJunos ? false
, withNetbox ? false
+
+, version
+, sha256
}:
buildPythonPackage rec {
pname = "ansible";
- version = "3.4.0";
+ inherit version;
format = "setuptools";
src = fetchPypi {
- inherit pname version;
- sha256 = "096rbgz730njk0pg8qnc27mmz110wqrw354ca9gasb7rqg0f4d6a";
+ inherit pname version sha256;
};
postPatch = ''
# make ansible-base depend on ansible-collection, not the other way around
- sed -i '/ansible-base/d' setup.py
+ sed -Ei '/ansible-(base|core)/d' setup.py
'';
propagatedBuildInputs = lib.unique ([
@@ -70,7 +72,7 @@ buildPythonPackage rec {
meta = with lib; {
description = "Radically simple IT automation";
- homepage = "http://www.ansible.com";
+ homepage = "https://www.ansible.com";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ hexa ];
};
diff --git a/pkgs/development/python-modules/ansible/core.nix b/pkgs/development/python-modules/ansible/core.nix
new file mode 100644
index 000000000000..b64942b10780
--- /dev/null
+++ b/pkgs/development/python-modules/ansible/core.nix
@@ -0,0 +1,90 @@
+{ lib
+, callPackage
+, buildPythonPackage
+, fetchPypi
+, installShellFiles
+, cryptography
+, jinja2
+, junit-xml
+, lxml
+, ncclient
+, packaging
+, paramiko
+, pexpect
+, psutil
+, pycrypto
+, pyyaml
+, requests
+, resolvelib
+, scp
+, windowsSupport ? false, pywinrm
+, xmltodict
+}:
+
+let
+ ansible-collections = callPackage ./collections.nix {
+ version = "4.5.0";
+ sha256 = "1c8dspqy4in7sgz10y1pggwnh1hv79wap7p7xhai0f0s6nr54lyc";
+ };
+in
+buildPythonPackage rec {
+ pname = "ansible-core";
+ version = "2.11.5";
+
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "sha256-fTzkcBQSKQdFRwQ2NIXkhRP4rQ8AE4uIhw622IlT0SE=";
+ };
+
+ # 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," "["
+ '';
+
+ 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;
+
+ passthru = {
+ collections = ansible-collections;
+ };
+
+ meta = with lib; {
+ description = "Radically simple IT automation";
+ homepage = "https://www.ansible.com";
+ license = licenses.gpl3Plus;
+ maintainers = with maintainers; [ hexa ];
+ };
+}
diff --git a/pkgs/development/python-modules/ansible/legacy.nix b/pkgs/development/python-modules/ansible/legacy.nix
index 12eed6bdb29e..3957e109c7c0 100644
--- a/pkgs/development/python-modules/ansible/legacy.nix
+++ b/pkgs/development/python-modules/ansible/legacy.nix
@@ -1,5 +1,5 @@
{ lib
-, fetchFromGitHub
+, fetchPypi
, buildPythonPackage
, pycrypto
, paramiko
@@ -18,13 +18,11 @@
buildPythonPackage rec {
pname = "ansible";
- version = "2.9.23";
+ version = "2.9.26";
- src = fetchFromGitHub {
- owner = "ansible";
- repo = "ansible";
- rev = "v${version}";
- sha256 = "0mikykpzyqpmaiczz53f71mcyc4qvahi9ckn7wgfx7sw7s2z3skk";
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "sha256-OuAqrSu+3PtBnOdevSpkjp3rc+ni2N6GyC1gR7G962M=";
};
prePatch = ''
@@ -48,7 +46,7 @@ buildPythonPackage rec {
doCheck = false;
meta = with lib; {
- homepage = "http://www.ansible.com";
+ homepage = "https://www.ansible.com";
description = "Radically simple IT automation";
license = [ licenses.gpl3 ] ;
maintainers = with maintainers; [ joamaki costrouc hexa ];
diff --git a/pkgs/development/python-modules/commentjson/default.nix b/pkgs/development/python-modules/commentjson/default.nix
new file mode 100644
index 000000000000..2aefb51d481e
--- /dev/null
+++ b/pkgs/development/python-modules/commentjson/default.nix
@@ -0,0 +1,34 @@
+{ lib, buildPythonPackage, fetchFromGitHub, six, lark-parser, pytestCheckHook }:
+
+buildPythonPackage rec {
+ pname = "commentjson";
+ version = "0.9.0";
+
+ src = fetchFromGitHub {
+ owner = "vaidik";
+ repo = "commentjson";
+ rev = "v${version}";
+ sha256 = "sha256-dPnIcv7TIeyG7rU938w7FrDklmaGuPpXz34uw/JjOgY=";
+ };
+
+ postPatch = ''
+ substituteInPlace setup.py \
+ --replace "lark-parser>=0.7.1,<0.8.0" "lark-parser"
+
+ # NixOS is missing test.test_json module
+ rm -r commentjson/tests/test_json
+ '';
+
+ propagatedBuildInputs = [ lark-parser six ];
+
+ checkInputs = [ pytestCheckHook ];
+
+ pythonImportsCheck = [ "commentjson" ];
+
+ meta = with lib; {
+ description = "Add JavaScript or Python style comments in JSON";
+ homepage = "https://github.com/vaidik/commentjson/";
+ license = licenses.mit;
+ maintainers = with maintainers; [ SuperSandro2000 ];
+ };
+}
diff --git a/pkgs/development/python-modules/resolvelib/default.nix b/pkgs/development/python-modules/resolvelib/default.nix
new file mode 100644
index 000000000000..f5c1f4357268
--- /dev/null
+++ b/pkgs/development/python-modules/resolvelib/default.nix
@@ -0,0 +1,35 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, commentjson
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+ pname = "resolvelib";
+ # Currently this package is only used by Ansible and breaking changes
+ # are frequently introduced, so when upgrading ensure the new version
+ # is compatible with Ansible
+ # https://github.com/NixOS/nixpkgs/pull/128636
+ # https://github.com/ansible/ansible/blob/devel/requirements.txt
+ version = "0.5.5";
+
+ src = fetchFromGitHub {
+ owner = "sarugaku";
+ repo = "resolvelib";
+ rev = version;
+ sha256 = "198vfv78hilpg0d0mjzchzp9zk6239wnra61vlsgwpcgz66d2bgv";
+ };
+
+ checkInputs = [
+ commentjson
+ pytestCheckHook
+ ];
+
+ meta = with lib; {
+ description = "Resolve abstract dependencies into concrete ones";
+ homepage = "https://github.com/sarugaku/resolvelib";
+ license = licenses.isc;
+ maintainers = with maintainers; [ hexa ];
+ };
+}
diff --git a/pkgs/tools/admin/ansible/default.nix b/pkgs/tools/admin/ansible/default.nix
index 63ef76469599..f2a56a8ab3b5 100644
--- a/pkgs/tools/admin/ansible/default.nix
+++ b/pkgs/tools/admin/ansible/default.nix
@@ -3,6 +3,8 @@
rec {
ansible = ansible_2_10;
+ ansible_2_11 = python3Packages.toPythonApplication python3Packages.ansible-core;
+
ansible_2_10 = python3Packages.toPythonApplication python3Packages.ansible-base;
# End of support 2021/10/02, End of life 2021/12/31
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 2be50c10ee3c..5101e5f0970c 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -12625,7 +12625,8 @@ in
ansible
ansible_2_8
ansible_2_9
- ansible_2_10;
+ ansible_2_10
+ ansible_2_11;
ansible-lint = with python3.pkgs; toPythonApplication ansible-lint;
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index e9e9d9de9458..6b9878b363df 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -415,7 +415,7 @@ in {
ansible-base = callPackage ../development/python-modules/ansible/base.nix { };
- ansible-collections = callPackage ../development/python-modules/ansible/collections.nix { };
+ ansible-core = callPackage ../development/python-modules/ansible/core.nix { };
ansible-kernel = callPackage ../development/python-modules/ansible-kernel { };
@@ -1523,6 +1523,8 @@ in {
commandparse = callPackage ../development/python-modules/commandparse { };
+ commentjson = callPackage ../development/python-modules/commentjson { };
+
commoncode = callPackage ../development/python-modules/commoncode { };
CommonMark = callPackage ../development/python-modules/commonmark { };
@@ -7206,6 +7208,8 @@ in {
resampy = callPackage ../development/python-modules/resampy { };
+ resolvelib = callPackage ../development/python-modules/resolvelib { };
+
responses = callPackage ../development/python-modules/responses { };
respx = callPackage ../development/python-modules/respx { };