depot/third_party/nixpkgs/pkgs/development/python-modules/qrcode/default.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

67 lines
1.3 KiB
Nix

{ lib
, buildPythonPackage
, fetchPypi
, mock
, pillow
, pypng
, pytestCheckHook
, pythonAtLeast
, qrcode
, setuptools
, testers
, typing-extensions
}:
buildPythonPackage rec {
pname = "qrcode";
version = "7.4.2";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-ndlpRUgn4Sfb2TaWsgdHI55tVA4IKTfJDxSslbMPWEU=";
};
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
typing-extensions
pypng
# imports pkg_resouces in console_scripts.py
setuptools
];
passthru.optional-dependencies.pil = [
pillow
];
nativeCheckInputs = [
mock
pytestCheckHook
] ++ passthru.optional-dependencies.pil;
passthru.tests = {
version = testers.testVersion {
package = qrcode;
command = "qr --version";
};
};
disabledTests = lib.optionals (pythonAtLeast "3.12") [
"test_change"
] ++ [
# Attempts to open a file which doesn't exist in sandbox
"test_piped"
];
meta = with lib; {
description = "Python QR Code image generator";
mainProgram = "qr";
homepage = "https://github.com/lincolnloop/python-qrcode";
changelog = "https://github.com/lincolnloop/python-qrcode/blob/v${version}/CHANGES.rst";
license = licenses.bsd3;
maintainers = with maintainers; [ ];
};
}