1{ lib
2, buildPythonPackage
3, fetchPypi
4, pythonOlder
5, isPy27
6, aenum
7, wrapt
8, typing
9, pyserial
10, nose
11, mock
12, hypothesis
13, future
14, pytest
15, pytest-timeout }:
16
17buildPythonPackage rec {
18 pname = "python-can";
19 version = "3.3.2";
20
21 src = fetchPypi {
22 inherit pname version;
23 sha256 = "5fefb5c1e7e7f07faefc02c6eac79f9b58376f007048a04d8e7f325d48ec6b2e";
24 };
25
26 propagatedBuildInputs = [ wrapt pyserial aenum ] ++ lib.optional (pythonOlder "3.5") typing;
27 checkInputs = [ nose mock pytest pytest-timeout hypothesis future ];
28
29 # Tests won't work with hypothesis 4.7.3 under Python 2. So skip the tests in
30 # that case. This clause can be removed once hypothesis has been upgraded in
31 # nixpkgs.
32 doCheck = !(isPy27 && (hypothesis.version == "4.7.3"));
33
34 # Add the scripts to PATH
35 checkPhase = ''
36 PATH=$out/bin:$PATH pytest -c /dev/null
37 '';
38
39 meta = with lib; {
40 homepage = https://github.com/hardbyte/python-can;
41 description = "CAN support for Python";
42 license = licenses.lgpl3;
43 maintainers = with maintainers; [ sorki ];
44 };
45}