From cb3d244997ed321b4ab9035c7392be676799e576 Mon Sep 17 00:00:00 2001 From: Bernat Gabor Date: Mon, 9 Jul 2018 13:38:43 +0100 Subject: [PATCH] Add VSTS integration --- .travis-osx | 6 -- .travis.yml | 16 ------ .vsts-ci.yml | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++ appveyor.yml | 40 ------------- tox.ini | 2 +- 5 files changed, 156 insertions(+), 63 deletions(-) delete mode 100644 .travis-osx create mode 100644 .vsts-ci.yml delete mode 100644 appveyor.yml diff --git a/.travis-osx b/.travis-osx deleted file mode 100644 index 5a93637123..0000000000 --- a/.travis-osx +++ /dev/null @@ -1,6 +0,0 @@ -# Perform the manual steps on osx to install python3 and activate an environment -brew update -brew upgrade python -rm /usr/local/bin/python -ln -s python3 /usr/local/bin/python -ln -fs pip3 /usr/local/bin/pip diff --git a/.travis.yml b/.travis.yml index 6c33c08893..994df032e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,25 +17,11 @@ env: jobs: include: - - python: 2.7 # 2.7.14 pip 9.0.1 - - python: 3.4 # 3.4.6 pip 9.0.1 - dist: trusty - - python: 3.5 # 3.5.5 pip 9.0.1 - - python: 3.6 # 3.6.3 pip 9.0.1 - - python: 3.7 # 3.7.0 pip 10.0.1 - python: 3.8-dev - python: pypy # 2.7.13 pip 9.0.1 dist: trusty - python: pypy3 # 3.5.3 pip 9.0.1 dist: trusty - - os: osx - language: generic - - python: 3.7 - env: TOXENV=docs - - python: 3.7 - env: TOXENV=fix-lint - - python: 3.7 - env: TOXENV=package-description - stage: deploy python: '3.7' @@ -59,7 +45,6 @@ matrix: - python: 3.8-dev - python: pypy - python: pypy3 - - os: osx # Sadly Travis at the moment does not provide as job filter option git changeset, however we emulate it via bash # we have two type of tasks to run here @@ -69,7 +54,6 @@ matrix: before_install: - python -c 'import sys; print(sys.version)' -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source .travis-osx; fi - export BUILD="setup.py pyproject.toml MANIFEST.in setup.cfg tox.ini .travis.yml appveyor.yml" - export SRC=$(git diff --name-only $TRAVIS_COMMIT_RANGE -- '*.py' $BUILD | grep -v conf.py | grep -v "tasks/.*.py") - '[[ "$TOXENV"!="py" || (-n "$SRC" && "$TOXENV"="py") ]] && export RUN="YES"' diff --git a/.vsts-ci.yml b/.vsts-ci.yml new file mode 100644 index 0000000000..3693225c1f --- /dev/null +++ b/.vsts-ci.yml @@ -0,0 +1,155 @@ +name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr) + +phases: +- phase: 'lint' + queue: + name: 'Hosted Linux Preview' + + steps: + - task: UsePythonVersion@0 + displayName: setup python + inputs: + versionSpec: '3.7.0-b2' + + - script: 'python -c "import sys; import os; os.symlink(sys.executable, os.path.join(os.path.dirname(sys.executable), \"python3.7\"))"' + displayName: link python to python3.7 + + - script: 'python -m pip install -U tox setuptools' + displayName: install tox + + - script: 'tox -e fix-lint' + displayName: run tox + + + +- phase: 'docs' + queue: + name: 'Hosted Linux Preview' + parallel: 2 + matrix: + readthedocs: + toxenv: 'docs' + packageDescription: + toxenv: 'package-description' + + steps: + - task: UsePythonVersion@0 + displayName: setup python + inputs: + versionSpec: '3.7.0-b2' + + - script: 'python -c "import sys; import os; os.symlink(sys.executable, os.path.join(os.path.dirname(sys.executable), \"python3.7\"))"' + displayName: link python to python3.7 + + - script: 'python -m pip install -U tox setuptools' + displayName: install tox + + - script: 'tox -e $(toxenv)' + displayName: run tox + +- phase: 'linux' + queue: + name: 'Hosted Linux Preview' + parallel: 4 + matrix: + python27: + python.version: '2.7' + python34: + python.version: '3.4' + python35: + python.version: '3.5' + python36: + python.version: '3.6' + python37: + python.version: '3.7.0-b2' + + steps: + + - task: UsePythonVersion@0 + displayName: setup python$(python.version) + inputs: + versionSpec: '$(python.version)' + + - script: 'python -m pip install -U tox setuptools' + displayName: install tox + + - script: 'python -m tox -e py --notest' + displayName: acquire env dependencies + + - script: 'python -m tox -e py' + displayName: run tests + + - task: PublishTestResults@2 + displayName: publish test results + inputs: + testResultsFiles: '.tox/test-results.*.xml' + mergeTestResults: true + testRunTitle: '$(toxenv)' + platform: linux + +- phase: 'windows' + queue: + name: 'Hosted VS2017' + parallel: 4 + matrix: + python27: + python.version: '2.7' + python34: + python.version: '3.4' + python35: + python.version: '3.5' + python36: + python.version: '3.6' + python37: + python.version: '3.7.0-b2' + + steps: + + - task: UsePythonVersion@0 + displayName: setup python$(python.version) + inputs: + versionSpec: '$(python.version)' + + - script: 'python -m pip install -U tox setuptools' + displayName: install tox + + - script: 'python -m tox -e py --notest' + displayName: acquire env dependencies + + - script: 'python -m tox -e py' + displayName: run tests + + - task: PublishTestResults@2 + displayName: publish test results + inputs: + testResultsFiles: '.tox/test-results.*.xml' + mergeTestResults: true + testRunTitle: '$(toxenv)' + platform: win32 + +- phase: 'macOS' + queue: + name: 'Hosted macOS Preview' + parallel: 1 + matrix: + python: + toxenv: 'py3' + + steps: + - script: 'python3 -m pip install -U tox setuptools' + displayName: install tox + + - script: 'python3 -m tox -e $(toxenv) --notest' + displayName: acquire env dependencies + + - script: 'python3 -m tox -e $(toxenv)' + displayName: run tests + + - task: PublishTestResults@2 + displayName: publish test results + inputs: + testResultsFiles: '.tox/test-results.*.xml' + mergeTestResults: true + testRunTitle: 'mac py3' + platform: macOS + diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index c6fd7d10d5..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,40 +0,0 @@ -image: "Visual Studio 2015" - -build: false # Not a C# project - -only_commits: # we only run tests here, so only trigger if we modify the source files or the config - files: - - src/**/* - - tests/**/* - - appveyor.yml - - setup.py - - tox.ini - - pyproject.toml - - MANIFEST.in - - setup.cfg - - .travis.yml - - CHANGELOG.rst - # this final one acts as proxy for release commits - -environment: - matrix: - - TOXENV: py27 - - TOXENV: py34 - - TOXENV: py35 - - TOXENV: py36 - -matrix: - fast_finish: true - -install: -- C:\Python36\python -m pip install --pre -U tox - -test_script: -- C:\Python36\scripts\tox - -after_test: -- C:\Python36\scripts\tox -e coverage,codecov - -cache: -- '%LOCALAPPDATA%\pip\cache' -- '%USERPROFILE%\.cache\pre-commit' diff --git a/tox.ini b/tox.ini index 752e8d9da7..897b14b20f 100644 --- a/tox.ini +++ b/tox.ini @@ -20,7 +20,7 @@ passenv = http_proxy https_proxy no_proxy SSL_CERT_FILE TOXENV CI TRAVIS TRAVIS_ deps = extras = testing changedir = {toxinidir}/tests -commands = pytest {posargs:--cov="{envsitepackagesdir}/tox" --cov-config="{toxinidir}/tox.ini" --timeout=180 . -n {env:PYTEST_XDIST_PROC_NR:auto} } +commands = pytest {posargs:--cov="{envsitepackagesdir}/tox" --cov-config="{toxinidir}/tox.ini" --timeout=180 . -n {env:PYTEST_XDIST_PROC_NR:auto} --junitxml={toxworkdir}/test-results.{envname}.xml } [testenv:docs] description = invoke sphinx-build to build the HTML docs and check that all links are valid