1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fixtures,
6 pytestCheckHook,
7 pythonOlder,
8 pyxdg,
9 requests,
10 requests-mock,
11 rich,
12 setuptools,
13 tomli,
14 urllib3,
15}:
16
17buildPythonPackage rec {
18 pname = "podman";
19 version = "5.0.0";
20 pyproject = true;
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchFromGitHub {
25 owner = "containers";
26 repo = "podman-py";
27 rev = "refs/tags/v${version}";
28 hash = "sha256-3tbhTg060/K4ejT/xjItSu9zf05LR/d0vkg4XDsspEE=";
29 };
30
31 build-system = [ setuptools ];
32
33 propagatedBuildInputs = [
34 pyxdg
35 requests
36 rich
37 tomli
38 urllib3
39 ];
40
41 nativeCheckInputs = [
42 fixtures
43 pytestCheckHook
44 requests-mock
45 ];
46
47 preCheck = ''
48 export HOME=$(mktemp -d)
49 '';
50
51 pythonImportsCheck = [ "podman" ];
52
53 disabledTests = [
54 # Integration tests require a running container setup
55 "AdapterIntegrationTest"
56 "ContainersIntegrationTest"
57 "ImagesIntegrationTest"
58 "ManifestsIntegrationTest"
59 "NetworksIntegrationTest"
60 "PodsIntegrationTest"
61 "SecretsIntegrationTest"
62 "SystemIntegrationTest"
63 "VolumesIntegrationTest"
64 ];
65
66 meta = with lib; {
67 description = "Python bindings for Podman's RESTful API";
68 homepage = "https://github.com/containers/podman-py";
69 changelog = "https://github.com/containers/podman-py/releases/tag/v${version}";
70 license = licenses.asl20;
71 maintainers = with maintainers; [ fab ];
72 mainProgram = "podman";
73 };
74}