2022-03-30 09:31:56 +00:00
|
|
|
{ lib
|
2022-08-12 12:06:08 +00:00
|
|
|
, ansible
|
|
|
|
, ansible-core
|
2022-03-30 09:31:56 +00:00
|
|
|
, anyconfig
|
|
|
|
, appdirs
|
|
|
|
, buildPythonPackage
|
|
|
|
, colorama
|
|
|
|
, fetchFromGitHub
|
|
|
|
, flake8
|
|
|
|
, jsonschema
|
|
|
|
, nested-lookup
|
|
|
|
, pathspec
|
|
|
|
, poetry-core
|
|
|
|
, pytest-mock
|
|
|
|
, python-json-logger
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, pyyaml
|
|
|
|
, toolz
|
|
|
|
, unidiff
|
|
|
|
, yamllint
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ansible-later";
|
2022-09-30 11:47:45 +00:00
|
|
|
version = "2.0.21";
|
2022-03-30 09:31:56 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "thegeeklab";
|
|
|
|
repo = pname;
|
2022-04-27 09:35:20 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-09-30 11:47:45 +00:00
|
|
|
hash = "sha256-WObnE5/xOtbX0c3VjVQbec2TDSDKoUe68GFax7dt7WY=";
|
2022-03-30 09:31:56 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'version = "0.0.0"' 'version = "${version}"' \
|
|
|
|
--replace " --cov=ansiblelater --cov-report=xml:coverage.xml --cov-report=term --cov-append --no-cov-on-fail" "" \
|
|
|
|
--replace 'PyYAML = "6.0"' 'PyYAML = "*"' \
|
|
|
|
--replace 'unidiff = "0.7.3"' 'unidiff = "*"' \
|
|
|
|
--replace 'jsonschema = "' 'jsonschema = "^' \
|
|
|
|
--replace 'python-json-logger = "' 'python-json-logger = "^' \
|
|
|
|
--replace 'toolz = "0.11.2' 'toolz = "*' \
|
|
|
|
--replace 'yamllint = "' 'yamllint = "^'
|
|
|
|
'';
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2022-08-12 12:06:08 +00:00
|
|
|
ansible
|
|
|
|
ansible-core
|
2022-03-30 09:31:56 +00:00
|
|
|
anyconfig
|
|
|
|
appdirs
|
|
|
|
colorama
|
|
|
|
flake8
|
|
|
|
jsonschema
|
|
|
|
nested-lookup
|
|
|
|
pathspec
|
|
|
|
python-json-logger
|
|
|
|
pyyaml
|
|
|
|
toolz
|
|
|
|
unidiff
|
|
|
|
yamllint
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest-mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
rm $out/lib/python*/site-packages/LICENSE
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"ansiblelater"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Best practice scanner for Ansible roles and playbooks";
|
|
|
|
homepage = "https://github.com/thegeeklab/ansible-later";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ tboerger ];
|
|
|
|
};
|
|
|
|
}
|