From b9255fb9433f957112bffef4414d895febcd081b Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 8 Jan 2020 14:10:45 +0100 Subject: [PATCH] Support python 3.7 / 3.8 - Alpine 3.9 / 3.10 / 3.11 (#55) * Update files * Expand tags --- .devcontainer/devcontainer.json | 3 +- azure-pipelines-ci.yml | 58 +++++------ azure-pipelines-release.yml | 179 ++++++++++++++++++++------------ requirements.txt | 1 + 4 files changed, 145 insertions(+), 96 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2112d3fb..988fd98b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,7 +4,8 @@ "context": "..", "dockerFile": "Dockerfile", "extensions": [ - "ms-python.python" + "ms-python.python", + "esbenp.prettier-vscode" ], "settings": { "python.pythonPath": "/usr/local/bin/python", diff --git a/azure-pipelines-ci.yml b/azure-pipelines-ci.yml index 6e28a61b..e551b15d 100644 --- a/azure-pipelines-ci.yml +++ b/azure-pipelines-ci.yml @@ -4,38 +4,36 @@ trigger: batch: true branches: include: - - master - - dev + - master + - dev pr: -- dev + - dev variables: -- name: versionHadolint - value: 'v1.16.3' + - 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: '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' + - 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-release.yml b/azure-pipelines-release.yml index dc59e4c6..b626bfa7 100644 --- a/azure-pipelines-release.yml +++ b/azure-pipelines-release.yml @@ -3,76 +3,125 @@ trigger: tags: include: - - '*' + - "*" pr: none variables: -- 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' - + - repository: azure + type: github + name: "home-assistant/ci-azure" + endpoint: "home-assistant" stages: + - stage: "Validate" + jobs: + - template: templates/azp-job-version.yaml@azure + parameters: + ignoreDev: true -- 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' + - stage: "Wheels" + jobs: + - template: templates/azp-job-wheels.yaml@azure + parameters: + jobName: "Wheels_37_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_37_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_37_Alpine311" + builderVersion: "dev-3.7-alpine3.11" + 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_38_Alpine39" + builderVersion: "dev-3.8-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_38_Alpine310" + builderVersion: "dev-3.8-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_38_Alpine311" + builderVersion: "dev-3.8-alpine3.11" + 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" -- 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: | - 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' + - stage: "Release" + jobs: + - job: "Release" + pool: + vmImage: "ubuntu-latest" + strategy: + matrix: + 37-Alpine39: + buildPython: "3.7-alpine3.9" + buildArgs: "" + 37-Alpine310: + buildPython: "3.7-alpine3.10" + buildArgs: "" + 37-Alpine311: + buildPython: "3.7-alpine3.11" + buildArgs: "" + 38-Alpine39: + buildPython: "3.8-alpine3.9" + buildArgs: "" + 38-Alpine310: + buildPython: "3.8-alpine3.10" + buildArgs: "" + 38-Alpine311: + buildPython: "3.8-alpine3.11" + 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" diff --git a/requirements.txt b/requirements.txt index c588f8db..155edb6d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ click==7.0 click-pathlib==2019.12.28.7 requests==2.22.0 wheel==0.33.6 +setuptools==44.0.0