From 380ca13be1ee0094c532dcd11c1172c68db7c8e0 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 30 Oct 2019 23:18:04 +0100 Subject: [PATCH] Pin Black (#1355) * Pin black version * fix devcontainer --- .devcontainer/Dockerfile | 2 +- azure-pipelines.yml | 12 ------------ hassio/utils/tar.py | 2 +- requirements_tests.txt | 1 + tox.ini | 7 ++++++- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 18b012145..d48100d8d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -36,7 +36,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Install Python dependencies from requirements.txt if it exists COPY requirements.txt requirements_tests.txt ./ RUN pip3 install -r requirements.txt -r requirements_tests.txt \ - && pip3 install black tox \ + && pip3 install tox \ && rm -f requirements.txt requirements_tests.txt # Set the default shell to bash instead of sh diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5a1eb8e35..6502004ab 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -42,18 +42,6 @@ stages: displayName: 'Install Tox' - script: tox displayName: 'Run Tox' - - job: 'Black' - pool: - vmImage: 'ubuntu-latest' - steps: - - task: UsePythonVersion@0 - displayName: 'Use Python $(python.version)' - inputs: - versionSpec: '3.7' - - script: pip install black - displayName: 'Install black' - - script: black --target-version py37 --check hassio tests - displayName: 'Run Black' - job: 'JQ' pool: vmImage: 'ubuntu-latest' diff --git a/hassio/utils/tar.py b/hassio/utils/tar.py index 27f12fa94..0ffd97cf9 100644 --- a/hassio/utils/tar.py +++ b/hassio/utils/tar.py @@ -134,7 +134,7 @@ def secure_path(tar: tarfile.TarFile) -> Generator[tarfile.TarInfo, None, None]: def exclude_filter( - exclude_list: List[str] + exclude_list: List[str], ) -> Callable[[tarfile.TarInfo], Optional[tarfile.TarInfo]]: """Create callable filter function to check TarInfo for add.""" diff --git a/requirements_tests.txt b/requirements_tests.txt index 4cf87e285..0e79b2c23 100644 --- a/requirements_tests.txt +++ b/requirements_tests.txt @@ -3,3 +3,4 @@ pylint==2.4.3 pytest==5.2.2 pytest-timeout==1.3.3 pytest-aiohttp==0.3.0 +black==19.10b0 diff --git a/tox.ini b/tox.ini index 99aa3aa26..320d34d6c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = lint, tests +envlist = lint, tests, black [testenv] deps = @@ -17,3 +17,8 @@ commands = basepython = python3 commands = pytest --timeout=10 tests + +[testenv:black] +basepython = python3 +commands = + black --target-version py37 --check hassio tests setup.py