1{
2 lib,
3 buildPythonPackage,
4 click,
5 distro,
6 fetchFromGitHub,
7 gevent,
8 importlib-metadata,
9 jinja2,
10 packaging,
11 paramiko,
12 pytestCheckHook,
13 python-dateutil,
14 pythonOlder,
15 pywinrm,
16 setuptools,
17 typeguard,
18 typing-extensions,
19}:
20
21buildPythonPackage rec {
22 pname = "pyinfra";
23 version = "3.4.1";
24 pyproject = true;
25
26 disabled = pythonOlder "3.10";
27
28 src = fetchFromGitHub {
29 owner = "Fizzadar";
30 repo = "pyinfra";
31 tag = "v${version}";
32 hash = "sha256-7bNkDm5SyIgVkrGQ95/q7AiY/JnxtWx+jkDO/rJQ2WQ=";
33 };
34
35 build-system = [ setuptools ];
36
37 dependencies = [
38 click
39 distro
40 gevent
41 jinja2
42 packaging
43 paramiko
44 python-dateutil
45 pywinrm
46 setuptools
47 typeguard
48 ]
49 ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ]
50 ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
51
52 nativeCheckInputs = [ pytestCheckHook ];
53
54 pythonImportsCheck = [ "pyinfra" ];
55
56 disabledTests = [
57 # Test requires SSH binary
58 "test_load_ssh_config"
59 ];
60
61 meta = with lib; {
62 description = "Python-based infrastructure automation";
63 longDescription = ''
64 pyinfra automates/provisions/manages/deploys infrastructure. It can be used for
65 ad-hoc command execution, service deployment, configuration management and more.
66 '';
67 homepage = "https://pyinfra.com";
68 downloadPage = "https://pyinfra.com/Fizzadar/pyinfra/releases";
69 changelog = "https://github.com/Fizzadar/pyinfra/blob/${src.tag}/CHANGELOG.md";
70 license = licenses.mit;
71 maintainers = with maintainers; [ totoroot ];
72 mainProgram = "pyinfra";
73 };
74}