2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, fetchPypi
|
|
|
|
, buildPythonPackage
|
|
|
|
, isPy27
|
|
|
|
, ansible
|
|
|
|
, pyyaml
|
|
|
|
, setuptools_scm
|
|
|
|
, ruamel_yaml
|
2020-10-19 23:25:03 +00:00
|
|
|
, rich
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytestcov
|
|
|
|
, pytest_xdist
|
|
|
|
, git
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ansible-lint";
|
2020-11-12 09:05:59 +00:00
|
|
|
version = "4.3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
# pip is not able to import version info on raumel.yaml
|
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-11-12 09:05:59 +00:00
|
|
|
sha256 = "0kwwv9dv9rgsqvp15r2vma7hii9lkkqn0n2irvp5h32cbhzzq4hh";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ setuptools_scm ];
|
2020-10-19 23:25:03 +00:00
|
|
|
propagatedBuildInputs = [ pyyaml ansible ruamel_yaml rich ];
|
|
|
|
checkInputs = [ pytestCheckHook pytestcov pytest_xdist git ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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}"
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
2021-03-12 07:09:13 +00:00
|
|
|
pytest -W ignore::DeprecationWarning -k 'not test_run_playbook_github and not test_run_single_role_path_no_trailing_slash_script'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-10-19 23:25:03 +00:00
|
|
|
homepage = "https://github.com/ansible/ansible-lint";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Best practices checker for Ansible";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.sengaya ];
|
|
|
|
};
|
|
|
|
}
|