1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitLab,
5 setuptools,
6 setuptools-scm,
7 backports-entry-points-selectable,
8 cassandra-driver,
9 click,
10 deprecated,
11 flask,
12 iso8601,
13 mypy-extensions,
14 psycopg,
15 redis,
16 tenacity,
17 swh-core,
18 swh-model,
19 swh-objstorage,
20 postgresql,
21 postgresqlTestHook,
22 pytest-aiohttp,
23 pytest-mock,
24 pytest-postgresql,
25 pytest-shared-session-scope,
26 pytest-xdist,
27 pytestCheckHook,
28 swh-journal,
29}:
30
31buildPythonPackage rec {
32 pname = "swh-storage";
33 version = "3.1.0";
34 pyproject = true;
35
36 src = fetchFromGitLab {
37 domain = "gitlab.softwareheritage.org";
38 group = "swh";
39 owner = "devel";
40 repo = "swh-storage";
41 tag = "v${version}";
42 hash = "sha256-Bxwc8OccmqadLjHtmhToHBYHGkD7Fw3Cl3go9VLV/Bs=";
43 };
44
45 build-system = [
46 setuptools
47 setuptools-scm
48 ];
49
50 dependencies = [
51 backports-entry-points-selectable
52 cassandra-driver
53 click
54 deprecated
55 flask
56 iso8601
57 mypy-extensions
58 psycopg
59 redis
60 tenacity
61 swh-core
62 swh-model
63 swh-objstorage
64 ] ++ psycopg.optional-dependencies.pool;
65
66 pythonImportsCheck = [ "swh.storage" ];
67
68 nativeCheckInputs = [
69 postgresql
70 postgresqlTestHook
71 pytest-aiohttp
72 pytest-mock
73 pytest-postgresql
74 pytest-shared-session-scope
75 pytest-xdist
76 pytestCheckHook
77 swh-journal
78 ];
79
80 disabledTestPaths = [
81 # E fixture 'redisdb' not found
82 "swh/storage/tests/test_replay.py"
83 # Unable to setup the local Cassandra database
84 "swh/storage/tests/test_cassandra.py"
85 "swh/storage/tests/test_cassandra_converters.py"
86 "swh/storage/tests/test_cassandra_diagram.py"
87 "swh/storage/tests/test_cassandra_migration.py"
88 "swh/storage/tests/test_cassandra_ttl.py"
89 "swh/storage/tests/test_cli_cassandra.py"
90 # Failing tests
91 "swh/storage/tests/test_cli_object_references.py"
92 ];
93
94 meta = {
95 description = "Abstraction layer over the archive, allowing to access all stored source code artifacts as well as their metadata";
96 homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-storage";
97 license = lib.licenses.gpl3Only;
98 maintainers = with lib.maintainers; [ drupol ];
99 };
100}