2019-02-24 21:53:30 +00:00
|
|
|
{ lib
|
|
|
|
, fetchPypi
|
|
|
|
, buildPythonPackage
|
2020-02-23 20:38:55 +00:00
|
|
|
, isPy27
|
2019-02-24 21:53:30 +00:00
|
|
|
, ansible
|
|
|
|
, pyyaml
|
|
|
|
, six
|
|
|
|
, nose
|
|
|
|
, setuptools_scm
|
|
|
|
, ruamel_yaml
|
2020-02-23 20:38:55 +00:00
|
|
|
, pathlib2
|
2019-02-24 21:53:30 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ansible-lint";
|
2019-12-19 19:31:04 +00:00
|
|
|
version = "4.2.0";
|
2020-02-23 20:38:55 +00:00
|
|
|
# pip is not able to import version info on raumel.yaml
|
|
|
|
disabled = isPy27;
|
2019-02-24 21:53:30 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-12-19 19:31:04 +00:00
|
|
|
sha256 = "eb925d8682d70563ccb80e2aca7b3edf84fb0b768cea3edc6846aac7abdc414a";
|
2019-02-24 21:53:30 +00:00
|
|
|
};
|
|
|
|
|
2020-01-02 21:59:09 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2019-02-24 21:53:30 +00:00
|
|
|
nativeBuildInputs = [ setuptools_scm ];
|
2020-02-23 20:38:55 +00:00
|
|
|
propagatedBuildInputs = [ pyyaml six ansible ruamel_yaml ]
|
|
|
|
++ lib.optionals isPy27 [ pathlib2 ];
|
2019-02-24 21:53:30 +00:00
|
|
|
checkInputs = [ nose ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs bin/ansible-lint
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "setuptools_scm_git_archive>=1.0" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
# give a hint to setuptools_scm on package version
|
|
|
|
preBuild = ''
|
|
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION="v${version}"
|
2020-01-02 21:59:09 +00:00
|
|
|
export HOME=$(mktemp -d)
|
2019-02-24 21:53:30 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
2020-01-02 21:59:09 +00:00
|
|
|
PATH=$out/bin:$PATH nosetests test
|
2019-02-24 21:53:30 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/willthames/ansible-lint";
|
|
|
|
description = "Best practices checker for Ansible";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.sengaya ];
|
|
|
|
};
|
|
|
|
}
|