nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 python3Packages,
4 fetchFromGitHub,
5 fetchpatch,
6 extras ? [ "all" ],
7}:
8
9python3Packages.buildPythonApplication rec {
10 pname = "browsr";
11 version = "1.22.1";
12 pyproject = true;
13
14 src = fetchFromGitHub {
15 owner = "juftin";
16 repo = "browsr";
17 tag = "v${version}";
18 hash = "sha256-eISOADs++ZF62qkWbhFZu6JkEVtTytg3q5nbwS2m+8g=";
19 };
20
21 patches = [
22 # https://github.com/juftin/browsr/pull/55
23 (fetchpatch {
24 name = "textual-6-compat.patch";
25 url = "https://github.com/juftin/browsr/commit/ab958ac982e14e836a0e44080a53c920ad50b256.patch";
26 hash = "sha256-vAJ+M6Eg7N2NV7Cb2DWPYqLJIeq/DY1COECEQOnkpXE=";
27 })
28 ];
29
30 build-system = with python3Packages; [
31 hatchling
32 ];
33
34 dependencies =
35 with python3Packages;
36 [
37 art
38 click
39 pandas
40 pillow
41 pymupdf
42 pyperclip
43 rich
44 rich-click
45 rich-pixels
46 textual
47 textual-universal-directorytree
48 ]
49 ++ lib.attrVals extras optional-dependencies;
50
51 optional-dependencies = with python3Packages; {
52 all = [
53 pyarrow
54 textual-universal-directorytree.optional-dependencies.remote
55 ];
56 parquet = [
57 pyarrow
58 ];
59 remote = [
60 textual-universal-directorytree.optional-dependencies.remote
61 ];
62 };
63
64 nativeCheckInputs = with python3Packages; [
65 pytest-cov-stub
66 pytest-textual-snapshot
67 pytestCheckHook
68 ];
69
70 pythonRelaxDeps = [
71 "art"
72 "click"
73 "pandas"
74 "pymupdf"
75 "pyperclip"
76 "rich-click"
77 "rich-pixels"
78 "rich"
79 "textual"
80 ];
81
82 pythonImportsCheck = [
83 "browsr"
84 ];
85
86 disabledTests = [
87 # Tests require internet access
88 "test_github_screenshot"
89 "test_github_screenshot_license"
90 "test_textual_app_context_path_github"
91 "test_mkdocs_screenshot"
92 ];
93
94 meta = {
95 description = "File explorer in your terminal";
96 mainProgram = "browsr";
97 homepage = "https://juftin.com/browsr";
98 changelog = "https://github.com/juftin/browsr/releases/tag/v${version}";
99 license = lib.licenses.mit;
100 maintainers = [ ];
101 };
102}