Add cache for mypy (#27745)

* Add cache for mypy

* Update ruamel_yaml.py
pull/27751/head
Pascal Vizeli 2019-10-16 17:37:24 +02:00 committed by GitHub
parent a1b8f4d9c3
commit 8a0f26e155
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -172,13 +172,14 @@ stages:
vmImage: 'ubuntu-latest'
container: $[ variables['PythonMain'] ]
steps:
- script: |
python -m venv venv
- template: templates/azp-step-cache.yaml@azure
parameters:
keyfile: 'requirements_test.txt | homeassistant/package_constraints.txt'
build: |
python -m venv venv
. venv/bin/activate
pip install -e .
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
displayName: 'Setup Env'
. venv/bin/activate
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
- script: |
. venv/bin/activate
mypy homeassistant

View File

@ -90,7 +90,7 @@ def load_yaml(fname: str, round_trip: bool = False) -> JSON_TYPE:
if round_trip:
yaml = YAML(typ="rt")
# type ignore: https://bitbucket.org/ruamel/yaml/pull-requests/42
yaml.preserve_quotes = True # type: ignore
yaml.preserve_quotes = True
else:
if ExtSafeConstructor.name is None:
ExtSafeConstructor.name = fname