1{
2 lib,
3 buildPythonPackage,
4 cachetools,
5 fetchPypi,
6 nixosTests,
7 pytestCheckHook,
8 pythonOlder,
9 setuptools,
10 twisted,
11 txamqp,
12 urllib3,
13 whisper,
14}:
15
16buildPythonPackage rec {
17 pname = "carbon";
18 version = "1.1.10";
19 pyproject = true;
20
21 disabled = pythonOlder "3.10";
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-wTtbqRHMWBcM2iFN95yzwCf/BQ+EK0vp5MXT4mKX3lw=";
26 };
27
28 # Carbon-s default installation is /opt/graphite. This env variable ensures
29 # carbon is installed as a regular Python module.
30 GRAPHITE_NO_PREFIX = "True";
31
32 postPatch = ''
33 substituteInPlace setup.py \
34 --replace-fail "cf.readfp(f, 'setup.cfg')" "cf.read(f, 'setup.cfg')"
35 '';
36
37 build-system = [ setuptools ];
38
39 dependencies = [
40 cachetools
41 twisted
42 txamqp
43 urllib3
44 whisper
45 ];
46
47 # Tests are not shipped with PyPI
48 doCheck = false;
49
50 passthru.tests = {
51 inherit (nixosTests) graphite;
52 };
53
54 pythonImportsCheck = [ "carbon" ];
55
56 meta = with lib; {
57 description = "Backend data caching and persistence daemon for Graphite";
58 homepage = "https://github.com/graphite-project/carbon";
59 changelog = "https://github.com/graphite-project/carbon/releases/tag/${version}";
60 license = licenses.asl20;
61 maintainers = with maintainers; [
62 offline
63 basvandijk
64 ];
65 };
66}