about summary refs log tree commit diff
path: root/pkgs/by-name/pa/paperless-asn-qr-codes/package.nix
blob: 1661d7a5a4859c368ea77997a08d9514cabb2bd7 (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
{ lib
, python3
, fetchFromGitHub
}:

python3.pkgs.buildPythonApplication rec {
  pname = "paperless-asn-qr-codes";
  version = "0.2.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "entropia";
    repo = "paperless-asn-qr-codes";
    rev = "v${version}";
    hash = "sha256-/xCU6xDrmhkua4Iw/BCzhOuqO5GT/0rTJ+Y59wuMz6E=";
  };

  prePatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail "\"argparse\"," ""
  '';

  nativeBuildInputs = [
    python3.pkgs.hatch-vcs
    python3.pkgs.hatchling
  ];

  propagatedBuildInputs = with python3.pkgs; [
    reportlab
    reportlab-qrcode
  ];

  pythonImportsCheck = [ "paperless_asn_qr_codes" ];

  meta = with lib; {
    description = "Command line utility for generating ASN labels for paperless with both a human-readable representation, as well as a QR code for machine consumption";
    homepage = "https://github.com/entropia/paperless-asn-qr-codes";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ xanderio ];
    mainProgram = "paperless-asn-qr-codes";
  };
}