2018-02-01 21:31:14 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2019-04-03 14:23:53 +01:00
|
|
|
, pythonOlder
|
|
|
|
, attrs
|
|
|
|
, bitstruct
|
2020-07-02 19:40:52 +01:00
|
|
|
, click
|
2019-04-03 14:23:53 +01:00
|
|
|
, future
|
|
|
|
, pathlib2
|
2021-03-25 07:23:40 +00:00
|
|
|
, typing ? null
|
2018-02-01 21:31:14 +00:00
|
|
|
, lxml
|
|
|
|
, xlwt
|
|
|
|
, xlrd
|
|
|
|
, XlsxWriter
|
|
|
|
, pyyaml
|
2021-01-28 11:14:37 +00:00
|
|
|
, pytestCheckHook
|
2019-04-03 14:23:53 +01:00
|
|
|
}:
|
2018-02-01 21:31:14 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "canmatrix";
|
2021-01-28 11:10:26 +00:00
|
|
|
version = "0.9.3";
|
2018-02-01 21:31:14 +00:00
|
|
|
|
|
|
|
# uses fetchFromGitHub as PyPi release misses test/ dir
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ebroecker";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-01-28 11:10:26 +00:00
|
|
|
sha256 = "sha256-9FupG1VmROgsxYhsafQYPPqG0xEOAYYK8QDOIBNzE0Y=";
|
2018-02-01 21:31:14 +00:00
|
|
|
};
|
|
|
|
|
2019-04-03 14:23:53 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
# required
|
|
|
|
attrs
|
|
|
|
bitstruct
|
2020-07-02 19:40:52 +01:00
|
|
|
click
|
2019-04-03 14:23:53 +01:00
|
|
|
future
|
|
|
|
pathlib2
|
|
|
|
# optional
|
|
|
|
lxml
|
|
|
|
xlwt
|
|
|
|
xlrd
|
|
|
|
XlsxWriter
|
|
|
|
pyyaml
|
|
|
|
] ++ lib.optional (pythonOlder "3.5") typing;
|
|
|
|
|
2020-07-02 19:40:52 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "version = versioneer.get_version()" "version = \"${version}\""
|
|
|
|
'';
|
|
|
|
|
2021-01-28 11:14:37 +00:00
|
|
|
checkInputs = [ pytestCheckHook ];
|
2020-07-02 19:40:52 +01:00
|
|
|
# long_envvar_name_imports requires stable key value pair ordering
|
2021-01-28 11:14:37 +00:00
|
|
|
pytestFlagsArray = [ "-s src/canmatrix" ];
|
|
|
|
disabledTests = [ "long_envvar_name_imports" ];
|
|
|
|
pythonImportsCheck = [ "canmatrix" ];
|
2018-02-01 21:31:14 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/ebroecker/canmatrix";
|
2018-02-01 21:31:14 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|