1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitLab,
6 backports-entry-points-selectable,
7 click,
8 deprecated,
9 python-magic,
10 pyyaml,
11 requests,
12 sentry-sdk,
13 tenacity,
14 setuptools,
15 setuptools-scm,
16 aiohttp-utils,
17 flask,
18 hypothesis,
19 iso8601,
20 lzip,
21 msgpack,
22 postgresql,
23 postgresqlTestHook,
24 psycopg,
25 pylzma,
26 pytestCheckHook,
27 pytest-aiohttp,
28 pytest-mock,
29 pytest-postgresql,
30 pytz,
31 requests-mock,
32 systemd,
33 types-deprecated,
34 types-psycopg2,
35 types-pytz,
36 types-pyyaml,
37 types-requests,
38 unzip,
39 pkgs, # Only for pkgs.zstd
40}:
41
42buildPythonPackage rec {
43 pname = "swh-core";
44 version = "4.5.2";
45 pyproject = true;
46
47 src = fetchFromGitLab {
48 domain = "gitlab.softwareheritage.org";
49 group = "swh";
50 owner = "devel";
51 repo = "swh-core";
52 tag = "v${version}";
53 hash = "sha256-yNWij9GclQCysQe9Bukr4cHlZgSQqLAuX1KwGWzAK+0=";
54 };
55
56 build-system = [
57 setuptools
58 setuptools-scm
59 ];
60
61 dependencies = [
62 backports-entry-points-selectable
63 click
64 deprecated
65 python-magic
66 pyyaml
67 requests
68 sentry-sdk
69 tenacity
70 ];
71
72 pythonImportsCheck = [ "swh.core" ];
73
74 __darwinAllowLocalNetworking = true;
75
76 nativeCheckInputs = [
77 aiohttp-utils
78 flask
79 hypothesis
80 iso8601
81 lzip
82 msgpack
83 postgresql
84 postgresqlTestHook
85 psycopg.optional-dependencies.pool
86 pylzma
87 pytestCheckHook
88 pytest-aiohttp
89 pytest-mock
90 pytest-postgresql
91 pytz
92 requests-mock
93 systemd
94 types-deprecated
95 types-psycopg2
96 types-pytz
97 types-pyyaml
98 types-requests
99 unzip
100 pkgs.zstd
101 ];
102
103 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
104 # FileExistsError: [Errno 17] File exists:
105 "test_uncompress_upper_archive_extension"
106 # AssertionError: |500 - 632.1152460000121| not within 100
107 "test_timed_coroutine"
108 "test_timed_start_stop_calls"
109 "test_timed"
110 "test_timed_no_metric"
111 ];
112
113 meta = {
114 description = "Low-level utilities and helpers used by almost all other modules in the stack";
115 homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-core";
116 license = lib.licenses.gpl3Only;
117 mainProgram = "swh";
118 maintainers = with lib.maintainers; [ ];
119 };
120}