diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 4012d8568616..6d1f11d2b32e 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -3926,6 +3926,12 @@ githubId = 11422515; name = "David Sánchez"; }; + dawidd6 = { + email = "dawidd0811@gmail.com"; + github = "dawidd6"; + githubId = 9713907; + name = "Dawid Dziurla"; + }; dawidsowa = { email = "dawid_sowa@posteo.net"; github = "dawidsowa"; diff --git a/pkgs/development/python-modules/molecule/default.nix b/pkgs/development/python-modules/molecule/default.nix new file mode 100644 index 000000000000..c12dc3a92f35 --- /dev/null +++ b/pkgs/development/python-modules/molecule/default.nix @@ -0,0 +1,56 @@ +{ lib +, buildPythonPackage +, fetchPypi +, ansible-compat +, ansible-core +, click-help-colors +, cookiecutter +, enrich +, jsonschema +, withPlugins ? true, molecule-plugins +, packaging +, pluggy +, rich +, setuptools +, yamllint +}: + +buildPythonPackage rec { + pname = "molecule"; + version = "5.1.0"; + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-+nr4n9+TF1OcPsqZyx5edSLXpX4LZ/W2mORCdvmNnYI="; + }; + + propagatedBuildInputs = [ + ansible-compat + ansible-core + click-help-colors + cookiecutter + enrich + jsonschema + packaging + pluggy + rich + yamllint + ] ++ lib.optional withPlugins molecule-plugins; + + nativeBuildInputs = [ + setuptools + ]; + + pythonImportsCheck = [ "molecule" ]; + + # tests can't be easily run without installing things from ansible-galaxy + doCheck = false; + + meta = with lib; { + description = "Molecule aids in the development and testing of Ansible roles"; + homepage = "https://github.com/ansible-community/molecule"; + maintainers = with maintainers; [ dawidd6 ]; + license = licenses.mit; + }; +} diff --git a/pkgs/development/python-modules/molecule/plugins.nix b/pkgs/development/python-modules/molecule/plugins.nix new file mode 100644 index 000000000000..9cb8a635c31e --- /dev/null +++ b/pkgs/development/python-modules/molecule/plugins.nix @@ -0,0 +1,50 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonRelaxDepsHook +, setuptools-scm +, python-vagrant +, docker +}: + +buildPythonPackage rec { + pname = "molecule-plugins"; + version = "23.4.1"; + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-NMR+4sEcNbowyoTqaEwe4Wac9+WNIZesnb/L9C0KG3s="; + }; + + # reverse the dependency + pythonRemoveDeps = [ + "molecule" + ]; + + nativeBuildInputs = [ + pythonRelaxDepsHook + setuptools-scm + ]; + + passthru.optional-dependencies = { + docker = [ + docker + ]; + vagrant = [ + python-vagrant + ]; + }; + + pythonImportsCheck = [ "molecule_plugins" ]; + + # Tests require container runtimes + doCheck = false; + + meta = with lib; { + description = "Collection on molecule plugins"; + homepage = "https://github.com/ansible-community/molecule-plugins"; + maintainers = with maintainers; [ dawidd6 ]; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b90c8d2d2847..7054f76b7740 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10782,6 +10782,8 @@ with pkgs; modsecurity-crs = callPackage ../tools/security/modsecurity-crs { }; + molecule = with python3Packages; toPythonApplication molecule; + molly-guard = callPackage ../os-specific/linux/molly-guard { }; molotov = callPackage ../applications/video/molotov { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c6c64969161a..2776e271a9f0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6694,6 +6694,10 @@ self: super: with self; { mohawk = callPackage ../development/python-modules/mohawk { }; + molecule = callPackage ../development/python-modules/molecule { }; + + molecule-plugins = callPackage ../development/python-modules/molecule/plugins.nix { }; + monai = callPackage ../development/python-modules/monai { }; monai-deploy = callPackage ../development/python-modules/monai-deploy { };