diff --git a/packages/python/python-roborock/default.nix b/packages/python/python-roborock/default.nix new file mode 100644 index 0000000..5127be6 --- /dev/null +++ b/packages/python/python-roborock/default.nix @@ -0,0 +1,61 @@ +{ + lib, + stdenv, + fetchFromGitHub, + python3Packages, +}: + +python3Packages.buildPythonPackage rec { + pname = "python-roborock"; + version = "5.1.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "Python-roborock"; + repo = "python-roborock"; + tag = "v${version}"; + hash = "sha256-H642iHioX6bqReBj7QWI9W5mtvvguEO1lZedt+d8QvU="; + }; + + pythonRelaxDeps = [ + "protobuf" + "pycryptodome" + ]; + + build-system = with python3Packages; [ hatchling ]; + + dependencies = with python3Packages; [ + aiohttp + aiomqtt + click + construct + paho-mqtt + protobuf + pycryptodome + pyrate-limiter + vacuum-map-parser-roborock + click-shell + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin (with python3Packages; [ pycryptodomex ]); + + nativeCheckInputs = with python3Packages; [ + aioresponses + freezegun + pytest-asyncio + pytestCheckHook + syrupy + ]; + + __darwinAllowLocalNetworking = true; + + pythonImportsCheck = [ "roborock" ]; + + meta = { + description = "Python library & console tool for controlling Roborock vacuum"; + homepage = "https://github.com/Python-roborock/python-roborock"; + changelog = "https://github.com/Python-roborock/python-roborock/blob/${src.tag}/CHANGELOG.md"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ fab ]; + mainProgram = "roborock"; + }; +} \ No newline at end of file