From a2f9a5287d061f483d7ca1b2fdc7ed2e35cb8fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 2 Aug 2019 17:59:47 +0300 Subject: [PATCH] Azure mypy related tweaks (#25663) * Revert "Add some debugging to azure mypy job (#25632)" This reverts commit 767b8e9f25affbebb98d65f57c0d78b532a951ba. No longer needed. * Install setup.py dependencies for mypy in Azure For better coverage, and to match what tox does. --- azure-pipelines-ci.yml | 5 +---- homeassistant/util/ruamel_yaml.py | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/azure-pipelines-ci.yml b/azure-pipelines-ci.yml index eef4731c4ac..1e3d914aaf0 100644 --- a/azure-pipelines-ci.yml +++ b/azure-pipelines-ci.yml @@ -201,19 +201,16 @@ stages: container: $[ variables['PythonMain'] ] steps: - script: | - set -x python -m venv venv . venv/bin/activate + pip install -e . pip install -r requirements_test.txt -c homeassistant/package_constraints.txt displayName: 'Setup Env' - script: | - set -x TYPING_FILES=$(cat mypyrc) echo -e "Run mypy on: \n$TYPING_FILES" . venv/bin/activate - python --version - mypy --version mypy $TYPING_FILES displayName: 'Run mypy' diff --git a/homeassistant/util/ruamel_yaml.py b/homeassistant/util/ruamel_yaml.py index 04a98a84f03..931ad7adb91 100644 --- a/homeassistant/util/ruamel_yaml.py +++ b/homeassistant/util/ruamel_yaml.py @@ -88,7 +88,8 @@ def load_yaml(fname: str, round_trip: bool = False) -> JSON_TYPE: """Load a YAML file.""" if round_trip: yaml = YAML(typ="rt") - yaml.preserve_quotes = True + # type ignore: https://bitbucket.org/ruamel/yaml/pull-requests/42 + yaml.preserve_quotes = True # type: ignore else: if ExtSafeConstructor.name is None: ExtSafeConstructor.name = fname