2018-02-01 21:30:26 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2019-03-01 17:01:51 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
2018-07-24 15:28:26 +00:00
|
|
|
, wrapt
|
2019-03-01 17:01:51 +00:00
|
|
|
, typing
|
2018-02-01 21:30:26 +00:00
|
|
|
, pyserial
|
|
|
|
, nose
|
2018-07-24 15:28:26 +00:00
|
|
|
, mock
|
2019-03-01 17:01:51 +00:00
|
|
|
, hypothesis
|
|
|
|
, future
|
2018-07-24 15:28:26 +00:00
|
|
|
, pytest
|
|
|
|
, pytest-timeout }:
|
2018-02-01 21:30:26 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-can";
|
2019-03-01 17:01:51 +00:00
|
|
|
version = "3.1.0";
|
2018-02-01 21:30:26 +00:00
|
|
|
|
2019-03-01 17:01:51 +00:00
|
|
|
# PyPI tarball is missing some tests and is missing __init__.py in test
|
|
|
|
# directory causing the tests to fail. See:
|
|
|
|
# https://github.com/hardbyte/python-can/issues/518
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = pname;
|
|
|
|
owner = "hardbyte";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "01lfsh7drm4qvv909x9i0vnhskdh27mcb5xa86sv9m3zfpq8cjis";
|
2018-02-01 21:30:26 +00:00
|
|
|
};
|
|
|
|
|
2019-03-01 17:01:51 +00:00
|
|
|
propagatedBuildInputs = [ wrapt pyserial ] ++ lib.optional (pythonOlder "3.5") typing;
|
|
|
|
checkInputs = [ nose mock pytest pytest-timeout hypothesis future ];
|
2018-07-24 15:28:26 +00:00
|
|
|
|
2019-03-01 17:01:51 +00:00
|
|
|
# Add the scripts to PATH
|
2018-07-24 15:28:26 +00:00
|
|
|
checkPhase = ''
|
2019-03-01 17:01:51 +00:00
|
|
|
PATH=$out/bin:$PATH pytest -c /dev/null
|
2018-07-24 15:28:26 +00:00
|
|
|
'';
|
2018-02-01 21:30:26 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = https://github.com/hardbyte/python-can;
|
|
|
|
description = "CAN support for Python";
|
|
|
|
license = licenses.lgpl3;
|
|
|
|
maintainers = with maintainers; [ sorki ];
|
|
|
|
};
|
|
|
|
}
|