1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitLab,
6 setuptools,
7 setuptools-scm,
8 backports-entry-points-selectable,
9 cassandra-driver,
10 click,
11 deprecated,
12 flask,
13 iso8601,
14 msgpack,
15 mypy-extensions,
16 psycopg,
17 redis,
18 tenacity,
19 swh-core,
20 swh-model,
21 swh-perfecthash,
22 aiohttp,
23 azure-core,
24 azure-storage-blob,
25 fixtures,
26 libcloud,
27 postgresql,
28 postgresqlTestHook,
29 pytestCheckHook,
30 pytest-mock,
31 pytest-postgresql,
32 requests-mock,
33 requests-toolbelt,
34 systemd,
35 types-python-dateutil,
36 types-pyyaml,
37 types-requests,
38 util-linux,
39}:
40
41buildPythonPackage rec {
42 pname = "swh-objstorage";
43 version = "4.0.0";
44 pyproject = true;
45
46 src = fetchFromGitLab {
47 domain = "gitlab.softwareheritage.org";
48 group = "swh";
49 owner = "devel";
50 repo = "swh-objstorage";
51 tag = "v${version}";
52 hash = "sha256-c0ZH2PMT9DVnpTV5PDyX0Yw4iHiJSolEgq/bMXEwXG8=";
53 };
54
55 build-system = [
56 setuptools
57 setuptools-scm
58 ];
59
60 dependencies = [
61 backports-entry-points-selectable
62 cassandra-driver
63 click
64 deprecated
65 flask
66 iso8601
67 msgpack
68 mypy-extensions
69 psycopg
70 redis
71 tenacity
72 swh-core
73 swh-model
74 swh-perfecthash
75 ];
76
77 preCheck = ''
78 substituteInPlace swh/objstorage/backends/winery/roshard.py \
79 --replace-fail "/usr/bin/fallocate" "fallocate"
80 '';
81
82 pythonImportsCheck = [ "swh.objstorage" ];
83
84 enabledTestPaths = [ "swh/objstorage/tests" ];
85
86 nativeCheckInputs = [
87 aiohttp
88 azure-core
89 azure-storage-blob
90 fixtures
91 libcloud
92 postgresql
93 postgresqlTestHook
94 pytestCheckHook
95 pytest-mock
96 pytest-postgresql
97 requests-mock
98 requests-toolbelt
99 systemd
100 types-python-dateutil
101 types-pyyaml
102 types-requests
103 util-linux
104 ]
105 ++ psycopg.optional-dependencies.pool;
106
107 disabledTests = lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) [
108 # FAILED swh/objstorage/tests/test_objstorage_winery.py::test_winery_leaky_bucket_tick - assert 1 == 0
109 "test_winery_leaky_bucket_tick"
110 ];
111
112 meta = {
113 description = "Content-addressable object storage for the Software Heritage project";
114 homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-objstorage";
115 license = lib.licenses.gpl3Only;
116 maintainers = with lib.maintainers; [ ];
117 };
118}