2018-02-01 22:30:26 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-01-14 11:03:47 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, future
|
|
|
|
, hypothesis
|
2022-04-23 23:04:12 +02:00
|
|
|
, packaging
|
2022-01-14 11:03:47 +01:00
|
|
|
, parameterized
|
|
|
|
, msgpack
|
|
|
|
, pyserial
|
|
|
|
, pytest-timeout
|
|
|
|
, pytestCheckHook
|
2019-03-01 18:01:51 +01:00
|
|
|
, pythonOlder
|
2022-01-14 11:03:47 +01:00
|
|
|
, typing-extensions
|
2018-07-24 17:28:26 +02:00
|
|
|
, wrapt
|
2022-01-14 11:03:47 +01:00
|
|
|
}:
|
2018-02-01 22:30:26 +01:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-can";
|
2022-03-08 23:18:16 +01:00
|
|
|
version = "4.0.0";
|
2022-01-14 11:03:47 +01:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2018-02-01 22:30:26 +01:00
|
|
|
|
2022-01-14 11:03:47 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hardbyte";
|
|
|
|
repo = pname;
|
2022-03-08 23:18:16 +01:00
|
|
|
rev = version;
|
|
|
|
hash = "sha256-/z7zBfVbO7x4UtzWOXolH2YrtYWgsvRLObWwz8sqOEc=";
|
2018-02-01 22:30:26 +01:00
|
|
|
};
|
|
|
|
|
2022-01-14 11:03:47 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
msgpack
|
2022-04-23 23:04:12 +02:00
|
|
|
packaging
|
2022-01-14 11:03:47 +01:00
|
|
|
pyserial
|
|
|
|
typing-extensions
|
|
|
|
wrapt
|
|
|
|
];
|
2019-09-07 13:54:16 +02:00
|
|
|
|
2022-01-14 11:03:47 +01:00
|
|
|
checkInputs = [
|
|
|
|
future
|
|
|
|
hypothesis
|
|
|
|
parameterized
|
|
|
|
pytest-timeout
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tox.ini \
|
|
|
|
--replace " --cov=can --cov-config=tox.ini --cov-report=xml --cov-report=term" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# We don't support all interfaces
|
|
|
|
"test/test_interface_canalystii.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests require access socket
|
|
|
|
"BasicTestUdpMulticastBusIPv4"
|
|
|
|
"BasicTestUdpMulticastBusIPv6"
|
2022-03-08 23:18:16 +01:00
|
|
|
# pytest.approx is not supported in a boolean context (since pytest7)
|
|
|
|
"test_pack_unpack"
|
|
|
|
"test_receive"
|
2022-01-14 11:03:47 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export PATH="$PATH:$out/bin";
|
2018-07-24 17:28:26 +02:00
|
|
|
'';
|
2018-02-01 22:30:26 +01:00
|
|
|
|
2022-01-14 11:03:47 +01:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"can"
|
|
|
|
];
|
|
|
|
|
2018-02-01 22:30:26 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "CAN support for Python";
|
2022-04-30 02:57:49 +02:00
|
|
|
homepage = "https://python-can.readthedocs.io";
|
2022-01-14 11:03:47 +01:00
|
|
|
license = licenses.lgpl3Only;
|
|
|
|
maintainers = with maintainers; [ fab sorki ];
|
2018-02-01 22:30:26 +01:00
|
|
|
};
|
|
|
|
}
|