From d04b6b211d719da44a2f26c32a261e478c514325 Mon Sep 17 00:00:00 2001 From: David Staheli Date: Mon, 5 Nov 2018 10:13:51 -0500 Subject: [PATCH 1/3] Update YAML syntax --- .azure-pipelines/docs.yml | 21 ++++++++ .azure-pipelines/jobs/run-manifest-check.yml | 14 ++++++ .azure-pipelines/jobs/run-tests-windows.yml | 12 +++++ .azure-pipelines/jobs/run-tests.yml | 37 ++++++++++++++ .azure-pipelines/jobs/run-vendor-scripts.yml | 39 +++++++++++++++ .azure-pipelines/jobs/test.yml | 48 +++++++++++++++++++ .azure-pipelines/linux.yml | 27 +++++++++++ .azure-pipelines/steps/create-virtualenv.yml | 6 +++ .../steps/install-dependencies.yml | 3 ++ .azure-pipelines/steps/run-tests.yml | 23 +++++++++ .azure-pipelines/windows.yml | 23 +++++++++ 11 files changed, 253 insertions(+) create mode 100644 .azure-pipelines/docs.yml create mode 100644 .azure-pipelines/jobs/run-manifest-check.yml create mode 100644 .azure-pipelines/jobs/run-tests-windows.yml create mode 100644 .azure-pipelines/jobs/run-tests.yml create mode 100644 .azure-pipelines/jobs/run-vendor-scripts.yml create mode 100644 .azure-pipelines/jobs/test.yml create mode 100644 .azure-pipelines/linux.yml create mode 100644 .azure-pipelines/steps/create-virtualenv.yml create mode 100644 .azure-pipelines/steps/install-dependencies.yml create mode 100644 .azure-pipelines/steps/run-tests.yml create mode 100644 .azure-pipelines/windows.yml diff --git a/.azure-pipelines/docs.yml b/.azure-pipelines/docs.yml new file mode 100644 index 00000000..b65fdfb4 --- /dev/null +++ b/.azure-pipelines/docs.yml @@ -0,0 +1,21 @@ +jobs: +- job: + displayName: Docs + pool: + vmImage: ubuntu-16.04 + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + + - template: steps/install-dependencies.yml + + - bash: tox -e docs + displayName: Build docs + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: docs' + inputs: + pathToPublish: docs/build + artifactName: docs diff --git a/.azure-pipelines/jobs/run-manifest-check.yml b/.azure-pipelines/jobs/run-manifest-check.yml new file mode 100644 index 00000000..6d0b97eb --- /dev/null +++ b/.azure-pipelines/jobs/run-manifest-check.yml @@ -0,0 +1,14 @@ +steps: +- task: UsePythonVersion@0 + displayName: Use Python $(python.version) + inputs: + versionSpec: '$(python.version)' + architecture: '$(python.architecture)' + +- template: ../steps/install-dependencies.yml + +- bash: | + export GIT_SSL_CAINFO=$(python -m certifi) + export LANG=C.UTF-8 + python -m pip install check-manifest + check-manifest diff --git a/.azure-pipelines/jobs/run-tests-windows.yml b/.azure-pipelines/jobs/run-tests-windows.yml new file mode 100644 index 00000000..6b6f86fa --- /dev/null +++ b/.azure-pipelines/jobs/run-tests-windows.yml @@ -0,0 +1,12 @@ +steps: +- task: UsePythonVersion@0 + displayName: Use Python $(python.version) + inputs: + versionSpec: '$(python.version)' + architecture: '$(python.architecture)' + +- template: ../steps/install-dependencies.yml + +- template: ../steps/create-virtualenv.yml + +- template: ../steps/run-tests.yml diff --git a/.azure-pipelines/jobs/run-tests.yml b/.azure-pipelines/jobs/run-tests.yml new file mode 100644 index 00000000..fe98e8ec --- /dev/null +++ b/.azure-pipelines/jobs/run-tests.yml @@ -0,0 +1,37 @@ +steps: +- task: UsePythonVersion@0 + displayName: Use Python $(python.version) + inputs: + versionSpec: '$(python.version)' + architecture: '$(python.architecture)' + +- template: ../steps/install-dependencies.yml + +- bash: | + mkdir -p "$AGENT_HOMEDIRECTORY/.virtualenvs" + mkdir -p "$WORKON_HOME" + pip install certifi + export GIT_SSL_CAINFO="$(python -m certifi)" + export LANG="C.UTF-8" + export PIP_PROCESS_DEPENDENCY_LINKS="1" + echo "Path $PATH" + echo "Installing Pipenv…" + pip install -e "$(pwd)" --upgrade + pipenv install --deploy --dev + echo pipenv --venv && echo pipenv --py && echo pipenv run python --version + displayName: Make Virtualenv + +- script: | + # Fix Git SSL errors + export GIT_SSL_CAINFO="$(python -m certifi)" + export LANG="C.UTF-8" + export PIP_PROCESS_DEPENDENCY_LINKS="1" + pipenv run pytest --junitxml=test-results.xml + displayName: Run integration tests + +- task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFiles: '**/test-results.xml' + testRunTitle: 'Python $(python.version)' + condition: succeededOrFailed() diff --git a/.azure-pipelines/jobs/run-vendor-scripts.yml b/.azure-pipelines/jobs/run-vendor-scripts.yml new file mode 100644 index 00000000..7fe75731 --- /dev/null +++ b/.azure-pipelines/jobs/run-vendor-scripts.yml @@ -0,0 +1,39 @@ +parameters: + vmImage: + +jobs: +- job: Vendor_Scripts + displayName: Test Vendor Scripts + pool: + vmImage: ${{ parameters.vmImage }} + strategy: + maxParallel: 4 + matrix: + ${{ if eq(parameters.vmImage, 'vs2017-win2016') }}: + # TODO remove once vs2017-win2016 has Python 3.7 + Python37: + python.version: '>= 3.7.0-b2' + python.architecture: x64 + ${{ if ne(parameters.vmImage, 'vs2017-win2016' )}}: + Python37: + python.version: '>= 3.7' + python.architecture: x64 + steps: + - task: UsePythonVersion@0 + displayName: Use Python $(python.version) + inputs: + versionSpec: '$(python.version)' + architecture: '$(python.architecture)' + + - template: ../steps/install-dependencies.yml + + - bash: | + mkdir -p "$AGENT_HOMEDIRECTORY/.virtualenvs" + mkdir -p "$WORKON_HOME" + pip install certifi + export GIT_SSL_CAINFO=$(python -m certifi) + export LANG=C.UTF-8 + python -m pip install --upgrade invoke requests parver + python -m invoke vendoring.update + + - template: ./run-manifest-check.yml diff --git a/.azure-pipelines/jobs/test.yml b/.azure-pipelines/jobs/test.yml new file mode 100644 index 00000000..150937ef --- /dev/null +++ b/.azure-pipelines/jobs/test.yml @@ -0,0 +1,48 @@ +parameters: + vmImage: + +jobs: +- job: Test_Primary + displayName: Test Primary + pool: + vmImage: ${{ parameters.vmImage }} + strategy: + maxParallel: 4 + matrix: + Python27: + python.version: '2.7' + python.architecture: x64 + ${{ if eq(parameters.vmImage, 'vs2017-win2016') }}: + # TODO remove once vs2017-win2016 has Python 3.7 + Python37: + python.version: '>= 3.7.0-b2' + python.architecture: x64 + ${{ if ne(parameters.vmImage, 'vs2017-win2016' )}}: + Python37: + python.version: '>= 3.7' + python.architecture: x64 + steps: + - ${{ if eq(parameters.vmImage, 'vs2017-win2016') }}: + - template: ./run-tests-windows.yml + + - ${{ if ne(parameters.vmImage, 'vs2017-win2016') }}: + - template: ./run-tests.yml + +- job: Test_Secondary + displayName: Test python3.6 + # Run after Test_Primary so we don't devour time and jobs if tests are going to fail + # dependsOn: Test_Primary + pool: + vmImage: ${{ parameters.vmImage }} + strategy: + maxParallel: 4 + matrix: + Python36: + python.version: '3.6' + python.architecture: x64 + steps: + - ${{ if eq(parameters.vmImage, 'vs2017-win2016') }}: + - template: ./run-tests-windows.yml + + - ${{ if ne(parameters.vmImage, 'vs2017-win2016') }}: + - template: ./run-tests.yml diff --git a/.azure-pipelines/linux.yml b/.azure-pipelines/linux.yml new file mode 100644 index 00000000..a2f34d4c --- /dev/null +++ b/.azure-pipelines/linux.yml @@ -0,0 +1,27 @@ +name: Pipenv Build Rules +trigger: + batch: true + branches: + include: + - master + paths: + exclude: + - docs/* + - news/* + - README.md + - pipenv/*.txt + - CHANGELOG.rst + - CONTRIBUTING.md + - CODE_OF_CONDUCT.md + - .gitignore + - .gitattributes + - .editorconfig + +jobs: +- template: jobs/test.yml + parameters: + vmImage: ubuntu-16.04 + +- template: jobs/run-vendor-scripts.yml + parameters: + vmImage: ubuntu-16.04 diff --git a/.azure-pipelines/steps/create-virtualenv.yml b/.azure-pipelines/steps/create-virtualenv.yml new file mode 100644 index 00000000..9d1a6903 --- /dev/null +++ b/.azure-pipelines/steps/create-virtualenv.yml @@ -0,0 +1,6 @@ +steps: +- script: | + virtualenv D:\.venv + D:\.venv\Scripts\pip.exe install -e . && D:\.venv\Scripts\pipenv install --dev + echo D:\.venv\Scripts\pipenv --venv && echo D:\.venv\Scripts\pipenv --py && echo D:\.venv\Scripts\pipenv run python --version + displayName: Make Virtualenv diff --git a/.azure-pipelines/steps/install-dependencies.yml b/.azure-pipelines/steps/install-dependencies.yml new file mode 100644 index 00000000..dfe733b6 --- /dev/null +++ b/.azure-pipelines/steps/install-dependencies.yml @@ -0,0 +1,3 @@ +steps: +- script: 'python -m pip install --upgrade pip && python -m pip install -e .' + displayName: Upgrade Pip & Install Pipenv diff --git a/.azure-pipelines/steps/run-tests.yml b/.azure-pipelines/steps/run-tests.yml new file mode 100644 index 00000000..a7b99a13 --- /dev/null +++ b/.azure-pipelines/steps/run-tests.yml @@ -0,0 +1,23 @@ +steps: +- powershell: | + # Fix Git SSL errors + pip install certifi + python -m certifi > cacert.txt + Write-Host "##vso[task.setvariable variable=GIT_SSL_CAINFO]$(Get-Content cacert.txt)" + $env:GIT_SSL_CAINFO="$(Get-Content cacert.txt)" + # Shorten paths to get under MAX_PATH or else integration tests will fail + # https://bugs.python.org/issue18199 + subst T: "$env:TEMP" + Write-Host "##vso[task.setvariable variable=TEMP]T:\" + $env:TEMP='T:\' + Write-Host "##vso[task.setvariable variable=TMP]T:\" + $env:TEMP='T:\' + D:\.venv\Scripts\pipenv run pytest -ra --ignore=pipenv\patched --ignore=pipenv\vendor --junitxml=test-results.xml tests + displayName: Run integration tests + +- task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFiles: '**/test-results.xml' + testRunTitle: 'Python $(python.version)' + condition: succeededOrFailed() diff --git a/.azure-pipelines/windows.yml b/.azure-pipelines/windows.yml new file mode 100644 index 00000000..35d5c16e --- /dev/null +++ b/.azure-pipelines/windows.yml @@ -0,0 +1,23 @@ +name: Pipenv Build Rules +trigger: + batch: true + branches: + include: + - master + paths: + exclude: + - docs/* + - news/* + - README.md + - pipenv/*.txt + - CHANGELOG.rst + - CONTRIBUTING.md + - CODE_OF_CONDUCT.md + - .gitignore + - .gitattributes + - .editorconfig + +jobs: +- template: jobs/test.yml + parameters: + vmImage: vs2017-win2016 From e398d348b455fa1d24ce273f5ee431197bc88967 Mon Sep 17 00:00:00 2001 From: David Staheli Date: Mon, 5 Nov 2018 11:22:34 -0500 Subject: [PATCH 2/3] Added news file --- news/3164.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/3164.bugfix.rst diff --git a/news/3164.bugfix.rst b/news/3164.bugfix.rst new file mode 100644 index 00000000..7b3fb1ac --- /dev/null +++ b/news/3164.bugfix.rst @@ -0,0 +1 @@ +Azure Pipelines YAML files are updated to use the latest syntax and product name. From d773429d0721f1aa56bc8f3ae85147d5f681419d Mon Sep 17 00:00:00 2001 From: David Staheli Date: Mon, 5 Nov 2018 11:36:53 -0500 Subject: [PATCH 3/3] Update MANIFEST.in to prune .azure-pipelines --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index a8d08c6c..3c8eb1d4 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -28,6 +28,7 @@ recursive-exclude pipenv *.pyi recursive-exclude pipenv *.typed prune peeps +prune .azure-pipelines prune .buildkite prune .github prune .vsts-ci