1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 setuptools,
9
10 # docs
11 sphinx-rtd-theme,
12 sphinxHook,
13
14 # dependencies
15 colorzero,
16
17 # tests
18 pytestCheckHook,
19}:
20
21buildPythonPackage rec {
22 pname = "gpiozero";
23 version = "2.0.1";
24 pyproject = true;
25
26 disabled = pythonOlder "3.9";
27
28 src = fetchFromGitHub {
29 owner = "gpiozero";
30 repo = pname;
31 rev = "refs/tags/v${version}";
32 hash = "sha256-ifdCFcMH6SrhKQK/TJJ5lJafSfAUzd6ZT5ANUzJGwxI=";
33 };
34
35 postPatch = ''
36 substituteInPlace setup.cfg \
37 --replace " --cov" ""
38 '';
39
40 outputs = [
41 "out"
42 "doc"
43 ];
44
45 nativeBuildInputs = [
46 setuptools
47 sphinx-rtd-theme
48 sphinxHook
49 ];
50
51 propagatedBuildInputs = [ colorzero ];
52
53 nativeCheckInputs = [ pytestCheckHook ];
54
55 pythonImportsCheck = [
56 "gpiozero"
57 "gpiozero.tools"
58 ];
59
60 disabledTests = [
61 # https://github.com/gpiozero/gpiozero/issues/1087
62 "test_spi_hardware_write"
63 ];
64
65 meta = with lib; {
66 description = "Simple interface to GPIO devices with Raspberry Pi";
67 homepage = "https://github.com/gpiozero/gpiozero";
68 changelog = "https://github.com/gpiozero/gpiozero/blob/v${version}/docs/changelog.rst";
69 license = licenses.bsd3;
70 platforms = platforms.linux;
71 maintainers = with maintainers; [ hexa ];
72 };
73}