1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
{
lib,
buildPythonPackage,
fetchFromGitHub,
python,
pythonOlder,
installShellFiles,
docutils,
setuptools,
ansible,
cryptography,
jinja2,
junit-xml,
lxml,
ncclient,
packaging,
paramiko,
ansible-pylibssh,
pexpect,
psutil,
pycrypto,
pyyaml,
requests,
resolvelib,
scp,
windowsSupport ? false,
pywinrm,
xmltodict,
# Additional packages to add to dependencies
extraPackages ? _: [ ],
}:
buildPythonPackage rec {
pname = "ansible-core";
version = "2.20.0";
pyproject = true;
disabled = pythonOlder "3.12";
src = fetchFromGitHub {
owner = "ansible";
repo = "ansible";
tag = "v${version}";
hash = "sha256-4kTBzDHDfdHR/W4edxrGtWhg6TRLMtdEgUZYcn8cFQg=";
};
# ansible_connection is already wrapped, so don't pass it through
# the python interpreter again, as it would break execution of
# connection plugins.
postPatch = ''
patchShebangs --build packaging/cli-doc/build.py
SETUPTOOLS_PATTERN='"setuptools[0-9 <>=.,]+"'
WHEEL_PATTERN='"wheel[0-9 <>=.,]+"'
echo "Patching pyproject.toml"
# print replaced patterns to stdout
sed -r -i -e 's/'"$SETUPTOOLS_PATTERN"'/"setuptools"/w /dev/stdout' \
-e 's/'"$WHEEL_PATTERN"'/"wheel"/w /dev/stdout' pyproject.toml
'';
nativeBuildInputs = [
installShellFiles
docutils
];
build-system = [ setuptools ];
dependencies = [
# depend on ansible instead of the other way around
ansible
# from requirements.txt
cryptography
jinja2
packaging
pyyaml
resolvelib
# optional dependencies
junit-xml
lxml
ncclient
paramiko
ansible-pylibssh
pexpect
psutil
pycrypto
requests
scp
xmltodict
]
++ lib.optionals windowsSupport [ pywinrm ]
++ extraPackages python.pkgs;
pythonRelaxDeps = [ "resolvelib" ];
postInstall = ''
export HOME="$(mktemp -d)"
packaging/cli-doc/build.py man --output-dir=man
installManPage man/*
'';
# internal import errors, missing dependencies
doCheck = false;
meta = {
changelog = "https://github.com/ansible/ansible/blob/v${version}/changelogs/CHANGELOG-v${lib.versions.majorMinor version}.rst";
description = "Radically simple IT automation";
homepage = "https://www.ansible.com";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [
HarisDotParis
robsliwi
];
};
}
|