1{
2 lib,
3 agate,
4 buildPythonPackage,
5 cffi,
6 click,
7 colorama,
8 dbt-extractor,
9 dbt-semantic-interfaces,
10 fetchFromGitHub,
11 hologram,
12 idna,
13 isodate,
14 jinja2,
15 logbook,
16 mashumaro,
17 minimal-snowplow-tracker,
18 networkx,
19 packaging,
20 pathspec,
21 protobuf,
22 python3,
23 pythonOlder,
24 pythonRelaxDepsHook,
25 pytz,
26 pyyaml,
27 requests,
28 setuptools,
29 sqlparse,
30 typing-extensions,
31 urllib3,
32 werkzeug,
33}:
34
35buildPythonPackage rec {
36 pname = "dbt-core";
37 version = "1.7.13";
38 pyproject = true;
39
40 disabled = pythonOlder "3.8";
41
42 src = fetchFromGitHub {
43 owner = "dbt-labs";
44 repo = "dbt-core";
45 rev = "refs/tags/v${version}";
46 hash = "sha256-uai1ihdmJpFkQqpx7edWiwwy0ek4dbclR/2OuiNbaXM=";
47 };
48
49 sourceRoot = "${src.name}/core";
50
51 pythonRelaxDeps = [
52 "agate"
53 "click"
54 "mashumaro"
55 "networkx"
56 "logbook"
57 "pathspec"
58 "urllib3"
59 ];
60
61 build-system = [
62 pythonRelaxDepsHook
63 setuptools
64 ];
65
66 dependencies = [
67 agate
68 cffi
69 click
70 colorama
71 dbt-extractor
72 dbt-semantic-interfaces
73 hologram
74 idna
75 isodate
76 jinja2
77 logbook
78 mashumaro
79 minimal-snowplow-tracker
80 networkx
81 packaging
82 pathspec
83 protobuf
84 pytz
85 pyyaml
86 requests
87 sqlparse
88 typing-extensions
89 urllib3
90 werkzeug
91 ] ++ mashumaro.optional-dependencies.msgpack;
92
93 # tests exist for the dbt tool but not for this package specifically
94 doCheck = false;
95
96 passthru = {
97 withAdapters = python3.pkgs.callPackage ./with-adapters.nix { };
98 };
99
100 meta = with lib; {
101 description = "Enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications";
102 longDescription = ''
103 The dbt tool needs adapters to data sources in order to work. The available
104 adapters are:
105
106 dbt-bigquery
107 dbt-postgres
108 dbt-redshift
109 dbt-snowflake
110
111 An example of building this package with a few adapters:
112
113 dbt.withAdapters (adapters: [
114 adapters.dbt-bigquery
115 adapters.dbt-postgres
116 ])
117 '';
118 homepage = "https://github.com/dbt-labs/dbt-core";
119 changelog = "https://github.com/dbt-labs/dbt-core/blob/v${version}/CHANGELOG.md";
120 license = licenses.asl20;
121 maintainers = with maintainers; [
122 mausch
123 tjni
124 ];
125 mainProgram = "dbt";
126 };
127}