From 7ba85968caa315b28591367e0cf106cbc4349a2c Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Tue, 8 Oct 2019 14:15:27 +0300 Subject: [PATCH 1/2] Add azurepipelines --- .azure-pipelines/ci.yml | 21 ++++++ .azure-pipelines/deploy.yml | 126 ++++++++++++++++++++++++++++++++ .azure-pipelines/stage-lint.yml | 106 +++++++++++++++++++++++++++ .azure-pipelines/stage-test.yml | 83 +++++++++++++++++++++ 4 files changed, 336 insertions(+) create mode 100644 .azure-pipelines/ci.yml create mode 100644 .azure-pipelines/deploy.yml create mode 100644 .azure-pipelines/stage-lint.yml create mode 100644 .azure-pipelines/stage-test.yml diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml new file mode 100644 index 00000000000..90cfa44127b --- /dev/null +++ b/.azure-pipelines/ci.yml @@ -0,0 +1,21 @@ +trigger: + batch: true + branches: + include: + - master + exclude: + - refs/tags/* +pr: + autoCancel: true + branches: + include: + - master + +variables: +- group: codecov + +stages: +- template: stage-lint.yml +- template: stage-test.yml + parameters: + codecov.token: '$(codecov.token)' diff --git a/.azure-pipelines/deploy.yml b/.azure-pipelines/deploy.yml new file mode 100644 index 00000000000..2222acd7fce --- /dev/null +++ b/.azure-pipelines/deploy.yml @@ -0,0 +1,126 @@ +trigger: + branches: + include: + - refs/tags/* +pr: none + + +variables: +- group: codecov +- group: twine + + +resources: + containers: + - container: manylinux + image: quay.io/pypa/manylinux1_x86_64 + repositories: + - repository: templates + type: github + name: aio-libs/azure-pipelines + endpoint: aio-libs + +stages: +- template: stage-lint.yml + +- template: stage-test.yml + parameters: + codecov.token: '$(codecov.token)' + +- stage: build + displayName: 'Build' + + jobs: + - job: tarball + displayName: 'Tarball' + pool: + vmImage: 'ubuntu-latest' + + steps: + - template: templates/step-build.yml@templates + parameters: + steps: + - script: | + python setup.py sdist + displayName: 'Make tarball' + + - job: manylinux + displayName: 'Manylinux' + strategy: + matrix: + py36 x64: + python.code: 'cp36-cp36m' + manylinux: 'manylinux_64' + py37 x64: + python.code: 'cp37-cp37m' + manylinux: 'manylinux_64' + pool: + vmImage: 'ubuntu-latest' + container: manylinux + steps: + - script: | + /opt/python/$(python.code)/bin/python -m venv .build-venv + displayName: 'Use Python $(python.code)' + + - script: | + source .build-venv/bin/activate + pip install -U setuptools wheel + displayName: 'Install tools' + + - script: | + source .build-venv/bin/activate + make cythonize + python setup.py bdist_wheel + displayName: 'Make wheel' + + - script: | + auditwheel repair dist/*.whl --wheel-dir wheelhouse/ + displayName: 'Repair wheel' + + - template: templates/step-store-dist.yml@templates + parameters: + folder: wheelhouse + + - job: + strategy: + matrix: + Win py36 x64: + python.version: '3.6' + python.architecture: 'x64' + image: 'windows-latest' + Win py37 x64: + python.version: '3.7' + python.architecture: 'x64' + image: 'windows-latest' + Win py36 x86: + python.version: '3.6' + python.architecture: 'x86' + image: 'windows-latest' + Win py37 x86: + python.version: '3.7' + python.architecture: 'x86' + image: 'windows-latest' + Mac py36: + python.version: '3.6' + image: 'macos-latest' + python.architecture: 'x64' + Mac py37: + python.version: '3.7' + image: 'macos-latest' + python.architecture: 'x64' + pool: + vmImage: '$(image)' + steps: + - template: templates/step-build.yml@templates + parameters: + python: '$(python.version)' + architecture: '$(python.architecture)' + steps: + - script: | + make cythonize + python setup.py bdist_wheel + displayName: 'Make wheel' + +- template: templates/stage-publish.yml@templates + parameters: + github: release-upload diff --git a/.azure-pipelines/stage-lint.yml b/.azure-pipelines/stage-lint.yml new file mode 100644 index 00000000000..ae77f5751d4 --- /dev/null +++ b/.azure-pipelines/stage-lint.yml @@ -0,0 +1,106 @@ +stages: +- stage: lint + displayName: 'Run linters' + + jobs: + - job: 'flake8' + pool: + vmImage: 'ubuntu-latest' + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + architecture: 'x64' + + - script: | + pip install -r requirements/lint.txt + displayName: 'Install deps' + + - script: | + make flake8 + displayName: 'Run flake8' + + - job: 'black' + pool: + vmImage: 'ubuntu-latest' + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + architecture: 'x64' + + - script: | + pip install -r requirements/lint.txt + displayName: 'Install deps' + + - script: | + make black-check + displayName: 'Run black checker' + + - job: 'mypy' + pool: + vmImage: 'ubuntu-latest' + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + architecture: 'x64' + + - script: | + pip install -r requirements/lint.txt + displayName: 'Install deps' + + - script: | + pip install -e . + displayName: 'Install itself' + env: + AIOHTTP_NO_EXTENSIONS: 1 + + - script: | + make mypy + displayName: 'Run black checker' + + - job: 'docs' + pool: + vmImage: 'ubuntu-latest' + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + architecture: 'x64' + + - script: | + apt install libenchant-dev + pip install -r requirements/doc-spelling.txt + displayName: 'Install deps' + + - script: | + make doc + displayName: 'Run docs checker' + env: + AIOHTTP_NO_EXTENSIONS: 1 + + - job: 'twine' + pool: + vmImage: 'ubuntu-latest' + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + architecture: 'x64' + + - script: | + pip install -U twine wheel + python setup.py sdist bdist_wheel + displayName: 'Install deps' + env: + AIOHTTP_NO_EXTENSIONS: 1 + + - script: | + twine check dist/* + displayName: 'Run twine checker' diff --git a/.azure-pipelines/stage-test.yml b/.azure-pipelines/stage-test.yml new file mode 100644 index 00000000000..feeec57abc8 --- /dev/null +++ b/.azure-pipelines/stage-test.yml @@ -0,0 +1,83 @@ +parameters: + codecov.token: '' + +stages: +- stage: test + displayName: 'Run tests' + + jobs: + - job: + strategy: + matrix: + Py36-Cython-Linux: + python.version: '3.6' + no_extensions: '' + image: 'ubuntu-latest' + Py37-Cython-Linux: + python.version: '3.7' + no_extensions: '' + image: 'ubuntu-latest' + Py36-Pure-Linux: + python.version: '3.6' + no_extensions: 'Y' + image: 'ubuntu-latest' + Py37-Pure-Linux: + python.version: '3.7' + no_extensions: 'Y' + image: 'ubuntu-latest' +# PyPy3-Linux: +# python.version: 'pypy3' +# no_extensions: 'Y' +# image: 'ubuntu-latest' + Py36-Cython-Win: + python.version: '3.6' + no_extensions: '' + image: 'windows-latest' + Py37-Cython-Win: + python.version: '3.7' + no_extensions: '' + image: 'windows-latest' + Py36-Cython-Mac: + python.version: '3.6' + no_extensions: '' + image: 'macos-latest' + Py37-Cython-Mac: + python.version: '3.7' + no_extensions: '' + image: 'macos-latest' + pool: + vmImage: '$(image)' + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + architecture: 'x64' + + - script: | + python -m pip install --upgrade pip + displayName: 'Update pip' + + - script: | + make cythonize + condition: eq(variables['no_extensions'], '') + displayName: 'Cythonize' + + - script: | + pip install -r requirements/dev.txt + displayName: 'Install dependencies' + env: + AIOHTTP_NO_EXTENSIONS: '$(no_extensions)' + + - script: | + pytest tests -vv + python -m coverage xml + displayName: 'pytest' + + - script: | + pip install codecov + python -m codecov -f coverage.xml -X gcov + displayName: 'Upload coverage reports' + condition: ne(variables['codecov.token'], '') + env: + CODECOV_TOKEN: '$(codecov.token)' From 02ddc425ccdcf9829ae28fc46a8b02007e9c7951 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Tue, 8 Oct 2019 17:40:16 +0300 Subject: [PATCH 2/2] Cythonize source tarball --- .azure-pipelines/deploy.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/deploy.yml b/.azure-pipelines/deploy.yml index 2222acd7fce..70813b2f109 100644 --- a/.azure-pipelines/deploy.yml +++ b/.azure-pipelines/deploy.yml @@ -40,6 +40,9 @@ stages: - template: templates/step-build.yml@templates parameters: steps: + - script: | + make cythonize + displayName: 'Cythonize' - script: | python setup.py sdist displayName: 'Make tarball' @@ -120,7 +123,7 @@ stages: make cythonize python setup.py bdist_wheel displayName: 'Make wheel' - + - template: templates/stage-publish.yml@templates parameters: github: release-upload