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