From f626e31fd3acb4f71e89c8258f7a946201d981c6 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 25 Jul 2018 01:52:24 +0200 Subject: [PATCH 1/5] Bump version 122 --- hassio/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hassio/const.py b/hassio/const.py index fd868d855..298a211c1 100644 --- a/hassio/const.py +++ b/hassio/const.py @@ -2,7 +2,7 @@ from pathlib import Path from ipaddress import ip_network -HASSIO_VERSION = '121' +HASSIO_VERSION = '122' URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons" URL_HASSIO_VERSION = \ From a0fb91af29bf6e82efdf86409df2b9a9d0cbeefc Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Fri, 27 Jul 2018 16:34:47 +0200 Subject: [PATCH 2/5] Use requirements.txt (#607) * Create requirements.txt * Update setup.py * Update Dockerfile * Update Dockerfile * Update requirements.txt * Update requirements.txt * Update Dockerfile * Update tox.ini --- Dockerfile | 9 ++++----- requirements.txt | 13 +++++++++++++ setup.py | 15 +-------------- tox.ini | 1 + 4 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile index f62123fcd..6d3cd2521 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ FROM $BUILD_FROM ENV LANG C.UTF-8 # Setup base +COPY requirements.txt /usr/src/ RUN apk add --no-cache \ git \ socat \ @@ -14,11 +15,9 @@ RUN apk add --no-cache \ && apk add --no-cache --virtual .build-dependencies \ make \ g++ \ - && pip3 install --no-cache-dir \ - uvloop==0.11.0 \ - cchardet==2.1.1 \ - pycryptodome==3.6.4 \ - && apk del .build-dependencies + && pip3 install -r /usr/src/requirements.txt \ + && apk del .build-dependencies \ + && rm -f /usr/src/requirements.txt # Install HassIO COPY . /usr/src/hassio diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..a3104bcf7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,13 @@ +attr==0.3.1 +async_timeout==3.0.0 +aiohttp==3.3.2 +docker==3.4.0 +colorlog==3.1.2 +voluptuous==0.11.1 +gitpython==2.1.10 +pytz==2018.4 +pyudev==0.21.0 +pycryptodome==3.6.4 +cpe==1.2.1 +uvloop==0.11.0 +cchardet==2.1.1 diff --git a/setup.py b/setup.py index 8214c8a27..f3c44cd9d 100644 --- a/setup.py +++ b/setup.py @@ -38,18 +38,5 @@ setup( 'hassio.utils', 'hassio.snapshots' ], - include_package_data=True, - install_requires=[ - 'attr==0.3.1', - 'async_timeout==3.0.0', - 'aiohttp==3.3.2', - 'docker==3.4.0', - 'colorlog==3.1.2', - 'voluptuous==0.11.1', - 'gitpython==2.1.10', - 'pytz==2018.4', - 'pyudev==0.21.0', - 'pycryptodome==3.6.4', - "cpe==1.2.1" - ] + include_package_data=True ) diff --git a/tox.ini b/tox.ini index 734921741..e2aff7381 100644 --- a/tox.ini +++ b/tox.ini @@ -5,6 +5,7 @@ envlist = lint deps = flake8==3.5.0 pylint==2.0.0 + -r{toxinidir}/requirements.txt [testenv:lint] basepython = python3 From 2c17fe5da890e84ff79765701dec113f7adbb4a9 Mon Sep 17 00:00:00 2001 From: Simon Holzmayer Date: Mon, 30 Jul 2018 12:34:42 +0200 Subject: [PATCH 3/5] Adapt regex validation to allow docker images from other registries (#608) * Adapt regex validation to allow images from other registries than dockerhub Issue #564 * Update validate.py --- hassio/addons/validate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hassio/addons/validate.py b/hassio/addons/validate.py index 55afc55e8..c77a809c7 100644 --- a/hassio/addons/validate.py +++ b/hassio/addons/validate.py @@ -129,7 +129,8 @@ SCHEMA_ADDON_CONFIG = vol.Schema({ vol.Coerce(str): vol.Any(SCHEMA_ELEMENT, [SCHEMA_ELEMENT]) })) }), False), - vol.Optional(ATTR_IMAGE): vol.Match(r"^[\w{}]+/[\-\w{}]+$"), + vol.Optional(ATTR_IMAGE): + vol.Match(r"^([a-zA-Z.:\d{}]+/)*?([\w{}]+)/([\-\w{}]+)$"), vol.Optional(ATTR_TIMEOUT, default=10): vol.All(vol.Coerce(int), vol.Range(min=10, max=120)), }, extra=vol.REMOVE_EXTRA) From ae7466ccfefc60e0de72ad792ca8a8923ced67da Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 2 Aug 2018 21:48:50 +0200 Subject: [PATCH 4/5] Fix UnicodeDecodeError with read json file (#613) * Update json.py * Update data.py --- hassio/addons/data.py | 2 +- hassio/utils/json.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hassio/addons/data.py b/hassio/addons/data.py index bafc2db88..185f2f33a 100644 --- a/hassio/addons/data.py +++ b/hassio/addons/data.py @@ -80,7 +80,7 @@ class AddonsData(JsonConfig, CoreSysAttributes): read_json_file(repository_file) ) - except (OSError, json.JSONDecodeError): + except (OSError, json.JSONDecodeError, UnicodeDecodeError): _LOGGER.warning("Can't read repository information from %s", repository_file) return diff --git a/hassio/utils/json.py b/hassio/utils/json.py index 93eb482c2..373ff60cd 100644 --- a/hassio/utils/json.py +++ b/hassio/utils/json.py @@ -45,7 +45,7 @@ class JsonConfig: if self._file.is_file(): try: self._data = read_json_file(self._file) - except (OSError, json.JSONDecodeError): + except (OSError, json.JSONDecodeError, UnicodeDecodeError): _LOGGER.warning("Can't read %s", self._file) self._data = {} From 9430b390429b16c146f9148f36d22f90927b5e90 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 2 Aug 2018 23:18:40 +0200 Subject: [PATCH 5/5] Update uvloop version 0.11.1 (#614) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a3104bcf7..f1df28229 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,5 +9,5 @@ pytz==2018.4 pyudev==0.21.0 pycryptodome==3.6.4 cpe==1.2.1 -uvloop==0.11.0 +uvloop==0.11.1 cchardet==2.1.1