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

46 lines
1 KiB
Nix
Raw Normal View History

2018-02-01 22:30:26 +01:00
{ lib
, buildPythonPackage
2019-09-07 13:54:16 +02:00
, fetchPypi
2019-03-01 18:01:51 +01:00
, pythonOlder
2019-09-07 13:54:16 +02:00
, isPy27
, aenum
2018-07-24 17:28:26 +02:00
, wrapt
2019-03-01 18:01:51 +01:00
, typing
2018-02-01 22:30:26 +01:00
, pyserial
, nose
2018-07-24 17:28:26 +02:00
, mock
2019-03-01 18:01:51 +01:00
, hypothesis
, future
2018-07-24 17:28:26 +02:00
, pytest
, pytest-timeout }:
2018-02-01 22:30:26 +01:00
buildPythonPackage rec {
pname = "python-can";
2019-09-07 13:54:16 +02:00
version = "3.3.1";
2018-02-01 22:30:26 +01:00
2019-09-07 13:54:16 +02:00
src = fetchPypi {
inherit pname version;
sha256 = "1giv9s6w90lalxsijgnxzynygkckcfyaxnxsldbwv0784vwy1jcd";
2018-02-01 22:30:26 +01:00
};
2019-09-07 13:54:16 +02:00
propagatedBuildInputs = [ wrapt pyserial aenum ] ++ lib.optional (pythonOlder "3.5") typing;
2019-03-01 18:01:51 +01:00
checkInputs = [ nose mock pytest pytest-timeout hypothesis future ];
2018-07-24 17:28:26 +02:00
2019-09-07 13:54:16 +02:00
# Tests won't work with hypothesis 4.7.3 under Python 2. So skip the tests in
# that case. This clause can be removed once hypothesis has been upgraded in
# nixpkgs.
doCheck = !(isPy27 && (hypothesis.version == "4.7.3"));
2019-03-01 18:01:51 +01:00
# Add the scripts to PATH
2018-07-24 17:28:26 +02:00
checkPhase = ''
2019-03-01 18:01:51 +01:00
PATH=$out/bin:$PATH pytest -c /dev/null
2018-07-24 17:28:26 +02:00
'';
2018-02-01 22:30:26 +01:00
meta = with lib; {
homepage = https://github.com/hardbyte/python-can;
description = "CAN support for Python";
license = licenses.lgpl3;
maintainers = with maintainers; [ sorki ];
};
}