2022-03-30 09:31:56 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2023-05-24 13:37:59 +00:00
|
|
|
, python3
|
2022-03-30 09:31:56 +00:00
|
|
|
}:
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2022-03-30 09:31:56 +00:00
|
|
|
pname = "ansible-later";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "3.3.1";
|
2022-03-30 09:31:56 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "thegeeklab";
|
|
|
|
repo = pname;
|
2022-04-27 09:35:20 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-7k81eEcM+BXNrln6+Lu0+1LjsZdYkUidrRQCdlBbQB8=";
|
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}"' \
|
2023-04-29 16:46:19 +00:00
|
|
|
--replace " --cov=ansiblelater --cov-report=xml:coverage.xml --cov-report=term --no-cov-on-fail" ""
|
2022-08-12 12:06:08 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"flake8"
|
|
|
|
"jsonschema"
|
|
|
|
"pathspec"
|
|
|
|
"python-json-logger"
|
|
|
|
"pyyaml"
|
|
|
|
"toolz"
|
|
|
|
"unidiff"
|
|
|
|
"yamllint"
|
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeBuildInputs = with python3.pkgs; [
|
2022-03-30 09:31:56 +00:00
|
|
|
poetry-core
|
2022-12-28 21:21:41 +00:00
|
|
|
pythonRelaxDepsHook
|
2022-03-30 09:31:56 +00:00
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
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
|
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeCheckInputs = with python3.pkgs; [
|
2022-03-30 09:31:56 +00:00
|
|
|
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";
|
2022-12-28 21:21:41 +00:00
|
|
|
changelog = "https://github.com/thegeeklab/ansible-later/releases/tag/v${version}";
|
2022-03-30 09:31:56 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ tboerger ];
|
|
|
|
};
|
|
|
|
}
|