1{ lib
2, fetchPypi
3, buildPythonPackage
4, ansible
5, pyyaml
6, six
7, nose
8, setuptools_scm
9, ruamel_yaml
10}:
11
12buildPythonPackage rec {
13 pname = "ansible-lint";
14 version = "4.2.0";
15
16 src = fetchPypi {
17 inherit pname version;
18 sha256 = "eb925d8682d70563ccb80e2aca7b3edf84fb0b768cea3edc6846aac7abdc414a";
19 };
20
21 format = "pyproject";
22
23 nativeBuildInputs = [ setuptools_scm ];
24 propagatedBuildInputs = [ pyyaml six ansible ruamel_yaml ];
25 checkInputs = [ nose ];
26
27 postPatch = ''
28 patchShebangs bin/ansible-lint
29 substituteInPlace setup.cfg \
30 --replace "setuptools_scm_git_archive>=1.0" ""
31 '';
32
33 # give a hint to setuptools_scm on package version
34 preBuild = ''
35 export SETUPTOOLS_SCM_PRETEND_VERSION="v${version}"
36 export HOME=$(mktemp -d)
37 '';
38
39 checkPhase = ''
40 PATH=$out/bin:$PATH nosetests test
41 '';
42
43 meta = with lib; {
44 homepage = "https://github.com/willthames/ansible-lint";
45 description = "Best practices checker for Ansible";
46 license = licenses.mit;
47 maintainers = [ maintainers.sengaya ];
48 };
49}