From 64ce0f82881fed94f936c9a869c534025ea803ee Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Fri, 30 Aug 2019 15:48:45 +0200 Subject: [PATCH 1/8] Bump version 1.4 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index af5ee20e..89423267 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -VERSION = "1.3" +VERSION = "1.4" setup( name="builder", From a2dcdfce57987dba540299679671c63b6c135f59 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2019 17:20:38 +0200 Subject: [PATCH 2/8] Bump numpy from 1.17.1 to 1.17.2 (#39) Bumps [numpy](https://github.com/numpy/numpy) from 1.17.1 to 1.17.2. - [Release notes](https://github.com/numpy/numpy/releases) - [Changelog](https://github.com/numpy/numpy/blob/master/doc/HOWTO_RELEASE.rst.txt) - [Commits](https://github.com/numpy/numpy/compare/v1.17.1...v1.17.2) Signed-off-by: dependabot-preview[bot] --- requirements_build.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_build.txt b/requirements_build.txt index 86a56194..cb4061b9 100644 --- a/requirements_build.txt +++ b/requirements_build.txt @@ -1,2 +1,2 @@ Cython==0.29.13 -numpy==1.17.1 +numpy==1.17.2 From 9ef06f5ad23258aab21a83df4f459e13b381895a Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Tue, 24 Sep 2019 17:48:51 +0200 Subject: [PATCH 3/8] Update pylint (#41) * Update pylint * Fix --- azure-pipelines.yml | 16 ---------------- builder/apk.py | 6 ++---- builder/pip.py | 24 ++++++++---------------- builder/upload/rsync.py | 6 ++---- requirements_tests.txt | 3 ++- tox.ini | 6 +++++- 6 files changed, 19 insertions(+), 42 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 86041cbc..f6a2ced7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,8 +9,6 @@ trigger: tags: include: - '*' - exclude: - - untagged* pr: - dev variables: @@ -55,20 +53,6 @@ jobs: displayName: 'Run Hadolint' -- 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 --check builder - displayName: 'Run Black' - - - template: templates/azp-job-wheels.yaml@azure parameters: jobName: 'Wheels_Alpine39' diff --git a/builder/apk.py b/builder/apk.py index 79262648..fea65244 100644 --- a/builder/apk.py +++ b/builder/apk.py @@ -7,12 +7,10 @@ def install_apks(apks: str) -> None: """Install all apk string formated as 'package1;package2'.""" packages = " ".join(apks.split(";")) - result = subprocess.run( + subprocess.run( f"apk add --no-cache {packages}", shell=True, + check=True, stdout=sys.stdout, stderr=sys.stderr, ) - - # Check result of program - result.check_returncode() diff --git a/builder/pip.py b/builder/pip.py index 9a59555f..b37ca001 100644 --- a/builder/pip.py +++ b/builder/pip.py @@ -14,17 +14,15 @@ def build_wheels_package(package: str, index: str, output: Path) -> None: build_env = os.environ.copy() build_env["MAKEFLAGS"] = f"-j{cpu}" - result = subprocess.run( + subprocess.run( f'pip3 wheel --progress-bar ascii --wheel-dir {output} --find-links {index} "{package}"', shell=True, + check=True, stdout=sys.stdout, stderr=sys.stderr, env=build_env, ) - # Check result of program - result.check_returncode() - def build_wheels_requirement(requirement: Path, index: str, output: Path) -> None: """Build wheels from a requirements file into output.""" @@ -34,17 +32,15 @@ def build_wheels_requirement(requirement: Path, index: str, output: Path) -> Non build_env = os.environ.copy() build_env["MAKEFLAGS"] = f"-j{cpu}" - result = subprocess.run( + subprocess.run( f"pip3 wheel --progress-bar ascii --wheel-dir {output} --find-links {index} --requirement {requirement}", shell=True, + check=True, stdout=sys.stdout, stderr=sys.stderr, env=build_env, ) - # Check result of program - result.check_returncode() - def build_wheels_local(index: str, output: Path) -> None: """Build wheels from a requirements file into output.""" @@ -54,17 +50,15 @@ def build_wheels_local(index: str, output: Path) -> None: build_env = os.environ.copy() build_env["MAKEFLAGS"] = f"-j{cpu}" - result = subprocess.run( + subprocess.run( f"pip3 wheel --progress-bar ascii --wheel-dir {output} --find-links {index} .", shell=True, + check=True, stdout=sys.stdout, stderr=sys.stderr, env=build_env, ) - # Check result of program - result.check_returncode() - def parse_requirements(requirement: Path) -> List[str]: """Parse a requirement files into an array.""" @@ -102,12 +96,10 @@ def install_pips(index: str, pips: str) -> None: """Install all pipy string formated as 'package1;package2'.""" packages = " ".join(pips.split(";")) - result = subprocess.run( + subprocess.run( f"pip install --upgrade --no-cache-dir --prefer-binary --find-links {index} {packages}", shell=True, + check=True, stdout=sys.stdout, stderr=sys.stderr, ) - - # Check result of program - result.check_returncode() diff --git a/builder/upload/rsync.py b/builder/upload/rsync.py index 061d02d0..5e9944cf 100644 --- a/builder/upload/rsync.py +++ b/builder/upload/rsync.py @@ -6,12 +6,10 @@ def upload(local: Path, remote: str) -> None: """Upload wheels from folder to remote rsync server.""" - result = subprocess.run( + subprocess.run( f"rsync -chrP {local}/* {remote}/", shell=True, + check=True, stdout=sys.stdout, stderr=sys.stderr, ) - - # Check result of program - result.check_returncode() diff --git a/requirements_tests.txt b/requirements_tests.txt index fc700a85..e4f04ae4 100644 --- a/requirements_tests.txt +++ b/requirements_tests.txt @@ -1,2 +1,3 @@ flake8==3.7.8 -pylint==2.3.1 +pylint==2.4.0 +black==19.3b0 diff --git a/tox.ini b/tox.ini index b17a2ff1..f68abc53 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = lint +envlist = lint, black [testenv] deps = @@ -12,3 +12,7 @@ ignore_errors = True commands = flake8 builder pylint --rcfile pylintrc builder + +[testenv:black] +commands = + black --target-version py36 --check builder setup.py From 20e6efb1ef14821695281cb981ff3263adca7b20 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Tue, 24 Sep 2019 15:48:41 +0000 Subject: [PATCH 4/8] Fix pipeline --- azure-pipelines-ci.yml | 41 +++++++++++ azure-pipelines.yml | 161 ++++++++++++++++------------------------- 2 files changed, 103 insertions(+), 99 deletions(-) create mode 100644 azure-pipelines-ci.yml diff --git a/azure-pipelines-ci.yml b/azure-pipelines-ci.yml new file mode 100644 index 00000000..6e28a61b --- /dev/null +++ b/azure-pipelines-ci.yml @@ -0,0 +1,41 @@ +# https://dev.azure.com/home-assistant + +trigger: + batch: true + branches: + include: + - master + - dev +pr: +- dev +variables: +- name: versionHadolint + value: 'v1.16.3' + +jobs: + +- job: 'Tox' + pool: + vmImage: 'ubuntu-latest' + steps: + - task: UsePythonVersion@0 + displayName: 'Use Python $(python.version)' + inputs: + versionSpec: '3.7' + - script: pip install tox + displayName: 'Install Tox' + - script: tox + displayName: 'Run Tox' + + +- job: 'Hadolint' + pool: + vmImage: 'ubuntu-latest' + steps: + - script: sudo docker pull hadolint/hadolint:$(versionHadolint) + displayName: 'Install Hadolint' + - script: | + sudo docker run --rm -i \ + -v $(pwd)/.hadolint.yaml:/.hadolint.yaml:ro \ + hadolint/hadolint:$(versionHadolint) < Dockerfile + displayName: 'Run Hadolint' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f6a2ced7..eb3659fd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,114 +1,77 @@ # https://dev.azure.com/home-assistant trigger: - batch: true - branches: - include: - - master - - dev tags: include: - '*' -pr: - - dev variables: - - name: versionHadolint - value: 'v1.16.3' - - name: versionBuilder - value: '4.4' - - group: docker +- name: versionBuilder + value: '4.4' +- group: docker resources: repositories: - - repository: azure - type: github - name: 'home-assistant/ci-azure' - endpoint: 'home-assistant' - -jobs: + - repository: azure + type: github + name: 'home-assistant/ci-azure' + endpoint: 'home-assistant' -- job: 'Tox' - pool: - vmImage: 'ubuntu-latest' - steps: - - task: UsePythonVersion@0 - displayName: 'Use Python $(python.version)' - inputs: - versionSpec: '3.7' - - script: pip install tox - displayName: 'Install Tox' - - script: tox - displayName: 'Run Tox' +stages: -- job: 'Hadolint' - pool: - vmImage: 'ubuntu-latest' - steps: - - script: sudo docker pull hadolint/hadolint:$(versionHadolint) - displayName: 'Install Hadolint' - - script: | - sudo docker run --rm -i \ - -v $(pwd)/.hadolint.yaml:/.hadolint.yaml:ro \ - hadolint/hadolint:$(versionHadolint) < Dockerfile - displayName: 'Run Hadolint' +- stage: 'Validate' + jobs: + - template: templates/azp-job-version.yaml@azure + parameters: + ignoreDev: true +- stage: 'Wheels' + jobs: + - template: templates/azp-job-wheels.yaml@azure + parameters: + jobName: 'Wheels_Alpine39' + builderVersion: 'dev-3.7-alpine3.9' + builderApk: 'build-base;libffi-dev;openssl-dev' + wheelsRequirement: 'requirements_all.txt' + preBuild: + - script: | + cat requirements.txt requirements_build.txt > requirements_all.txt + displayName: 'Prepare requirements' + - template: templates/azp-job-wheels.yaml@azure + parameters: + jobName: 'Wheels_Alpine310' + builderVersion: 'dev-3.7-alpine3.10' + builderApk: 'build-base;libffi-dev;openssl-dev' + wheelsRequirement: 'requirements_all.txt' + preBuild: + - script: | + cat requirements.txt requirements_build.txt > requirements_all.txt + displayName: 'Prepare requirements' -- template: templates/azp-job-wheels.yaml@azure - parameters: - jobName: 'Wheels_Alpine39' - builderVersion: 'dev-3.7-alpine3.9' - builderApk: 'build-base;libffi-dev;openssl-dev' - wheelsRequirement: 'requirements_all.txt' - preBuild: - - script: | - cat requirements.txt requirements_build.txt > requirements_all.txt - displayName: 'Prepare requirements' - -- template: templates/azp-job-wheels.yaml@azure - parameters: - jobName: 'Wheels_Alpine310' - builderVersion: 'dev-3.7-alpine3.10' - builderApk: 'build-base;libffi-dev;openssl-dev' - wheelsRequirement: 'requirements_all.txt' - preBuild: +- stage: 'Release' + jobs: + - job: 'Release' + pool: + vmImage: 'ubuntu-latest' + strategy: + maxParallel: 2 + matrix: + 37-Alpine39: + buildPython: '3.7-alpine3.9' + buildArgs: '' + 37-Alpine310: + buildPython: '3.7-alpine3.10' + buildArgs: '--release-tag' + steps: + - script: sudo docker login -u $(dockerUser) -p $(dockerPassword) + displayName: 'Docker hub login' + - script: sudo docker pull homeassistant/amd64-builder:$(versionBuilder) + displayName: 'Install Builder' - script: | - cat requirements.txt requirements_build.txt > requirements_all.txt - displayName: 'Prepare requirements' - - -- template: templates/azp-job-version.yaml@azure - parameters: - ignoreDev: true - - -- job: 'Release' - dependsOn: - - 'Tox' - - 'Hadolint' - - 'VersionValidate' - timeoutInMinutes: 120 - pool: - vmImage: 'ubuntu-latest' - strategy: - maxParallel: 2 - matrix: - 37-Alpine39: - buildPython: '3.7-alpine3.9' - buildArgs: '' - 37-Alpine310: - buildPython: '3.7-alpine3.10' - buildArgs: '--release-tag' - steps: - - script: sudo docker login -u $(dockerUser) -p $(dockerPassword) - displayName: 'Docker hub login' - - script: sudo docker pull homeassistant/amd64-builder:$(versionBuilder) - displayName: 'Install Builder' - - script: | - sudo docker run --rm --privileged \ - -v ~/.docker:/root/.docker \ - -v /run/docker.sock:/run/docker.sock:rw -v $(pwd):/data:ro \ - homeassistant/amd64-builder:$(versionBuilder) \ - --builder-wheels $(buildPython) --all \ - $(buildArgs) --version $(Build.SourceBranchName) \ - -t /data --docker-hub homeassistant - displayName: 'Build Release' + sudo docker run --rm --privileged \ + -v ~/.docker:/root/.docker \ + -v /run/docker.sock:/run/docker.sock:rw -v $(pwd):/data:ro \ + homeassistant/amd64-builder:$(versionBuilder) \ + --builder-wheels $(buildPython) --all \ + $(buildArgs) --version $(Build.SourceBranchName) \ + -t /data --docker-hub homeassistant + displayName: 'Build Release' From 72126b256688004ecca5d6850ad28b43ffcf0b41 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Tue, 24 Sep 2019 15:53:13 +0000 Subject: [PATCH 5/8] Rename pipeline --- azure-pipelines.yml => azure-pipelines-release.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename azure-pipelines.yml => azure-pipelines-release.yml (100%) diff --git a/azure-pipelines.yml b/azure-pipelines-release.yml similarity index 100% rename from azure-pipelines.yml rename to azure-pipelines-release.yml From 3f5f090af9bcd4a14d9bd47d3912fa86a4d4abca Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2019 18:08:13 +0200 Subject: [PATCH 6/8] Bump pylint from 2.4.0 to 2.4.1 (#42) Bumps [pylint](https://github.com/PyCQA/pylint) from 2.4.0 to 2.4.1. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Changelog](https://github.com/PyCQA/pylint/blob/master/ChangeLog) - [Commits](https://github.com/PyCQA/pylint/compare/pylint-2.4.0...pylint-2.4.1) Signed-off-by: dependabot-preview[bot] --- requirements_tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_tests.txt b/requirements_tests.txt index e4f04ae4..3bb916a3 100644 --- a/requirements_tests.txt +++ b/requirements_tests.txt @@ -1,3 +1,3 @@ flake8==3.7.8 -pylint==2.4.0 +pylint==2.4.1 black==19.3b0 From 60107a3cfea92b0a80ea561bb6801a916b05ec05 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2019 22:47:01 +0200 Subject: [PATCH 7/8] Bump pylint from 2.4.1 to 2.4.2 (#43) Bumps [pylint](https://github.com/PyCQA/pylint) from 2.4.1 to 2.4.2. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Changelog](https://github.com/PyCQA/pylint/blob/master/ChangeLog) - [Commits](https://github.com/PyCQA/pylint/compare/pylint-2.4.1...pylint-2.4.2) Signed-off-by: dependabot-preview[bot] --- requirements_tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_tests.txt b/requirements_tests.txt index 3bb916a3..e9669d5d 100644 --- a/requirements_tests.txt +++ b/requirements_tests.txt @@ -1,3 +1,3 @@ flake8==3.7.8 -pylint==2.4.1 +pylint==2.4.2 black==19.3b0 From e38b969f6f60873353354c44514a0a1d8d7d8915 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Mon, 30 Sep 2019 22:48:09 +0200 Subject: [PATCH 8/8] Update azure-pipelines-release.yml --- azure-pipelines-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines-release.yml b/azure-pipelines-release.yml index eb3659fd..dc59e4c6 100644 --- a/azure-pipelines-release.yml +++ b/azure-pipelines-release.yml @@ -4,6 +4,7 @@ trigger: tags: include: - '*' +pr: none variables: - name: versionBuilder value: '4.4'