nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 ansible-compat,
4 ansible-core,
5 buildPythonPackage,
6 click-help-colors,
7 enrich,
8 fetchPypi,
9 jsonschema,
10 molecule,
11 packaging,
12 pluggy,
13 rich,
14 setuptools,
15 setuptools-scm,
16 testers,
17 wcmatch,
18 withPlugins ? true,
19 molecule-plugins,
20 yamllint,
21}:
22
23buildPythonPackage rec {
24 pname = "molecule";
25 version = "25.12.0";
26 pyproject = true;
27
28 src = fetchPypi {
29 inherit pname version;
30 hash = "sha256-sia/G+Z84PowxyaqsiYGP5RD5WHX49BI9V37LuUa29Y=";
31 };
32
33 nativeBuildInputs = [
34 setuptools
35 setuptools-scm
36 ];
37
38 propagatedBuildInputs = [
39 ansible-compat
40 ansible-core
41 click-help-colors
42 enrich
43 jsonschema
44 packaging
45 pluggy
46 rich
47 yamllint
48 wcmatch
49 ]
50 ++ lib.optional withPlugins molecule-plugins;
51
52 pythonImportsCheck = [ "molecule" ];
53
54 # tests can't be easily run without installing things from ansible-galaxy
55 doCheck = false;
56
57 passthru.tests.version =
58 (testers.testVersion {
59 package = molecule;
60 command = "PY_COLORS=0 ${pname} --version";
61 }).overrideAttrs
62 (old: {
63 # workaround the error: Permission denied: '/homeless-shelter'
64 HOME = "$(mktemp -d)";
65 });
66
67 meta = {
68 description = "Aids in the development and testing of Ansible roles";
69 homepage = "https://github.com/ansible-community/molecule";
70 changelog = "https://github.com/ansible/molecule/releases/tag/v${version}";
71 license = lib.licenses.mit;
72 maintainers = [ ];
73 mainProgram = "molecule";
74 };
75}