1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 hatchling,
8
9 # dependencies
10 dbt-protos,
11 agate,
12 colorama,
13 deepdiff,
14 isodate,
15 jinja2,
16 jsonschema,
17 mashumaro,
18 pathspec,
19 protobuf,
20 python-dateutil,
21 requests,
22 typing-extensions,
23
24 # tests
25 pytestCheckHook,
26 pytest-mock,
27 pytest-xdist,
28}:
29
30buildPythonPackage rec {
31 pname = "dbt-common";
32 version = "1.28.0-unstable-2025-08-14";
33 pyproject = true;
34
35 src = fetchFromGitHub {
36 owner = "dbt-labs";
37 repo = "dbt-common";
38 rev = "dd34e0a0565620863ff70c0b02421d84fcee8a02"; # They don't tag releases
39 hash = "sha256-hG6S+IIAR3Cu69oFapQUVoCdaiEQYeMQ/ekBuAXxPrI=";
40 };
41
42 build-system = [ hatchling ];
43
44 pythonRelaxDeps = [
45 "agate"
46 "deepdiff"
47 # 0.6.x -> 0.7.2 doesn't seem too risky at a glance
48 # https://pypi.org/project/isodate/0.7.2/
49 "isodate"
50 "protobuf"
51 ];
52
53 dependencies = [
54 dbt-protos
55 agate
56 colorama
57 deepdiff
58 isodate
59 jinja2
60 jsonschema
61 mashumaro
62 pathspec
63 protobuf
64 python-dateutil
65 requests
66 typing-extensions
67 ]
68 ++ mashumaro.optional-dependencies.msgpack;
69
70 nativeCheckInputs = [
71 pytestCheckHook
72 pytest-xdist
73 pytest-mock
74 ];
75
76 disabledTests = [
77 # flaky test: https://github.com/dbt-labs/dbt-common/issues/280
78 "TestFindMatching"
79 ];
80
81 pythonImportsCheck = [ "dbt_common" ];
82
83 meta = {
84 description = "Shared common utilities for dbt-core and adapter implementations use";
85 homepage = "https://github.com/dbt-labs/dbt-common";
86 changelog = "https://github.com/dbt-labs/dbt-common/blob/main/CHANGELOG.md";
87 license = lib.licenses.asl20;
88 maintainers = [ ];
89 };
90}