diff --git a/pkgs/development/python-modules/locationsharinglib/default.nix b/pkgs/development/python-modules/locationsharinglib/default.nix new file mode 100644 index 00000000000..4baf8600ac7 --- /dev/null +++ b/pkgs/development/python-modules/locationsharinglib/default.nix @@ -0,0 +1,59 @@ +{ lib +, betamax +, buildPythonPackage +, cachetools +, coloredlogs +, emoji +, fetchPypi +, nose +, python +, pythonOlder +, pytz +, requests +}: + +buildPythonPackage rec { + pname = "locationsharinglib"; + version = "4.1.6"; + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "092j8z01nwjqh5zr7aj8mxl1zjd3j2irhrs39dhn47bd6db2a6ij"; + }; + + propagatedBuildInputs = [ + coloredlogs + requests + cachetools + pytz + ]; + + checkInputs = [ + betamax + emoji + nose + ]; + + postPatch = '' + # Tests requirements want to pull in multiple modules which we don't need + substituteInPlace setup.py \ + --replace "tests_require=test_requirements" "tests_require=[]" + ''; + + checkPhase = '' + runHook preCheck + # Only coverage no real unit tests + ${python.interpreter} setup.py nosetests + runHook postCheck + ''; + + pythonImportsCheck = [ "locationsharinglib" ]; + + meta = with lib; { + description = "Python package to retrieve coordinates from a Google account"; + homepage = "https://locationsharinglib.readthedocs.io/"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 2bd83d9109a..afdf3be0acd 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -316,7 +316,7 @@ "google_assistant" = ps: with ps; [ aiohttp-cors ]; "google_cloud" = ps: with ps; [ google-cloud-texttospeech ]; "google_domains" = ps: with ps; [ ]; - "google_maps" = ps: with ps; [ ]; # missing inputs: locationsharinglib + "google_maps" = ps: with ps; [ locationsharinglib ]; "google_pubsub" = ps: with ps; [ google-cloud-pubsub ]; "google_translate" = ps: with ps; [ gtts ]; "google_travel_time" = ps: with ps; [ googlemaps ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a19467bf259..7bd3aa5da99 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3967,6 +3967,8 @@ in { localzone = callPackage ../development/python-modules/localzone { }; + locationsharinglib = callPackage ../development/python-modules/locationsharinglib { }; + locket = callPackage ../development/python-modules/locket { }; lockfile = callPackage ../development/python-modules/lockfile { };