From 8daa092c564976cd4e4486cf5afa1eadcc15f7d5 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sun, 16 Jun 2019 21:45:19 -0400 Subject: [PATCH] Fix azure pipelines Signed-off-by: Dan Ryan --- .azure-pipelines/docs.yml | 21 ------------ .azure-pipelines/jobs/run-manifest-check.yml | 15 -------- .azure-pipelines/jobs/run-tests-windows.yml | 25 -------------- .azure-pipelines/jobs/run-tests.yml | 30 ---------------- .azure-pipelines/jobs/run-vendor-scripts.yml | 33 ------------------ .azure-pipelines/jobs/test.yml | 26 -------------- .azure-pipelines/linux.yml | 28 --------------- .../steps/create-virtualenv-linux.yml | 16 --------- .../steps/create-virtualenv-windows.yml | 26 -------------- .azure-pipelines/steps/reinstall-pythons.yml | 34 +++++++++++++++++++ .azure-pipelines/windows.yml | 24 ------------- azure-pipelines.yml | 21 +++++++----- 12 files changed, 47 insertions(+), 252 deletions(-) delete mode 100644 .azure-pipelines/docs.yml delete mode 100644 .azure-pipelines/jobs/run-manifest-check.yml delete mode 100644 .azure-pipelines/jobs/run-tests-windows.yml delete mode 100644 .azure-pipelines/jobs/run-tests.yml delete mode 100644 .azure-pipelines/jobs/run-vendor-scripts.yml delete mode 100644 .azure-pipelines/jobs/test.yml delete mode 100644 .azure-pipelines/linux.yml delete mode 100644 .azure-pipelines/steps/create-virtualenv-linux.yml delete mode 100644 .azure-pipelines/steps/create-virtualenv-windows.yml create mode 100644 .azure-pipelines/steps/reinstall-pythons.yml delete mode 100644 .azure-pipelines/windows.yml diff --git a/.azure-pipelines/docs.yml b/.azure-pipelines/docs.yml deleted file mode 100644 index b65fdfb4..00000000 --- a/.azure-pipelines/docs.yml +++ /dev/null @@ -1,21 +0,0 @@ -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 deleted file mode 100644 index 4d12a800..00000000 --- a/.azure-pipelines/jobs/run-manifest-check.yml +++ /dev/null @@ -1,15 +0,0 @@ -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 --upgrade setuptools twine readme_renderer[md] - python setup.py sdist bdist_wheel - twine check dist/* diff --git a/.azure-pipelines/jobs/run-tests-windows.yml b/.azure-pipelines/jobs/run-tests-windows.yml deleted file mode 100644 index 8640683b..00000000 --- a/.azure-pipelines/jobs/run-tests-windows.yml +++ /dev/null @@ -1,25 +0,0 @@ -steps: -- task: UsePythonVersion@0 - displayName: Use Python $(python.version) - inputs: - versionSpec: '$(python.version)' - architecture: '$(python.architecture)' - addToPath: true - -- powershell: | - Write-Host "##vso[task.setvariable variable=PIPENV_DEFAULT_PYTHON_VERSION]$env:PYTHON_VERSION" - env: - PYTHON_VERSION: $(python.version) - -- template: ../steps/install-dependencies.yml - -- template: ../steps/create-virtualenv-windows.yml - -- template: ../steps/run-tests-windows.yml - -- 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-tests.yml b/.azure-pipelines/jobs/run-tests.yml deleted file mode 100644 index c83e62a0..00000000 --- a/.azure-pipelines/jobs/run-tests.yml +++ /dev/null @@ -1,30 +0,0 @@ -steps: -- task: UsePythonVersion@0 - displayName: Use Python $(python.version) - inputs: - versionSpec: '$(python.version)' - architecture: '$(python.architecture)' - addToPath: true - -- script: | - echo '##vso[task.setvariable variable=PIPENV_DEFAULT_PYTHON_VERSION]$(python.version)' - -- template: ../steps/install-dependencies.yml - -- template: ../steps/create-virtualenv-linux.yml - -- script: | - # Fix Git SSL errors - export GIT_SSL_CAINFO="$(python -m certifi)" - export LANG="C.UTF-8" - export PIP_PROCESS_DEPENDENCY_LINKS="1" - git submodule sync && git submodule update --init --recursive - 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 deleted file mode 100644 index 947014b5..00000000 --- a/.azure-pipelines/jobs/run-vendor-scripts.yml +++ /dev/null @@ -1,33 +0,0 @@ -parameters: - vmImage: - -jobs: -- job: Vendor_Scripts - displayName: Test Vendor Scripts - pool: - vmImage: ${{ parameters.vmImage }} - strategy: - maxParallel: 4 - matrix: - 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 bs4 vistir towncrier pip setuptools wheel --upgrade-strategy=eager - python -m invoke vendoring.update - - - template: ./run-manifest-check.yml diff --git a/.azure-pipelines/jobs/test.yml b/.azure-pipelines/jobs/test.yml deleted file mode 100644 index b6c341f8..00000000 --- a/.azure-pipelines/jobs/test.yml +++ /dev/null @@ -1,26 +0,0 @@ -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 - Python37: - python.version: '>= 3.7' - python.architecture: x64 - Python36: - python.version: '>= 3.6' - python.architecture: x64 - steps: - - ${{ if eq(parameters.vmImage, 'windows-2019') }}: - - template: ./run-tests-windows.yml - - - ${{ if ne(parameters.vmImage, 'windows-2019') }}: - - template: ./run-tests.yml diff --git a/.azure-pipelines/linux.yml b/.azure-pipelines/linux.yml deleted file mode 100644 index e39c45e7..00000000 --- a/.azure-pipelines/linux.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Pipenv Build Rules -trigger: - batch: true - branches: - include: - - master - paths: - exclude: - - docs/* - - news/* - - peeps/* - - 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-linux.yml b/.azure-pipelines/steps/create-virtualenv-linux.yml deleted file mode 100644 index 519c5c5e..00000000 --- a/.azure-pipelines/steps/create-virtualenv-linux.yml +++ /dev/null @@ -1,16 +0,0 @@ -steps: -- 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…" - pipenv install --deploy --dev - pipenv run pip install -e "$(pwd)[tests]" --upgrade - echo pipenv --venv && echo pipenv --py && echo pipenv run python --version - displayName: Make Virtualenv - env: - PYTHONWARNINGS: 'ignore:DEPRECATION' diff --git a/.azure-pipelines/steps/create-virtualenv-windows.yml b/.azure-pipelines/steps/create-virtualenv-windows.yml deleted file mode 100644 index b992e210..00000000 --- a/.azure-pipelines/steps/create-virtualenv-windows.yml +++ /dev/null @@ -1,26 +0,0 @@ -steps: - -- script: | - echo "##vso[task.setvariable variable=LANG]C.UTF-8" - echo "##vso[task.setvariable variable=PIP_PROCESS_DEPENDENCY_LINKS]1" - displayName: Set Environment Variables - -- powershell: | - pip install certifi - $env:PYTHON_PATH=$(python -c "import sys; print(sys.executable)") - $env:CERTIFI_CONTENT=$(python -m certifi) - echo "##vso[task.setvariable variable=GIT_SSL_CAINFO]$env:CERTIFI_CONTENT" - echo "##vso[task.setvariable variable=PY_EXE]$env:PYTHON_PATH" - displayName: Set Python Path - env: - PYTHONWARNINGS: 'ignore:DEPRECATION' - -- script: | - echo "Python path: $(PY_EXE)" - echo "GIT_SSL_CAINFO: $(GIT_SSL_CAINFO)" - $(PY_EXE) -m pipenv install --deploy --dev - env: - PIPENV_DEFAULT_PYTHON_VERSION: '$(PIPENV_DEFAULT_PYTHON_VERSION)' - PYTHONWARNINGS: 'ignore:DEPRECATION' - PIPENV_NOSPIN: '1' - displayName: Make Virtualenv diff --git a/.azure-pipelines/steps/reinstall-pythons.yml b/.azure-pipelines/steps/reinstall-pythons.yml new file mode 100644 index 00000000..79647925 --- /dev/null +++ b/.azure-pipelines/steps/reinstall-pythons.yml @@ -0,0 +1,34 @@ +steps: + - script: | + # When you paste this, please make sure the indentation is preserved + # Fail out if any setups fail + set -e + + # Delete old Pythons + rm -rf $AGENT_TOOLSDIRECTORY/Python/2.7.16 + rm -rf $AGENT_TOOLSDIRECTORY/Python/3.5.7 + rm -rf $AGENT_TOOLSDIRECTORY/Python/3.7.3 + [ -e $AGENT_TOOLSDIRECTORY/Python/3.7.2 ] && [ -e $AGENT_TOOLSDIRECTORY/Python/3.5.5 ] && [ -e $AGENT_TOOLSDIRECTORY/Python/2.7.15 ] && exit 0 + # Download new Pythons + azcopy --recursive \ + --source https://vstsagenttools.blob.core.windows.net/tools/hostedtoolcache/linux/Python/2.7.15 \ + --destination $AGENT_TOOLSDIRECTORY/Python/2.7.15 + + azcopy --recursive \ + --source https://vstsagenttools.blob.core.windows.net/tools/hostedtoolcache/linux/Python/3.5.5 \ + --destination $AGENT_TOOLSDIRECTORY/Python/3.5.5 + + azcopy --recursive \ + --source https://vstsagenttools.blob.core.windows.net/tools/hostedtoolcache/linux/Python/3.7.2 \ + --destination $AGENT_TOOLSDIRECTORY/Python/3.7.2 + + # Install new Pythons + original_directory=$PWD + setups=$(find $AGENT_TOOLSDIRECTORY/Python -name setup.sh) + for setup in $setups; do + chmod +x $setup; + cd $(dirname $setup); + ./$(basename $setup); + cd $original_directory; + done; + displayName: 'Workaround: roll back Python versions' diff --git a/.azure-pipelines/windows.yml b/.azure-pipelines/windows.yml deleted file mode 100644 index c763bd34..00000000 --- a/.azure-pipelines/windows.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Pipenv Build Rules -trigger: - batch: true - branches: - include: - - master - paths: - exclude: - - docs/* - - news/* - - peeps/* - - README.md - - pipenv/*.txt - - CHANGELOG.rst - - CONTRIBUTING.md - - CODE_OF_CONDUCT.md - - .gitignore - - .gitattributes - - .editorconfig - -jobs: -- template: jobs/test.yml - parameters: - vmImage: windows-2019 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4188d866..4b4061b0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,6 +9,8 @@ trigger: - docs/* - news/* - peeps/* + - examples/* + - pytest.ini - README.md - pipenv/*.txt - CHANGELOG.rst @@ -28,16 +30,17 @@ jobs: strategy: matrix: Python27: - python.version: '2.7.16' + python.version: '2.7' python.architecture: x64 Python36: - python.version: '3.6.8' + python.version: '3.6' python.architecture: x64 Python37: - python.version: '3.7.3' + python.version: '3.7' python.architecture: x64 maxParallel: 4 steps: + - template: .azure-pipelines/steps/reinstall-pythons.yml - template: .azure-pipelines/steps/run-tests.yml parameters: vmImage: 'Ubuntu-16.04' @@ -46,9 +49,10 @@ jobs: pool: vmImage: 'Ubuntu-16.04' variables: - python.version: '3.7.3' + python.version: '3.7' python.architecture: x64 steps: + - template: .azure-pipelines/steps/reinstall-pythons.yml - template: .azure-pipelines/steps/run-vendor-scripts.yml parameters: vmImage: 'Ubuntu-16.04' @@ -57,9 +61,10 @@ jobs: pool: vmImage: 'Ubuntu-16.04' variables: - python.version: '3.7.3' + python.version: '3.7' python.architecture: x64 steps: + - template: .azure-pipelines/steps/reinstall-pythons.yml - template: .azure-pipelines/steps/build-package.yml parameters: vmImage: 'Ubuntu-16.04' @@ -90,13 +95,13 @@ jobs: strategy: matrix: Python27: - python.version: '2.7.16' + python.version: '2.7' python.architecture: x64 Python36: - python.version: '3.6.8' + python.version: '3.6' python.architecture: x64 Python37: - python.version: '3.7.3' + python.version: '3.7' python.architecture: x64 maxParallel: 4 steps: