nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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 mypy-extensions,
15 psycopg,
16 psycopg-pool,
17 pyasyncore,
18 redis,
19 tenacity,
20 swh-core,
21 swh-model,
22 swh-objstorage,
23 postgresql,
24 postgresqlTestHook,
25 pytest-aiohttp,
26 pytest-mock,
27 pytest-postgresql,
28 pytest-shared-session-scope,
29 pytest-xdist,
30 pytestCheckHook,
31 swh-journal,
32}:
33
34buildPythonPackage (finalAttrs: {
35 pname = "swh-storage";
36 version = "4.1.1";
37 pyproject = true;
38
39 src = fetchFromGitLab {
40 domain = "gitlab.softwareheritage.org";
41 group = "swh";
42 owner = "devel";
43 repo = "swh-storage";
44 tag = "v${finalAttrs.version}";
45 hash = "sha256-AY2IcRJG19oSy2usI9JZTEKYLI3SEiLpNisqD7zus8A=";
46 };
47
48 build-system = [
49 setuptools
50 setuptools-scm
51 ];
52
53 pythonRelaxDeps = [
54 # we patched click 8.2.1
55 "click"
56 ];
57
58 dependencies = [
59 backports-entry-points-selectable
60 cassandra-driver
61 click
62 deprecated
63 flask
64 iso8601
65 mypy-extensions
66 psycopg
67 psycopg-pool
68 pyasyncore
69 redis
70 tenacity
71 swh-core
72 swh-model
73 swh-objstorage
74 ];
75
76 pythonImportsCheck = [ "swh.storage" ];
77
78 # Many broken tests on Darwin. Disabling them for now.
79 doCheck = !stdenv.hostPlatform.isDarwin;
80
81 nativeCheckInputs = [
82 postgresql
83 postgresqlTestHook
84 pytest-aiohttp
85 pytest-mock
86 pytest-postgresql
87 pytest-shared-session-scope
88 pytest-xdist
89 pytestCheckHook
90 swh-journal
91 ];
92
93 disabledTestPaths = [
94 # E fixture 'redisdb' not found
95 "swh/storage/tests/test_replay.py"
96 # Unable to setup the local Cassandra database
97 "swh/storage/tests/test_cassandra.py"
98 "swh/storage/tests/test_cassandra_converters.py"
99 "swh/storage/tests/test_cassandra_diagram.py"
100 "swh/storage/tests/test_cassandra_migration.py"
101 "swh/storage/tests/test_cassandra_ttl.py"
102 "swh/storage/tests/test_cli_cassandra.py"
103 "swh/storage/tests/test_cli_object_references_cassandra.py"
104 # Failing tests
105 "swh/storage/tests/test_cli_object_references.py"
106 ];
107
108 meta = {
109 changelog = "https://gitlab.softwareheritage.org/swh/devel/swh-storage/-/tags/${finalAttrs.src.tag}";
110 description = "Abstraction layer over the archive, allowing to access all stored source code artifacts as well as their metadata";
111 homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-storage";
112 license = lib.licenses.gpl3Only;
113 maintainers = with lib.maintainers; [ drupol ];
114 };
115})