Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, ansible
3, ansible-core
4, anyconfig
5, appdirs
6, buildPythonPackage
7, colorama
8, fetchFromGitHub
9, flake8
10, jsonschema
11, nested-lookup
12, pathspec
13, poetry-core
14, pytest-mock
15, python-json-logger
16, pytestCheckHook
17, pythonRelaxDepsHook
18, pythonOlder
19, pyyaml
20, toolz
21, unidiff
22, yamllint
23}:
24
25buildPythonPackage rec {
26 pname = "ansible-later";
27 version = "3.0.2";
28 format = "pyproject";
29
30 disabled = pythonOlder "3.8";
31
32 src = fetchFromGitHub {
33 owner = "thegeeklab";
34 repo = pname;
35 rev = "refs/tags/v${version}";
36 hash = "sha256-+UcrkITiRrAKo5MFcsSqEpvzuo4Czv+rHMWsnuvVx5o=";
37 };
38
39 postPatch = ''
40 substituteInPlace pyproject.toml \
41 --replace 'version = "0.0.0"' 'version = "${version}"' \
42 --replace " --cov=ansiblelater --cov-report=xml:coverage.xml --cov-report=term --cov-append --no-cov-on-fail" ""
43 '';
44
45 pythonRelaxDeps = [
46 "flake8"
47 "jsonschema"
48 "pathspec"
49 "python-json-logger"
50 "pyyaml"
51 "toolz"
52 "unidiff"
53 "yamllint"
54 ];
55
56 nativeBuildInputs = [
57 poetry-core
58 pythonRelaxDepsHook
59 ];
60
61 propagatedBuildInputs = [
62 ansible
63 ansible-core
64 anyconfig
65 appdirs
66 colorama
67 flake8
68 jsonschema
69 nested-lookup
70 pathspec
71 python-json-logger
72 pyyaml
73 toolz
74 unidiff
75 yamllint
76 ];
77
78 checkInputs = [
79 pytest-mock
80 pytestCheckHook
81 ];
82
83 postInstall = ''
84 rm $out/lib/python*/site-packages/LICENSE
85 '';
86
87 pythonImportsCheck = [
88 "ansiblelater"
89 ];
90
91 meta = with lib; {
92 description = "Best practice scanner for Ansible roles and playbooks";
93 homepage = "https://github.com/thegeeklab/ansible-later";
94 changelog = "https://github.com/thegeeklab/ansible-later/releases/tag/v${version}";
95 license = licenses.mit;
96 maintainers = with maintainers; [ tboerger ];
97 };
98}