1{
2 lib,
3 fetchFromGitHub,
4 python3Packages,
5 beets,
6 beetsPackages,
7 writableTmpDirAsHomeHook,
8}:
9
10python3Packages.buildPythonApplication rec {
11 pname = "beets-filetote";
12 version = "1.0.2";
13 pyproject = true;
14
15 src = fetchFromGitHub {
16 owner = "gtronset";
17 repo = "beets-filetote";
18 tag = "v${version}";
19 hash = "sha256-4goblrcSbjl8+xf1wwyoC2462kSy6biLUhTAVIJ8Pjc=";
20 };
21
22 postPatch = ''
23 substituteInPlace pyproject.toml --replace-fail "poetry-core<2.0.0" "poetry-core"
24 '';
25
26 nativeBuildInputs = [
27 beets
28 ];
29
30 build-system = [ python3Packages.poetry-core ];
31
32 dependencies = with python3Packages; [
33 mediafile
34 reflink
35 toml
36 typeguard
37 ];
38
39 optional-dependencies = {
40 lint = with python3Packages; [
41 black
42 check-manifest
43 flake8
44 flake8-bugbear
45 flake8-bugbear-pyi
46 isort
47 mypy
48 pylint
49 typing_extensions
50 ];
51 test = with python3Packages; [
52 beetsPackages.audible
53 mediafile
54 pytest
55 reflink
56 toml
57 typeguard
58 ];
59 dev = optional-dependencies.lint ++ optional-dependencies.test ++ [ python3Packages.tox ];
60 };
61
62 pytestFlags = [
63 # This is the same as:
64 # -r fEs
65 "-rfEs"
66 ];
67
68 disabledTestPaths = [
69 "tests/test_cli_operation.py"
70 "tests/test_pruning.py"
71 "tests/test_version.py"
72 ];
73
74 nativeCheckInputs = [
75 python3Packages.pytestCheckHook
76 writableTmpDirAsHomeHook
77 ]
78 ++ optional-dependencies.test;
79
80 meta = with lib; {
81 description = "Beets plugin to move non-music files during the import process";
82 homepage = "https://github.com/gtronset/beets-filetote";
83 changelog = "https://github.com/gtronset/beets-filetote/blob/${src.tag}/CHANGELOG.md";
84 maintainers = with maintainers; [ dansbandit ];
85 license = licenses.mit;
86 inherit (beets.meta) platforms;
87 };
88}