diff --git a/pkgs/applications/networking/cawbird/default.nix b/pkgs/applications/networking/cawbird/default.nix index 517bd1e01cc..08f55450374 100644 --- a/pkgs/applications/networking/cawbird/default.nix +++ b/pkgs/applications/networking/cawbird/default.nix @@ -23,14 +23,14 @@ }: stdenv.mkDerivation rec { - version = "1.4.1"; + version = "1.4.2"; pname = "cawbird"; src = fetchFromGitHub { owner = "IBBoard"; repo = "cawbird"; rev = "v${version}"; - sha256 = "0lmrgcj1ky1vhzynl36k6ba3ws089x4qdrnkjk3lbr334kicx9na"; + sha256 = "17575cp5qcgsqf37y3xqg3vr6l2j8bbbkmy2c1l185rxghfacida"; }; nativeBuildInputs = [ diff --git a/pkgs/development/python-modules/ansible/base.nix b/pkgs/development/python-modules/ansible/base.nix index 06f53423219..3156ba18e10 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 9547b9a0918..0c58defb583 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 00000000000..b64942b1078 --- /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 12eed6bdb29..3957e109c7c 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 00000000000..2aefb51d481 --- /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 00000000000..f5c1f435726 --- /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 63ef7646959..f2a56a8ab3b 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 2be50c10ee3..5101e5f0970 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 e9e9d9de945..6b9878b363d 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 { };