2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
mock,
|
|
|
|
pillow,
|
|
|
|
pypng,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonAtLeast,
|
|
|
|
qrcode,
|
|
|
|
setuptools,
|
|
|
|
testers,
|
|
|
|
typing-extensions,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "qrcode";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "7.4.2";
|
2024-01-25 14:12:00 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-ndlpRUgn4Sfb2TaWsgdHI55tVA4IKTfJDxSslbMPWEU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
typing-extensions
|
|
|
|
pypng
|
2023-05-24 13:37:59 +00:00
|
|
|
# imports pkg_resouces in console_scripts.py
|
|
|
|
setuptools
|
2023-03-15 16:39:30 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
passthru.optional-dependencies.pil = [ pillow ];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
] ++ passthru.optional-dependencies.pil;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
passthru.tests = {
|
|
|
|
version = testers.testVersion {
|
|
|
|
package = qrcode;
|
|
|
|
command = "qr --version";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.12") [ "test_change" ] ++ [
|
2024-05-15 15:35:15 +00:00
|
|
|
# Attempts to open a file which doesn't exist in sandbox
|
|
|
|
"test_piped"
|
2024-01-25 14:12:00 +00:00
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-03-15 16:39:30 +00:00
|
|
|
description = "Python QR Code image generator";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "qr";
|
2023-03-15 16:39:30 +00:00
|
|
|
homepage = "https://github.com/lincolnloop/python-qrcode";
|
|
|
|
changelog = "https://github.com/lincolnloop/python-qrcode/blob/v${version}/CHANGES.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|