1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # Dependencies
7 setuptools,
8 boto3,
9 click,
10 fastapi,
11 loguru,
12 pathspec,
13 prometheus-client,
14 pydantic,
15 python-dotenv,
16 sentry-sdk,
17 slowapi,
18 starlette,
19 tiktoken,
20 tomli,
21 uvicorn,
22
23 # Tests
24 httpx,
25 jinja2,
26 gitMinimal,
27 pytest-asyncio,
28 pytest-mock,
29 pytestCheckHook,
30 python-multipart,
31}:
32
33buildPythonPackage rec {
34 pname = "gitingest";
35 version = "0.3.1";
36 pyproject = true;
37
38 src = fetchFromGitHub {
39 owner = "coderamp-labs";
40 repo = "gitingest";
41 tag = "v${version}";
42 hash = "sha256-drsncGneZyOCC2GJbrDM+bf4QGI2luacxMhrmdk03l4=";
43 };
44
45 build-system = [
46 setuptools
47 ];
48
49 dependencies = [
50 boto3
51 click
52 fastapi
53 httpx
54 loguru
55 pathspec
56 prometheus-client
57 pydantic
58 python-dotenv
59 sentry-sdk
60 slowapi
61 starlette
62 tiktoken
63 tomli
64 uvicorn
65 ];
66
67 pythonImportsCheck = [
68 "gitingest"
69 ];
70
71 nativeCheckInputs = [
72 jinja2
73 gitMinimal
74 pytest-asyncio
75 pytest-mock
76 pytestCheckHook
77 python-multipart
78 ];
79
80 disabledTests = [
81 # Tests require network
82 "test_cli_with_default_options"
83 "test_cli_with_options"
84 "test_cli_with_stdout_output"
85 "test_cli_writes_file"
86 "test_clone_specific_branch"
87 "test_include_ignore_patterns"
88 "test_ingest_summary"
89 "test_ingest_with_gitignore"
90 "test_parse_query_with_branch"
91 "test_parse_query_without_host"
92 "test_remote_repository_analysis"
93 "test_large_repository"
94 "test_concurrent_requests"
95 "test_large_file_handling"
96 "test_repository_with_patterns"
97 "test_run_ingest_query"
98 ];
99
100 meta = {
101 changelog = "https://github.com/coderamp-labs/gitingest/releases/tag/${src.tag}";
102 description = "Replace 'hub' with 'ingest' in any github url to get a prompt-friendly extract of a codebase";
103 homepage = "https://github.com/coderamp-labs/gitingest";
104 license = lib.licenses.mit;
105 maintainers = with lib.maintainers; [ ];
106 mainProgram = "gitingest";
107 };
108}