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