Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / swift / default.nix
blob95dd8e55d4a4e36da5acedcabbf98c13a5981eb4
1 { lib
2 , buildPythonPackage
3 , fetchPypi
4 , boto3
5 , cryptography
6 , eventlet
7 , greenlet
8 , iana-etc
9 , installShellFiles
10 , libredirect
11 , lxml
12 , mock
13 , netifaces
14 , pastedeploy
15 , pbr
16 , pyeclib
17 , requests
18 , setuptools
19 , six
20 , stestr
21 , swiftclient
22 , xattr
25 buildPythonPackage rec {
26   pname = "swift";
27   version = "2.32.0";
29   src = fetchPypi {
30     inherit pname version;
31     hash = "sha256-JeDmZx667rG1ARfRBUDTcOWe7u3ZiytZzGQSRp8bpes=";
32   };
34   postPatch = ''
35     # files requires boto which is incompatible with python 3.9
36     rm test/functional/s3api/{__init__.py,s3_test_client.py}
37   '';
39   nativeBuildInputs = [
40     installShellFiles
41     pbr
42   ];
44   propagatedBuildInputs = [
45     cryptography
46     eventlet
47     greenlet
48     lxml
49     netifaces
50     pastedeploy
51     pyeclib
52     requests
53     setuptools
54     six
55     xattr
56   ];
58   postInstall = ''
59     installManPage doc/manpages/*
60   '';
62   nativeCheckInputs = [
63     boto3
64     mock
65     stestr
66     swiftclient
67   ];
69   # a lot of tests currently fail while establishing a connection
70   doCheck = false;
72   checkPhase = ''
73     echo "nameserver 127.0.0.1" > resolv.conf
74     export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf)
75     export LD_PRELOAD=${libredirect}/lib/libredirect.so
77     export SWIFT_TEST_CONFIG_FILE=test/sample.conf
79     stestr run
80   '';
82   pythonImportsCheck = [ "swift" ];
84   meta = with lib; {
85     description = "OpenStack Object Storage";
86     homepage = "https://github.com/openstack/swift";
87     license = licenses.asl20;
88     maintainers = teams.openstack.members;
89   };