1{ lib
2, buildPythonPackage
3, fetchPypi
4, setuptools
5, pillow
6, pypng
7, typing-extensions
8, mock
9, pytestCheckHook
10, testers
11, qrcode
12}:
13
14buildPythonPackage rec {
15 pname = "qrcode";
16 version = "7.4.2";
17 format = "pyproject";
18
19 src = fetchPypi {
20 inherit pname version;
21 hash = "sha256-ndlpRUgn4Sfb2TaWsgdHI55tVA4IKTfJDxSslbMPWEU=";
22 };
23
24 nativeBuildInputs = [
25 setuptools
26 ];
27
28 propagatedBuildInputs = [
29 typing-extensions
30 pypng
31 # imports pkg_resouces in console_scripts.py
32 setuptools
33 ];
34
35 passthru.optional-dependencies.pil = [
36 pillow
37 ];
38
39 nativeCheckInputs = [
40 mock
41 pytestCheckHook
42 ] ++ passthru.optional-dependencies.pil;
43
44 passthru.tests = {
45 version = testers.testVersion {
46 package = qrcode;
47 command = "qr --version";
48 };
49 };
50
51 meta = with lib; {
52 description = "Python QR Code image generator";
53 homepage = "https://github.com/lincolnloop/python-qrcode";
54 changelog = "https://github.com/lincolnloop/python-qrcode/blob/v${version}/CHANGES.rst";
55 license = licenses.bsd3;
56 };
57
58}