1{
2 lib,
3 buildPythonPackage,
4 fetchurl,
5 fetchPypi,
6 setuptools,
7 pybind11,
8 requests,
9 rich,
10 pillow,
11}:
12
13let
14 test-image = fetchurl {
15 name = "test-image.jpg";
16 url = "https://unsplash.com/photos/u9tAl8WR3DI/download";
17 hash = "sha256-shGNdgOOydgGBtl/JCbTJ0AYgl+2xWvCgHBL+bEoTaE=";
18 };
19in
20buildPythonPackage rec {
21 pname = "materialyoucolor";
22 version = "2.0.10";
23 pyproject = true;
24
25 # PyPI sources contain additional vendored sources
26 src = fetchPypi {
27 inherit pname version;
28 hash = "sha256-MbTUB7mk/UtUswVZsNAxP21tofnRm3VUbtZdpSZx6nY=";
29 };
30
31 build-system = [
32 setuptools
33 pybind11
34 ];
35
36 nativeCheckInputs = [
37 requests
38 rich
39 pillow
40 ];
41
42 checkPhase = ''
43 runHook preCheck
44 python tests/test_all.py ${test-image} 1
45 runHook postCheck
46 '';
47
48 pythonImportsCheck = [
49 "materialyoucolor"
50 "materialyoucolor.quantize" # ext
51 ];
52
53 meta = {
54 description = "Material You color generation algorithms in python";
55 homepage = "https://github.com/T-Dynamos/materialyoucolor-python";
56 license = lib.licenses.mit;
57 maintainers = with lib.maintainers; [ tomasajt ];
58 };
59}