depot/third_party/nixpkgs/pkgs/development/python-modules/pyzerproc/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

58 lines
1.1 KiB
Nix

{
lib,
bleak,
click,
buildPythonPackage,
fetchFromGitHub,
pytest-asyncio,
pytest-mock,
pythonAtLeast,
pytestCheckHook,
pythonOlder,
}:
buildPythonPackage rec {
pname = "pyzerproc";
version = "0.4.12";
format = "setuptools";
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "emlove";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-vS0sk/KjDhWispZvCuGlmVLLfeFymHqxwNzNqNRhg6k=";
};
postPatch = ''
sed -i "/--cov/d" setup.cfg
'';
propagatedBuildInputs = [
bleak
click
];
nativeCheckInputs = [
pytest-asyncio
pytest-mock
pytestCheckHook
];
disabledTestPaths = lib.optionals (pythonAtLeast "3.11") [
# unittest.mock.InvalidSpecError: Cannot spec a Mock object.
"tests/test_light.py"
];
pythonImportsCheck = [ "pyzerproc" ];
meta = with lib; {
description = "Python library to control Zerproc Bluetooth LED smart string lights";
mainProgram = "pyzerproc";
homepage = "https://github.com/emlove/pyzerproc";
license = with licenses; [ asl20 ];
maintainers = with maintainers; [ fab ];
platforms = platforms.linux;
};
}