From 8377b96e127962bc4d569b4d800e0a4239976b0d Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Fri, 18 Aug 2023 08:53:34 +0200 Subject: [PATCH 1/4] maintainers: add dawidd6 --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 9140acf8572e..20989ea75100 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -3932,6 +3932,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"; From ca2198ddf92368442fb78d42e31d9b437fb1696d Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Fri, 18 Aug 2023 08:55:40 +0200 Subject: [PATCH 2/4] python310Packages.molecule-plugins: init at 23.4.1 --- .../python-modules/molecule/plugins.nix | 39 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/development/python-modules/molecule/plugins.nix diff --git a/pkgs/development/python-modules/molecule/plugins.nix b/pkgs/development/python-modules/molecule/plugins.nix new file mode 100644 index 000000000000..1921e5ec7f2a --- /dev/null +++ b/pkgs/development/python-modules/molecule/plugins.nix @@ -0,0 +1,39 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonRelaxDepsHook +, setuptools-scm +}: + +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 + ]; + + 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/python-packages.nix b/pkgs/top-level/python-packages.nix index 69007159a980..6be4da0b169b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6669,6 +6669,8 @@ self: super: with self; { mohawk = callPackage ../development/python-modules/mohawk { }; + molecule-plugins = callPackage ../development/python-modules/molecule/plugins.nix { }; + monai = callPackage ../development/python-modules/monai { }; monai-deploy = callPackage ../development/python-modules/monai-deploy { }; From 83bd85b72ba7641d70382bd59a29c32572875e50 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Fri, 18 Aug 2023 08:56:53 +0200 Subject: [PATCH 3/4] molecule: init at 5.1.0 --- .../python-modules/molecule/default.nix | 56 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + pkgs/top-level/python-packages.nix | 2 + 3 files changed, 60 insertions(+) create mode 100644 pkgs/development/python-modules/molecule/default.nix 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/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c77c662369e9..20c9a40c2a09 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10713,6 +10713,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 6be4da0b169b..8cd7a393e79a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6669,6 +6669,8 @@ 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 { }; From 1d37534b1c1ac6259ee189a6c3971763765a1fc4 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Sat, 19 Aug 2023 15:51:07 +0200 Subject: [PATCH 4/4] python310Packages.molecule-plugins: set optional-dependencies --- pkgs/development/python-modules/molecule/plugins.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/python-modules/molecule/plugins.nix b/pkgs/development/python-modules/molecule/plugins.nix index 1921e5ec7f2a..9cb8a635c31e 100644 --- a/pkgs/development/python-modules/molecule/plugins.nix +++ b/pkgs/development/python-modules/molecule/plugins.nix @@ -3,6 +3,8 @@ , fetchPypi , pythonRelaxDepsHook , setuptools-scm +, python-vagrant +, docker }: buildPythonPackage rec { @@ -25,6 +27,15 @@ buildPythonPackage rec { setuptools-scm ]; + passthru.optional-dependencies = { + docker = [ + docker + ]; + vagrant = [ + python-vagrant + ]; + }; + pythonImportsCheck = [ "molecule_plugins" ]; # Tests require container runtimes