Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

home-assistant: 0.115.6 -> 0.116.2; python3Packages.voluptuous: 0.11.7 -> 0.12.0; pythonPackages.yeelight: 0.5.3 -> 0.5.4 #99986

Merged
merged 7 commits into from
Oct 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pkgs/development/python-modules/voluptuous/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

buildPythonPackage rec {
pname = "voluptuous";
version = "0.11.7";
version = "0.12.0";

src = fetchPypi {
inherit pname version;
sha256 = "0mplkcpb5d8wjf8vk195fys4y6a3wbibiyf708imw33lphfk9g1a";
sha256 = "1p5j3fgbpqj31fajkaisdrz10ah9667sijz4kp3m0sbgw6ag4kis";
};

checkInputs = [ nose ];
checkPhase = ''
nosetests
'';

meta = with stdenv.lib; {
description = "Voluptuous is a Python data validation library";
Expand Down
35 changes: 28 additions & 7 deletions pkgs/development/python-modules/yeelight/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
{ stdenv, fetchPypi, buildPythonPackage, future, enum-compat }:
{ lib
, fetchgit
, buildPythonPackage
, pythonOlder
, enum-compat
, future
, ifaddr
, mock
, pytestCheckHook
}:

buildPythonPackage rec {
pname = "yeelight";
version = "0.5.3";
version = "0.5.4";

src = fetchPypi {
inherit pname version;
sha256 = "8d49846f0cede1e312cbcd1d0e44c42073910bbcadb31b87ce2a7d24dea3af38";
src = fetchgit {
url = "https://gitlab.com/stavros/python-yeelight.git";
rev = "119faeff0d4f9de8c7f6d0580bdecc1c79bcdaea"; # v0.5.4 wasn't tagged
sha256 = "0j2c5pzd3kny7ghr9q7xn9vs8dffvyzz5igaavvvd04w7aph29sy";
};

propagatedBuildInputs = [ future enum-compat ];
propagatedBuildInputs = [
future
ifaddr
] ++ lib.optional (pythonOlder "3.4") enum-compat;

meta = with stdenv.lib; {
checkInputs = [
pytestCheckHook
] ++ lib.optional (pythonOlder "3.3") mock;

pytestFlagsArray = [ "yeelight/tests.py" ];

pythonImportsCheck = [ "yeelight" ];

meta = with lib; {
description = "A Python library for controlling YeeLight RGB bulbs";
homepage = "https://gitlab.com/stavros/python-yeelight/";
license = licenses.asl20;
Expand Down
13 changes: 8 additions & 5 deletions pkgs/servers/home-assistant/component-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Do not edit!

{
version = "0.115.6";
version = "0.116.2";
components = {
"abode" = ps: with ps; [ abodepy ];
"accuweather" = ps: with ps; [ ]; # missing inputs: accuweather
Expand Down Expand Up @@ -303,6 +303,7 @@
"glances" = ps: with ps; [ ]; # missing inputs: glances_api
"gntp" = ps: with ps; [ ]; # missing inputs: gntp
"goalfeed" = ps: with ps; [ ]; # missing inputs: pysher
"goalzero" = ps: with ps; [ ]; # missing inputs: goalzero
"gogogate2" = ps: with ps; [ ]; # missing inputs: gogogate2-api
"google" = ps: with ps; [ google_api_python_client httplib2 oauth2client ];
"google_assistant" = ps: with ps; [ aiohttp-cors ];
Expand Down Expand Up @@ -364,7 +365,7 @@
"hunterdouglas_powerview" = ps: with ps; [ ]; # missing inputs: aiopvapi
"hvv_departures" = ps: with ps; [ ]; # missing inputs: pygti
"hydrawise" = ps: with ps; [ ]; # missing inputs: hydrawiser
"hyperion" = ps: with ps; [ ];
"hyperion" = ps: with ps; [ ]; # missing inputs: hyperion-py
"ialarm" = ps: with ps; [ ]; # missing inputs: pyialarm
"iammeter" = ps: with ps; [ ]; # missing inputs: iammeter
"iaqualink" = ps: with ps; [ ]; # missing inputs: iaqualink
Expand Down Expand Up @@ -565,7 +566,8 @@
"oem" = ps: with ps; [ ]; # missing inputs: oemthermostat
"ohmconnect" = ps: with ps; [ defusedxml ];
"ombi" = ps: with ps; [ ]; # missing inputs: pyombi
"onboarding" = ps: with ps; [ aiohttp-cors pillow ];
"omnilogic" = ps: with ps; [ ]; # missing inputs: omnilogic
"onboarding" = ps: with ps; [ aiohttp-cors pillow ]; # missing inputs: home-assistant-frontend
"onewire" = ps: with ps; [ ]; # missing inputs: pyownet
"onkyo" = ps: with ps; [ onkyo-eiscp ];
"onvif" = ps: with ps; [ ha-ffmpeg ]; # missing inputs: WSDiscovery onvif-zeep-async
Expand Down Expand Up @@ -682,6 +684,7 @@
"rpi_gpio" = ps: with ps; [ ]; # missing inputs: RPi.GPIO
"rpi_gpio_pwm" = ps: with ps; [ ]; # missing inputs: pwmled
"rpi_pfio" = ps: with ps; [ ]; # missing inputs: pifacecommon pifacedigitalio
"rpi_power" = ps: with ps; [ ]; # missing inputs: rpi-bad-power
"rpi_rf" = ps: with ps; [ ]; # missing inputs: rpi-rf
"rss_feed_template" = ps: with ps; [ aiohttp-cors ];
"rtorrent" = ps: with ps; [ ];
Expand Down Expand Up @@ -762,7 +765,7 @@
"spc" = ps: with ps; [ ]; # missing inputs: pyspcwebgw
"speedtestdotnet" = ps: with ps; [ speedtest-cli ];
"spider" = ps: with ps; [ ]; # missing inputs: spiderpy
"splunk" = ps: with ps; [ ];
"splunk" = ps: with ps; [ ]; # missing inputs: hass_splunk
"spotcrime" = ps: with ps; [ ]; # missing inputs: spotcrime
"spotify" = ps: with ps; [ aiohttp-cors spotipy ];
"sql" = ps: with ps; [ sqlalchemy ];
Expand Down Expand Up @@ -809,7 +812,6 @@
"tautulli" = ps: with ps; [ ]; # missing inputs: pytautulli
"tcp" = ps: with ps; [ ];
"ted5000" = ps: with ps; [ xmltodict ];
"teksavvy" = ps: with ps; [ ];
"telegram" = ps: with ps; [ pysocks aiohttp-cors python-telegram-bot ];
"telegram_bot" = ps: with ps; [ pysocks aiohttp-cors python-telegram-bot ];
"tellduslive" = ps: with ps; [ ]; # missing inputs: tellduslive
Expand Down Expand Up @@ -957,6 +959,7 @@
"zha" = ps: with ps; [ bellows pyserial zha-quirks zigpy-cc zigpy-deconz zigpy-xbee zigpy-zigate zigpy ]; # missing inputs: zigpy-znp
"zhong_hong" = ps: with ps; [ ]; # missing inputs: zhong_hong_hvac
"ziggo_mediabox_xl" = ps: with ps; [ ]; # missing inputs: ziggo-mediabox-xl
"zodiac" = ps: with ps; [ ];
"zone" = ps: with ps; [ ];
"zoneminder" = ps: with ps; [ zm-py ];
"zwave" = ps: with ps; [ homeassistant-pyozw pydispatcher ];
Expand Down
133 changes: 93 additions & 40 deletions pkgs/servers/home-assistant/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,29 @@
# self: super: { pkg = super.pkg.overridePythonAttrs (oldAttrs: { ... }); }
# Applied after defaultOverrides
, packageOverrides ? self: super: {
# TODO: Remove this override after updating to cryptography 2.8:

}

# Skip pip install of required packages on startup
, skipPip ? true }:

let

defaultOverrides = [
# Override the version of some packages pinned in Home Assistant's setup.py

# required by the sun/moon plugins
# Pinned due to API changes in astral>=2.0, required by the sun/moon plugins
# https://github.com/home-assistant/core/issues/36636
(mkOverride "astral" "1.10.1"
"d2a67243c4503131c856cafb1b1276de52a86e5b8a1d507b7e08bee51cb67bf1")

# We have 3.x in nixpkgs which is incompatible with home-assistant atm:
# https://github.com/home-assistant/core/blob/dev/requirements_all.txt
# Pinned due to an API change in pyowm>=3.0
# Remove after https://github.com/home-assistant/core/pull/39839 gets merged
(mkOverride "pyowm" "2.10.0"
"1xvcv3sbcn9na8cwz21nnjlixysfk5lymnf65d1nqkbgacc1mm4g")

(mkOverride "bcrypt" "3.1.7"
"0hhywhxx301cxivgxrpslrangbfpccc8y83qbwn1f57cab3nj00b")
# Pinned, because v1.5.0 broke the google_translate integration
# https://github.com/home-assistant/core/pull/38428
(mkOverride "yarl" "1.4.2"
"0jzpgrdl6415zzl8js7095q8ks14555lhgxah76mimffkr39rkaq")

# hass-frontend does not exist in python3.pkgs
(self: super: {
Expand Down Expand Up @@ -68,18 +67,14 @@ let
extraBuildInputs = extraPackages py.pkgs;

# Don't forget to run parse-requirements.py after updating
hassVersion = "0.115.6";
hassVersion = "0.116.2";

in with py.pkgs; buildPythonApplication rec {
pname = "homeassistant";
version = assert (componentPackages.version == hassVersion); hassVersion;

disabled = pythonOlder "3.5";

patches = [
./relax-dependencies.patch
./fix-media-path-test.patch
];
# check REQUIRED_PYTHON_VER in homeassistant/const.py
disabled = pythonOlder "3.7.1";

inherit availableComponents;

Expand All @@ -88,50 +83,108 @@ in with py.pkgs; buildPythonApplication rec {
owner = "home-assistant";
repo = "core";
rev = version;
sha256 = "07j54glcpa5ngkr0pwdg44f8gas3jz3nh653mr5sb5wg7xspgcr8";
sha256 = "0q4yqcikkph05mkvg160664lyf0f1qkpm7yc6kh9hgigambxi0yp";
};

patches = [
(fetchpatch {
# Fix group tests when run in parallel, remove >= 0.117.0
url = "https://github.com/home-assistant/core/pull/41446/commits/c79dc478b7136b6df43707bf0ad6b53419c8a909.patch";
sha256 = "1cl81swq960vd2f733dcqq60c0jjzrkm0l2sibcblhmyw597b4vj";
})
];

postPatch = ''
substituteInPlace setup.py \
--replace "yarl==1.4.2" "yarl~=1.4"
--replace "bcrypt==3.1.7" "bcrypt>=3.1.7" \
--replace "cryptography==2.9.2" "cryptography" \
--replace "ruamel.yaml==0.15.100" "ruamel.yaml>=0.15.100"
substituteInPlace tests/test_config.py --replace '"/usr"' '"/build/media"'
'';

propagatedBuildInputs = [
# From setup.py
aiohttp astral async-timeout attrs bcrypt certifi importlib-metadata jinja2
aiohttp astral async-timeout attrs bcrypt certifi ciso8601 jinja2
pyjwt cryptography pip python-slugify pytz pyyaml requests ruamel_yaml
setuptools voluptuous voluptuous-serialize
# From frontend, image, http and recorder components and auth.mfa_modules.totp
sqlalchemy aiohttp-cors hass-frontend pillow pyotp pyqrcode ciso8601
setuptools voluptuous voluptuous-serialize yarl
# From default_config. frontend, http, image, mobile_app and recorder components as well as
# the auth.mfa_modules.totp module
aiohttp-cors defusedxml distro emoji hass-frontend pynacl pillow pyotp
pyqrcode sqlalchemy
] ++ componentBuildInputs ++ extraBuildInputs;

# upstream only tests on Linux, so do we.
doCheck = stdenv.isLinux;

checkInputs = [
asynctest pytest pytest-aiohttp requests-mock hass-nabucasa netdisco pydispatcher
asynctest pytestCheckHook pytest-aiohttp pytest_xdist requests-mock hass-nabucasa netdisco pydispatcher
];

# We cannot test all components, since they'd introduce lots of dependencies, some of which are unpackaged,
# but we should test very common stuff, like what's in `default_config`.
componentTests = [
"api"
"automation"
"config"
"configurator"
"default_config"
"demo"
"discovery"
"frontend"
"group"
"history"
"homeassistant"
"http"
"input_boolean"
"input_datetime"
"input_text"
"input_number"
"input_select"
"logbook"
"logger"
"media_source"
"mobile_app"
"person"
"scene"
"script"
"shell_command"
"ssdp"
"sun"
"system_health"
"system_log"
"tag"
"websocket_api"
"zeroconf"
"zone"
];

checkPhase = ''
pytestFlagsArray = [
"-n auto"
# don't bulk test all components
"--ignore tests/components"
# prone to race conditions due to parallel file access
"--ignore tests/test_config.py"
# tries to import unpackaged dependencies
"--ignore tests/test_loader.py"
# pyotp since v2.4.0 complains about the short mock keys, hass pins v2.3.0
"--ignore tests/auth/mfa_modules/test_notify.py"
"tests"
] ++ map (component: "tests/components/" + component) componentTests;

disabledTests = [
# AssertionError: merge_log_err.call_count != 0
"test_merge"
# ModuleNotFoundError: No module named 'pyqwikswitch'
"test_merge_id_schema"
# AssertionError: assert 'unknown' == 'not_home'
"test_device_tracker_not_home"
# Racy https://github.com/home-assistant/core/issues/41425
"test_cached_event_message"
];

preCheck = ''
# the tests require the existance of a media dir
mkdir /build/media

# - components' dependencies are not included, so they cannot be tested
# - test_merge_id_schema requires pyqwikswitch
# - test_loader.py tries to load not-packaged dependencies
# - test_notify pyotp doesn't like the short mock keys
# - unclear why test_merge fails: assert merge_log_err.call_count != 0
# - test_setup_safe_mode_if_no_frontend: requires dependencies for components we have not packaged
py.test \
--ignore tests/components \
--ignore tests/test_loader.py \
--ignore tests/auth/mfa_modules/test_notify.py \
-k "not test_setup_safe_mode_if_no_frontend and not test_merge_id_schema and not test_merge"

# Some basic components should be tested however
py.test \
tests/components/{api,config,configurator,demo,discovery,frontend,group,history} \
tests/components/{homeassistant,http,logger,script,shell_command,system_log,websocket_api}
'';

makeWrapperArgs = lib.optional skipPip "--add-flags --skip-pip";
Expand Down
24 changes: 0 additions & 24 deletions pkgs/servers/home-assistant/fix-media-path-test.patch

This file was deleted.

4 changes: 2 additions & 2 deletions pkgs/servers/home-assistant/frontend.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ buildPythonPackage rec {
# the frontend version corresponding to a specific home-assistant version can be found here
# https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/frontend/manifest.json
pname = "home-assistant-frontend";
version = "20200918.2";
version = "20201001.2";

src = fetchPypi {
inherit pname version;
sha256 = "1gmk5rbfyqanj30dinfphxrsji4l1yiya2p0ahybyjb9fbzz9cl4";
sha256 = "1wyac980d8j8bk4bzh9y3a5c4xqfn3062wj5m45kwsx1f5rfx26j";
};

# no Python tests implemented
Expand Down
21 changes: 0 additions & 21 deletions pkgs/servers/home-assistant/relax-dependencies.patch

This file was deleted.