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