summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules/beetcamp/default.nix
blob: 0d686bbc436bc9d838f16d957492ce58e8c8b704 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
  lib,
  beets,
  buildPythonPackage,
  fetchFromGitHub,
  httpx,
  packaging,
  poetry-core,
  pycountry,
  pytest-cov-stub,
  pytestCheckHook,
  rich-tables,
  filelock,
  writableTmpDirAsHomeHook,
  nix-update-script,
}:

buildPythonPackage (finalAttrs: {
  pname = "beetcamp";
  version = "0.24.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "snejus";
    repo = "beetcamp";
    tag = finalAttrs.version;
    hash = "sha256-kKFYuTJys4j67+cak2PDmn6z2vNzVitFXIZXy2bClY8=";
  };

  patches = [
    ./remove-git-pytest-option.diff
  ];

  build-system = [
    poetry-core
  ];

  dependencies = [
    httpx
    packaging
    pycountry
  ];

  nativeBuildInputs = [
    beets
  ];

  nativeCheckInputs = [
    writableTmpDirAsHomeHook
    pytestCheckHook
    pytest-cov-stub
    rich-tables
    filelock
  ];

  disabledTests = [
    # AssertionError: assert ''
    "test_get_html"
  ];

  passthru = {
    updateScript = nix-update-script { };
    tests = {
      beets-with-beetcamp = beets.override {
        pluginOverrides = {
          beetcamp = {
            enable = true;
            propagatedBuildInputs = [ finalAttrs.finalPackage ];
          };
        };
      };
    };
  };

  meta = {
    description = "Bandcamp autotagger source for beets (http://beets.io)";
    homepage = "https://github.com/snejus/beetcamp";
    changelog = "https://github.com/snejus/beetcamp/blob/${finalAttrs.version}/CHANGELOG.md";
    license = lib.licenses.gpl2Only;
    maintainers = [
      lib.maintainers._9999years
    ];
    mainProgram = "beetcamp";
  };
})