1{ stdenv
2, lib
3, buildPythonPackage
4, fetchPypi
5, rustPlatform
6, libiconv
7}:
8
9buildPythonPackage rec {
10 pname = "dbt-extractor";
11 version = "0.4.1";
12 format = "setuptools";
13
14 src = fetchPypi {
15 pname = "dbt_extractor";
16 inherit version;
17 hash = "sha256-dbHGZWmewPH/zhuj13b3386AIVbyLnCnucjwtNfoD0I=";
18 };
19
20 cargoDeps = rustPlatform.importCargoLock {
21 lockFile = ./Cargo.lock;
22 outputHashes = {
23 "tree-sitter-jinja2-0.1.0" = "sha256-lzA2iq4AK0iNwkLvbIt7Jm5WGFbMPFDi6i4AFDm0FOU=";
24 };
25 };
26
27 nativeBuildInputs = [
28 rustPlatform.cargoSetupHook
29 rustPlatform.maturinBuildHook
30 ];
31
32 buildInputs = lib.optionals stdenv.isDarwin [
33 libiconv
34 ];
35
36 # no python tests exist
37 doCheck = false;
38
39 pythonImportsCheck = [
40 "dbt_extractor"
41 ];
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 license = licenses.asl20;
47 maintainers = with maintainers; [ mausch tjni ];
48 };
49}