1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, python
5, pillow
6}:
7
8buildPythonPackage rec {
9 pname = "python-ev3dev2";
10 version = "2.1.0";
11
12 src = fetchFromGitHub {
13 owner = "ev3dev";
14 repo = "ev3dev-lang-python";
15 rev = version;
16 sha256 = "XxsiQs3k5xKb+3RewARbvBbxaztdvdq3w5ZMgTq+kRc=";
17 fetchSubmodules = true;
18 };
19
20 postPatch = ''
21 echo "${version}" > RELEASE-VERSION
22 '';
23
24 propagatedBuildInputs = [ pillow ];
25
26 checkPhase = ''
27 chmod -R g+rw ./tests/fake-sys/devices/**/*
28 ${python.interpreter} -W ignore::ResourceWarning tests/api_tests.py
29 '';
30
31 meta = with lib; {
32 description = "Python language bindings for ev3dev";
33 homepage = "https://github.com/ev3dev/ev3dev-lang-python";
34 license = with licenses; [ mit ];
35 maintainers = with maintainers; [ emilytrau ];
36 };
37}