2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, attrs
|
|
|
|
, bitstruct
|
2020-07-18 16:06:22 +00:00
|
|
|
, click
|
2020-04-24 23:36:52 +00:00
|
|
|
, future
|
|
|
|
, pathlib2
|
2021-04-26 19:14:03 +00:00
|
|
|
, typing ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
, lxml
|
|
|
|
, xlwt
|
|
|
|
, xlrd
|
2023-03-15 16:39:30 +00:00
|
|
|
, xlsxwriter
|
2020-04-24 23:36:52 +00:00
|
|
|
, pyyaml
|
2021-02-05 17:12:51 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "canmatrix";
|
2022-01-22 01:22:15 +00:00
|
|
|
version = "0.9.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# uses fetchFromGitHub as PyPi release misses test/ dir
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ebroecker";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-01-22 01:22:15 +00:00
|
|
|
sha256 = "0x8x8kbg4gyzi0ia9657xygp0mqfii76b67fsx76d31bqsdvlda5";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
# required
|
|
|
|
attrs
|
|
|
|
bitstruct
|
2020-07-18 16:06:22 +00:00
|
|
|
click
|
2020-04-24 23:36:52 +00:00
|
|
|
future
|
|
|
|
pathlib2
|
|
|
|
# optional
|
|
|
|
lxml
|
|
|
|
xlwt
|
|
|
|
xlrd
|
2023-03-15 16:39:30 +00:00
|
|
|
xlsxwriter
|
2020-04-24 23:36:52 +00:00
|
|
|
pyyaml
|
|
|
|
] ++ lib.optional (pythonOlder "3.5") typing;
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "version = versioneer.get_version()" "version = \"${version}\""
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2020-07-18 16:06:22 +00:00
|
|
|
# long_envvar_name_imports requires stable key value pair ordering
|
2021-02-05 17:12:51 +00:00
|
|
|
pytestFlagsArray = [ "-s src/canmatrix" ];
|
|
|
|
disabledTests = [ "long_envvar_name_imports" ];
|
|
|
|
pythonImportsCheck = [ "canmatrix" ];
|
2020-04-24 23:36:52 +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 ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|