depot/third_party/nixpkgs/pkgs/development/python-modules/can/default.nix
Default email 4cb23072fc Project import generated by Copybara.
GitOrigin-RevId: 6d8215281b2f87a5af9ed7425a26ac575da0438f
2022-01-20 00:45:15 +01:00

75 lines
1.4 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, future
, hypothesis
, parameterized
, msgpack
, pyserial
, pytest-timeout
, pytestCheckHook
, pythonOlder
, typing-extensions
, wrapt
}:
buildPythonPackage rec {
pname = "python-can";
version = "unstable-2022-01-11";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "hardbyte";
repo = pname;
rev = "2e24af08326ecd69fba9f02fed7b9c26f233c92b";
hash = "sha256-ZP5qtbjDtBZ2uT9DOSvSnfHyTlirr0oCEXhiLO1ydz0=";
};
propagatedBuildInputs = [
msgpack
pyserial
typing-extensions
wrapt
];
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"
];
preCheck = ''
export PATH="$PATH:$out/bin";
'';
pythonImportsCheck = [
"can"
];
meta = with lib; {
description = "CAN support for Python";
homepage = "python-can.readthedocs.io";
license = licenses.lgpl3Only;
maintainers = with maintainers; [ fab sorki ];
};
}