1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 libiconv,
7 pythonOlder,
8 rustPlatform,
9}:
10
11buildPythonPackage rec {
12 pname = "dbt-extractor";
13 version = "0.5.1";
14 pyproject = true;
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchPypi {
19 pname = "dbt_extractor";
20 inherit version;
21 hash = "sha256-zV2VV2qN6kGQJAqvmTajf9dLS3kTymmjw2j8RHK7fhM=";
22 };
23
24 cargoDeps = rustPlatform.importCargoLock {
25 lockFile = ./Cargo.lock;
26 outputHashes = {
27 "tree-sitter-jinja2-0.2.0" = "sha256-Hfw85IcxwqFDKjkUxU+Zd9vyL7gaE0u5TZGKol2I9qg=";
28 };
29 };
30
31 nativeBuildInputs = [
32 rustPlatform.cargoSetupHook
33 rustPlatform.maturinBuildHook
34 ];
35
36 buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
37
38 # no python tests exist
39 doCheck = false;
40
41 pythonImportsCheck = [ "dbt_extractor" ];
42
43 meta = with lib; {
44 description = "A tool that processes the most common jinja value templates in dbt model files";
45 homepage = "https://github.com/dbt-labs/dbt-extractor";
46 changelog = "https://github.com/dbt-labs/dbt-extractor/blob/main/CHANGELOG.md";
47 license = licenses.asl20;
48 maintainers = with maintainers; [
49 mausch
50 tjni
51 ];
52 };
53}