diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fb58f19882f3d4789444f4595d3eb0a0194a7b34..28ec919229017ef41d4cf0b1c7b8c7da3892ecd8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,8 @@ except: - tags coverage: '/TOTAL.+ ([0-9]{1,3}%)/' + variables: + CODECOV_TOKEN: "a0ed9aa4-e4d9-4b24-bf50-0d54e407bd92" Python 3.5: script: @@ -15,6 +17,8 @@ Python 3.5: except: - tags coverage: '/TOTAL.+ ([0-9]{1,3}%)/' + variables: + CODECOV_TOKEN: "a0ed9aa4-e4d9-4b24-bf50-0d54e407bd92" Documentation: script: diff --git a/.travis.yml b/.travis.yml index 28d5c51b00a2b277ff6974522293c64d410d55d0..d03d74ff55268169ddffb7b7ecada8e79719f1c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,8 @@ language: python cache: pip -python: - - "2.7" - - "3.5" install: true script: - - bash ./run-coveralls.sh + - bash ./run-tests-for-ci.sh env: - - if [[$TRAVIS_PYTHON_VERSION = "2.7"]]; then PY_EXE=python2.7; else PY_EXE=python3.5; fi + - PY_EXE=python2.7 + - PY_EXE=python3.5 diff --git a/README.rst b/README.rst index e984c2b82216a653d0d95066043db6c74fef4b6e..532c9150e1689fa036f6beefe24733f38a8abc05 100644 --- a/README.rst +++ b/README.rst @@ -1,14 +1,11 @@ -.. image:: https://travis-ci.org/inducer/relate.svg +.. image:: https://travis-ci.org/inducer/relate.svg?branch=master :target: https://travis-ci.org/inducer/relate -.. image:: https://coveralls.io/repos/inducer/relate/badge.svg - :target: https://coveralls.io/r/inducer/relate - -.. image:: https://gitlab.tiker.net/inducer/relate/badges/master/build.svg - :target: https://gitlab.tiker.net/inducer/relate/commits/master - -.. image:: https://gitlab.tiker.net/inducer/relate/badges/master/coverage.svg?job=Python+3.5 +.. image:: https://ci.appveyor.com/api/projects/status/54c937lry6mjvtx8/branch/master?svg=true + :target: https://ci.appveyor.com/project/inducer/relate +.. image:: https://codecov.io/gh/inducer/relate/branch/master/graph/badge.svg + :target: https://codecov.io/gh/inducer/relate/commits RELATE ====== diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000000000000000000000000000000000000..db90d58940938f34bcafd2ff5fa0427326859fff --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,72 @@ +# +# Most of these settings are taken from here: +# https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml +# + +version: 1.0.{build} + +build: off + +cache: + - '%LOCALAPPDATA%\pip\Cache' + +environment: + global: + # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the + # /E:ON and /V:ON options are not enabled in the batch script intepreter + # See: http://stackoverflow.com/a/13751649/163740 + CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd" + + matrix: + # Pre-installed Python versions, which Appveyor may upgrade to + # a later point release. + # See: http://www.appveyor.com/docs/installed-software#python + + - PYTHON: "C:\\Python27-x64" + PYTHON_VERSION: "2.7.x" # currently 2.7.13 + PYTHON_ARCH: "64" + + - PYTHON: "C:\\Python35-x64" + PYTHON_VERSION: "3.5.x" # currently 3.5.3 + PYTHON_ARCH: "64" + +init: + - "ECHO %PYTHON%" + - ps: "ls C:/Python*" + +install: + # Prepend newly installed Python to the PATH of this build (this cannot be + # done from inside the powershell script as it would require to restart + # the parent CMD process). + - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" + + - ECHO "Filesystem root:" + - ps: "ls \"C:/\"" + + # Check that we have the expected version and architecture for Python + - "python --version" + - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" + + # Upgrade to the latest version of pip to avoid it displaying warnings + # about it being out of date. + - "pip install --disable-pip-version-check --user --upgrade pip" + + - "git submodule update --init --recursive" + + # Install requirements + - ps: "cat requirements.txt | ?{$_ -notmatch 'dnspython'} > req.txt" + - "%CMD_IN_ENV% pip install -r req.txt" + - ps: "if ($env:PYTHON -like '*Python2*') { pip install dnspython mock} else { pip install dnspython3 }" + + +before_test: + - "%CMD_IN_ENV% pip install coverage" + +test_script: + # Run the project tests + - "copy local_settings.example.py local_settings.py /Y" + - "%CMD_IN_ENV% coverage run manage.py test test/" + +after_test: + - "%CMD_IN_ENV% pip install codecov" + - "%CMD_IN_ENV% codecov -X gcov" diff --git a/appveyor/run_with_env.cmd b/appveyor/run_with_env.cmd new file mode 100644 index 0000000000000000000000000000000000000000..5da547c499eea5b8b91ab7f29d6752a376148a8a --- /dev/null +++ b/appveyor/run_with_env.cmd @@ -0,0 +1,88 @@ +:: To build extensions for 64 bit Python 3, we need to configure environment +:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of: +:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1) +:: +:: To build extensions for 64 bit Python 2, we need to configure environment +:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of: +:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0) +:: +:: 32 bit builds, and 64-bit builds for 3.5 and beyond, do not require specific +:: environment configurations. +:: +:: Note: this script needs to be run with the /E:ON and /V:ON flags for the +:: cmd interpreter, at least for (SDK v7.0) +:: +:: More details at: +:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows +:: http://stackoverflow.com/a/13751649/163740 +:: +:: Author: Olivier Grisel +:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ +:: +:: Notes about batch files for Python people: +:: +:: Quotes in values are literally part of the values: +:: SET FOO="bar" +:: FOO is now five characters long: " b a r " +:: If you don't want quotes, don't include them on the right-hand side. +:: +:: The CALL lines at the end of this file look redundant, but if you move them +:: outside of the IF clauses, they do not run properly in the SET_SDK_64==Y +:: case, I don't know why. +@ECHO OFF + +SET COMMAND_TO_RUN=%* +SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows +SET WIN_WDK=c:\Program Files (x86)\Windows Kits\10\Include\wdf + +:: Extract the major and minor versions, and allow for the minor version to be +:: more than 9. This requires the version number to have two dots in it. +SET MAJOR_PYTHON_VERSION=%PYTHON_VERSION:~0,1% +IF "%PYTHON_VERSION:~3,1%" == "." ( + SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,1% +) ELSE ( + SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,2% +) + +:: Based on the Python version, determine what SDK version to use, and whether +:: to set the SDK for 64-bit. +IF %MAJOR_PYTHON_VERSION% == 2 ( + SET WINDOWS_SDK_VERSION="v7.0" + SET SET_SDK_64=Y +) ELSE ( + IF %MAJOR_PYTHON_VERSION% == 3 ( + SET WINDOWS_SDK_VERSION="v7.1" + IF %MINOR_PYTHON_VERSION% LEQ 4 ( + SET SET_SDK_64=Y + ) ELSE ( + SET SET_SDK_64=N + IF EXIST "%WIN_WDK%" ( + :: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/ + REN "%WIN_WDK%" 0wdf + ) + ) + ) ELSE ( + ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" + EXIT 1 + ) +) + +IF %PYTHON_ARCH% == 64 ( + IF %SET_SDK_64% == Y ( + ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture + SET DISTUTILS_USE_SDK=1 + SET MSSdk=1 + "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% + "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release + ECHO Executing: %COMMAND_TO_RUN% + call %COMMAND_TO_RUN% || EXIT 1 + ) ELSE ( + ECHO Using default MSVC build environment for 64 bit architecture + ECHO Executing: %COMMAND_TO_RUN% + call %COMMAND_TO_RUN% || EXIT 1 + ) +) ELSE ( + ECHO Using default MSVC build environment for 32 bit architecture + ECHO Executing: %COMMAND_TO_RUN% + call %COMMAND_TO_RUN% || EXIT 1 +) diff --git a/run-coveralls.sh b/run-coveralls.sh deleted file mode 100644 index 8a8a08fd441edee8610557e398838a9d00ff4cb8..0000000000000000000000000000000000000000 --- a/run-coveralls.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash - -source $(dirname $0)/run-tests-for-ci.sh - -$PIP install coveralls -coveralls diff --git a/run-tests-for-ci.sh b/run-tests-for-ci.sh index f330de3ac8f8eba562290dddf300b500a06504ff..be80ebd99adf59a7dbd54b8f1757afd9b844f57e 100644 --- a/run-tests-for-ci.sh +++ b/run-tests-for-ci.sh @@ -72,4 +72,7 @@ cp local_settings.example.py local_settings.py $PIP install coverage coverage run --source=. manage.py test test/ -coverage report -m \ No newline at end of file +coverage report -m + +$PIP install codecov +codecov -X gcov \ No newline at end of file