1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 pillow,
7 numpy,
8}:
9
10buildPythonPackage rec {
11 pname = "blurhash";
12 version = "1.1.4";
13 format = "setuptools";
14
15 src = fetchFromGitHub {
16 owner = "halcy";
17 repo = "blurhash-python";
18 # There are no tags: https://github.com/halcy/blurhash-python/issues/4
19 rev = "22e081ef1c24da1bb5c5eaa2c1d6649724deaef8";
20 sha256 = "1qq6mhydlp7q3na4kmaq3871h43wh3pyfyxr4b79bia73wjdylxf";
21 };
22
23 postPatch = ''
24 sed -i '/^addopts/d' setup.cfg
25 '';
26
27 nativeCheckInputs = [
28 pytestCheckHook
29 pillow
30 numpy
31 ];
32
33 pythonImportsCheck = [ "blurhash" ];
34
35 meta = with lib; {
36 description = "Pure-Python implementation of the blurhash algorithm";
37 homepage = "https://github.com/halcy/blurhash-python";
38 license = licenses.mit;
39 maintainers = with maintainers; [ dotlambda ];
40 };
41}