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