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.2";
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-l0RD4lOLjzM9Ydf7vJr+PXpUGsVdAZN/dTUFJ3fo078=";
33 };
34
35 build-system = [ setuptools ];
36
37 dependencies =
38 [
39 click
40 distro
41 gevent
42 jinja2
43 packaging
44 paramiko
45 python-dateutil
46 pywinrm
47 setuptools
48 typeguard
49 ]
50 ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ]
51 ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
52
53 nativeCheckInputs = [ pytestCheckHook ];
54
55 pythonImportsCheck = [ "pyinfra" ];
56
57 disabledTests = [
58 # Test requires SSH binary
59 "test_load_ssh_config"
60 ];
61
62 meta = with lib; {
63 description = "Python-based infrastructure automation";
64 longDescription = ''
65 pyinfra automates/provisions/manages/deploys infrastructure. It can be used for
66 ad-hoc command execution, service deployment, configuration management and more.
67 '';
68 homepage = "https://pyinfra.com";
69 downloadPage = "https://pyinfra.com/Fizzadar/pyinfra/releases";
70 changelog = "https://github.com/Fizzadar/pyinfra/blob/v${version}/CHANGELOG.md";
71 license = licenses.mit;
72 maintainers = with maintainers; [ totoroot ];
73 mainProgram = "pyinfra";
74 };
75}