Skip to content

Commit

Permalink
home-assistant: add icloud support (NixOS#78109)
Browse files Browse the repository at this point in the history
home-assistant: add icloud support
  • Loading branch information
Mic92 authored Jan 21, 2020
2 parents 2b47531 + 1d24ce5 commit e48d9e6
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 3 deletions.
51 changes: 51 additions & 0 deletions pkgs/development/python-modules/pyicloud/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{ lib
, buildPythonPackage
, fetchPypi
, requests
, keyring
, keyrings-alt
, click
, six
, tzlocal
, certifi
, bitstring
, unittest2
}:

buildPythonPackage rec {
pname = "pyicloud";
version = "0.9.1";

src = fetchPypi {
inherit pname version;
sha256 = "580b52e95f67a41ed86c56a514aa2b362f53fbaf23f16c69fb24e0d19fd373ee";
};

propagatedBuildInputs = [
requests
keyring
keyrings-alt
click
six
tzlocal
certifi
bitstring
];

checkInputs = [ unittest2 ];

postPatch = ''
sed -i \
-e 's!click>=6.0,<7.0!click!' \
-e 's!keyring>=8.0,<9.0!keyring!' \
-e 's!keyrings.alt>=1.0,<2.0!keyrings.alt!' \
requirements.txt
'';

meta = with lib; {
description = "PyiCloud is a module which allows pythonistas to interact with iCloud webservices";
homepage = https://github.com/picklepete/pyicloud;
license = licenses.mit;
maintainers = [ maintainers.mic92 ];
};
}
5 changes: 3 additions & 2 deletions pkgs/development/python-modules/snitun/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, buildPythonPackage, python, fetchFromGitHub, attrs, cryptography, async-timeout, pytest-aiohttp, pytest }:
{ lib, stdenv, buildPythonPackage, python, fetchFromGitHub, attrs, cryptography, async-timeout, pytest-aiohttp, pytest }:

buildPythonPackage rec {
pname = "snitun";
Expand All @@ -16,7 +16,8 @@ buildPythonPackage rec {
checkInputs = [ pytest pytest-aiohttp ];

checkPhase = ''
pytest tests/
# https://github.com/NabuCasa/snitun/issues/61
pytest ${lib.optionalString stdenv.isDarwin "-k 'not test_multiplexer_data_channel_abort_full'"} tests/
'';

meta = with lib; {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/servers/home-assistant/component-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
"hyperion" = ps: with ps; [ ];
"ialarm" = ps: with ps; [ ];
"iaqualink" = ps: with ps; [ ];
"icloud" = ps: with ps; [ ];
"icloud" = ps: with ps; [ pyicloud ];
"idteck_prox" = ps: with ps; [ ];
"ifttt" = ps: with ps; [ aiohttp-cors pyfttt ];
"iglo" = ps: with ps; [ ];
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,8 @@ in {

pdfx = callPackage ../development/python-modules/pdfx { };

pyicloud = callPackage ../development/python-modules/pyicloud { };

pyperf = callPackage ../development/python-modules/pyperf { };

pefile = callPackage ../development/python-modules/pefile { };
Expand Down

0 comments on commit e48d9e6

Please sign in to comment.