From a68b28ec9909abecf610ae19106fba3da1186648 Mon Sep 17 00:00:00 2001 From: Ruslan Sayfutdinov Date: Sun, 16 May 2021 19:20:04 +0100 Subject: [PATCH 1/2] Downgrade setuptools to fix CI --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fe14e44beedfc4..a68aaa549c6d0b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,7 +56,7 @@ jobs: run: | python -m venv venv . venv/bin/activate - pip install -U "pip<20.3" setuptools + pip install -U "pip<20.3" "setuptools<56.2" pip install -r requirements.txt -r requirements_test.txt - name: Generate partial pre-commit restore key id: generate-pre-commit-key @@ -580,7 +580,7 @@ jobs: python -m venv venv . venv/bin/activate - pip install -U "pip<20.3" setuptools wheel + pip install -U "pip<20.3" "setuptools<56.2" wheel pip install -r requirements_all.txt pip install -r requirements_test.txt pip install -e . From 5c2c92d064fa4303c211a131bfcba51043119364 Mon Sep 17 00:00:00 2001 From: Ruslan Sayfutdinov Date: Sun, 16 May 2021 19:41:21 +0100 Subject: [PATCH 2/2] Fix jinja2 typing --- homeassistant/helpers/template.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/homeassistant/helpers/template.py b/homeassistant/helpers/template.py index 6ac220788e0335..40101e17128b87 100644 --- a/homeassistant/helpers/template.py +++ b/homeassistant/helpers/template.py @@ -24,7 +24,7 @@ import jinja2 from jinja2 import contextfilter, contextfunction from jinja2.sandbox import ImmutableSandboxedEnvironment -from jinja2.utils import Namespace # type: ignore +from jinja2.utils import Namespace import voluptuous as vol from homeassistant.const import ( @@ -581,9 +581,8 @@ def _ensure_compiled( self._strict = strict env = self._env - self._compiled = cast( - jinja2.Template, - jinja2.Template.from_code(env, self._compiled_code, env.globals, None), + self._compiled = jinja2.Template.from_code( + env, self._compiled_code, env.globals, None ) return self._compiled