nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 importlib-metadata,
7 natsort,
8 pillow,
9 py7zr,
10 pycountry,
11 pyicu,
12 pytestCheckHook,
13 rapidfuzz,
14 rarfile,
15 setuptools,
16 setuptools-scm,
17 text2digits,
18 wheel,
19 wordninja,
20}:
21
22buildPythonPackage rec {
23 pname = "comicapi";
24 version = "3.2.0";
25 pyproject = true;
26
27 src = fetchFromGitHub {
28 owner = "comictagger";
29 repo = "comicapi";
30 rev = "2bf8332114e49add0bbc0fd3d85bdbba02de3d1a";
31 hash = "sha256-Cd3ILy/4PqWUj1Uu9of9gCpdVp2R6CXjPOuSXgrB894=";
32 };
33
34 build-system = [
35 setuptools
36 setuptools-scm
37 wheel
38 ];
39
40 dependencies = [
41 importlib-metadata
42 natsort
43 pillow
44 pycountry
45 rapidfuzz
46 text2digits
47 wordninja
48 ];
49
50 optional-dependencies = {
51 _7z = [ py7zr ];
52
53 all = [
54 py7zr
55 rarfile
56 ]
57 ++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isLinux) pyicu;
58
59 cbr = [ rarfile ];
60
61 icu = lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isLinux) pyicu;
62 };
63
64 nativeCheckInputs = [ pytestCheckHook ] ++ lib.concatAttrValues optional-dependencies;
65
66 pythonRelaxDeps = [ "pycountry" ];
67
68 disabledTests = [
69 # AssertionError
70 "test_copy_from_archive"
71 ];
72
73 pythonImportsCheck = [ "comicapi" ];
74
75 meta = {
76 description = "Comic archive (cbr/cbz/cbt) and metadata utilities";
77 homepage = "https://github.com/comictagger/comicapi";
78 license = lib.licenses.asl20;
79 maintainers = with lib.maintainers; [ getchoo ];
80 };
81}