2018-02-01 21:31:14 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2019-04-03 14:23:53 +01:00
|
|
|
, pythonOlder
|
|
|
|
, attrs
|
|
|
|
, bitstruct
|
|
|
|
, future
|
|
|
|
, pathlib2
|
|
|
|
, typing
|
2018-02-01 21:31:14 +00:00
|
|
|
, lxml
|
|
|
|
, xlwt
|
|
|
|
, xlrd
|
|
|
|
, XlsxWriter
|
|
|
|
, pyyaml
|
2019-04-03 14:23:53 +01:00
|
|
|
, pytest
|
|
|
|
}:
|
2018-02-01 21:31:14 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "canmatrix";
|
2019-09-28 04:27:00 +01:00
|
|
|
version = "0.8";
|
2018-02-01 21:31:14 +00:00
|
|
|
|
|
|
|
# uses fetchFromGitHub as PyPi release misses test/ dir
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ebroecker";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2019-09-28 04:27:00 +01:00
|
|
|
sha256 = "1wzflapyj2j4xsi7d7gfmznmxbgr658n092xyq9nac46rbhpcphg";
|
2018-02-01 21:31:14 +00:00
|
|
|
};
|
|
|
|
|
2019-04-03 14:23:53 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
# required
|
|
|
|
attrs
|
|
|
|
bitstruct
|
|
|
|
future
|
|
|
|
pathlib2
|
|
|
|
# optional
|
|
|
|
lxml
|
|
|
|
xlwt
|
|
|
|
xlrd
|
|
|
|
XlsxWriter
|
|
|
|
pyyaml
|
|
|
|
] ++ lib.optional (pythonOlder "3.5") typing;
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest
|
|
|
|
];
|
|
|
|
|
2018-02-01 21:31:14 +00:00
|
|
|
checkPhase = ''
|
2019-04-03 14:23:53 +01:00
|
|
|
pytest -s src/canmatrix
|
2018-02-01 21:31:14 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = https://github.com/ebroecker/canmatrix;
|
|
|
|
description = "Support and convert several CAN (Controller Area Network) database formats .arxml .dbc .dbf .kcd .sym fibex xls(x)";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ sorki ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|