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 ]
65 ++ psycopg.optional-dependencies.pool;
66
67 pythonImportsCheck = [ "swh.storage" ];
68
69 nativeCheckInputs = [
70 postgresql
71 postgresqlTestHook
72 pytest-aiohttp
73 pytest-mock
74 pytest-postgresql
75 pytest-shared-session-scope
76 pytest-xdist
77 pytestCheckHook
78 swh-journal
79 ];
80
81 disabledTestPaths = [
82 # E fixture 'redisdb' not found
83 "swh/storage/tests/test_replay.py"
84 # Unable to setup the local Cassandra database
85 "swh/storage/tests/test_cassandra.py"
86 "swh/storage/tests/test_cassandra_converters.py"
87 "swh/storage/tests/test_cassandra_diagram.py"
88 "swh/storage/tests/test_cassandra_migration.py"
89 "swh/storage/tests/test_cassandra_ttl.py"
90 "swh/storage/tests/test_cli_cassandra.py"
91 # Failing tests
92 "swh/storage/tests/test_cli_object_references.py"
93 ];
94
95 meta = {
96 description = "Abstraction layer over the archive, allowing to access all stored source code artifacts as well as their metadata";
97 homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-storage";
98 license = lib.licenses.gpl3Only;
99 maintainers = with lib.maintainers; [ ];
100 };
101}