depot/third_party/nixpkgs/pkgs/development/python-modules/pylacrosse/default.nix
Default email 5ca88bfbb9 Project import generated by Copybara.
GitOrigin-RevId: 9f918d616c5321ad374ae6cb5ea89c9e04bf3e58
2024-07-31 10:19:44 +00:00

55 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
fetchpatch2,
mock,
pyserial,
pytestCheckHook,
pythonOlder,
}:
buildPythonPackage rec {
pname = "pylacrosse";
version = "0.4";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "hthiery";
repo = "python-lacrosse";
rev = "refs/tags/${version}";
hash = "sha256-jrkehoPLYbutDfxMBO/vlx4nMylTNs/gtvoBTFHFsDw=";
};
patches = [
# Migrate to pytest, https://github.com/hthiery/python-lacrosse/pull/17
(fetchpatch2 {
url = "https://github.com/hthiery/python-lacrosse/commit/cc2623c667bc252360a9b5ccb4fc05296cf23d9c.patch?full_index=1";
hash = "sha256-LKryLnXMKj1lVClneyHNVOWM5KPPhOGy0/FX/7Qy/jU=";
})
];
postPatch = ''
substituteInPlace setup.py \
--replace "version = version," "version = '${version}',"
'';
propagatedBuildInputs = [ pyserial ];
nativeCheckInputs = [
mock
pytestCheckHook
];
pythonImportsCheck = [ "pylacrosse" ];
meta = with lib; {
description = "Python library for Jeelink LaCrosse";
mainProgram = "pylacrosse";
homepage = "https://github.com/hthiery/python-lacrosse";
license = with licenses; [ lgpl2Plus ];
maintainers = with maintainers; [ fab ];
};
}