nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 bleak,
4 bleak-retry-connector,
5 bluetooth-sensor-state-data,
6 buildPythonPackage,
7 events,
8 fetchFromGitHub,
9 freezegun,
10 home-assistant-bluetooth,
11 poetry-core,
12 pytest-asyncio_0,
13 pytest-cov-stub,
14 pytest-mock,
15 pytestCheckHook,
16 transitions,
17}:
18
19buildPythonPackage rec {
20 pname = "pysnooz";
21 version = "0.10.0";
22 pyproject = true;
23
24 src = fetchFromGitHub {
25 owner = "AustinBrunkhorst";
26 repo = "pysnooz";
27 tag = "v${version}";
28 hash = "sha256-jOXmaJprU35sdNRrBBx/YUyiDyyaE1qodWksXkTSEe0=";
29 };
30
31 patches = [
32 # https://github.com/AustinBrunkhorst/pysnooz/pull/20
33 ./bleak-compat.patch
34 ];
35
36 postPatch = ''
37 substituteInPlace pyproject.toml \
38 --replace-fail 'transitions = "^0.8.11"' 'transitions = ">=0.8.11"' \
39 --replace-fail 'Events = "^0.4"' 'Events = ">=0.4"'
40 '';
41
42 build-system = [ poetry-core ];
43
44 dependencies = [
45 bleak
46 bleak-retry-connector
47 bluetooth-sensor-state-data
48 events
49 home-assistant-bluetooth
50 transitions
51 ];
52
53 nativeCheckInputs = [
54 freezegun
55 pytest-asyncio_0
56 pytest-cov-stub
57 pytest-mock
58 pytestCheckHook
59 ];
60
61 pythonImportsCheck = [ "pysnooz" ];
62
63 meta = {
64 description = "Library to control SNOOZ white noise machines";
65 homepage = "https://github.com/AustinBrunkhorst/pysnooz";
66 changelog = "https://github.com/AustinBrunkhorst/pysnooz/blob/v${version}/CHANGELOG.md";
67 license = with lib.licenses; [ mit ];
68 maintainers = with lib.maintainers; [ fab ];
69 };
70}