summary refs log tree commit diff
path: root/pkgs/development/python-modules/python-barcode/default.nix
blob: 7a586c2caed2ac996c489ce8fc2a96498d611558 (plain) (blame)
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
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, setuptools-scm
, imagesSupport ? false
, pillow
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "python-barcode";
  version = "0.13.1";
  format = "setuptools";

  disabled = pythonOlder "3.6";

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-+vukqiTp2Wl3e+UhwpT/GPbCs2rWO1/C8hCNly4jslI=";
  };

  propagatedBuildInputs = [
    setuptools-scm
  ] ++ lib.optionals (imagesSupport) [
    pillow
  ];

  postPatch = ''
    substituteInPlace setup.cfg \
      --replace "--cov=barcode" "" \
      --replace "--cov-report=term-missing:skip-covered" "" \
      --replace "--no-cov-on-fail" ""
  '';

  checkInputs = [
    pytestCheckHook
  ];

  pythonImportsCheck = [ "barcode" ];

  meta = with lib; {
    description = "Create standard barcodes with Python";
    homepage = "https://github.com/WhyNotHugo/python-barcode";
    license = licenses.mit;
    maintainers = with maintainers; [ wolfangaukang ];
  };
}