summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/python-ev3dev2/default.nix
blob: 67a039644f6bcf5dbcbc4eab2277aaae917af5dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  python,
  pillow,
}:

buildPythonPackage rec {
  pname = "python-ev3dev2";
  version = "2.1.0";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "ev3dev";
    repo = "ev3dev-lang-python";
    rev = version;
    sha256 = "XxsiQs3k5xKb+3RewARbvBbxaztdvdq3w5ZMgTq+kRc=";
    fetchSubmodules = true;
  };

  postPatch = ''
    echo "${version}" > RELEASE-VERSION
  '';

  propagatedBuildInputs = [ pillow ];

  checkPhase = ''
    chmod -R g+rw ./tests/fake-sys/devices/**/*
    ${python.interpreter} -W ignore::ResourceWarning tests/api_tests.py
  '';

  meta = {
    description = "Python language bindings for ev3dev";
    homepage = "https://github.com/ev3dev/ev3dev-lang-python";
    license = with lib.licenses; [ mit ];
    maintainers = with lib.maintainers; [ emilytrau ];
  };
}