nixpkgs/pkgs/development/python-modules/canmatrix/default.nix

65 lines
1.3 KiB
Nix
Raw Normal View History

2018-02-01 21:31:14 +00:00
{ lib
, buildPythonPackage
, fetchFromGitHub
2019-04-03 14:23:53 +01:00
, pythonOlder
, attrs
, bitstruct
, click
2019-04-03 14:23:53 +01:00
, future
, pathlib2
, typing ? null
2018-02-01 21:31:14 +00:00
, lxml
, xlwt
, xlrd
, XlsxWriter
, pyyaml
, pytestCheckHook
2019-04-03 14:23:53 +01:00
}:
2018-02-01 21:31:14 +00:00
buildPythonPackage rec {
pname = "canmatrix";
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;
sha256 = "sha256-9FupG1VmROgsxYhsafQYPPqG0xEOAYYK8QDOIBNzE0Y=";
2018-02-01 21:31:14 +00:00
};
2019-04-03 14:23:53 +01:00
propagatedBuildInputs = [
# required
attrs
bitstruct
click
2019-04-03 14:23:53 +01:00
future
pathlib2
# optional
lxml
xlwt
xlrd
XlsxWriter
pyyaml
] ++ lib.optional (pythonOlder "3.5") typing;
postPatch = ''
substituteInPlace setup.py \
--replace "version = versioneer.get_version()" "version = \"${version}\""
'';
checkInputs = [ pytestCheckHook ];
# long_envvar_name_imports requires stable key value pair ordering
pytestFlagsArray = [ "-s src/canmatrix" ];
disabledTests = [ "long_envvar_name_imports" ];
pythonImportsCheck = [ "canmatrix" ];
2018-02-01 21:31:14 +00:00
meta = with lib; {
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 ];
};
}