diff --git a/.travis.yml b/.travis.yml index 62d45690..99694d75 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ install: skip before_install: skip stages: -- verify - test - name: deploy latest docs if: (branch = master OR branch =~ ^infra/$) AND type = push @@ -28,59 +27,40 @@ script: - if [[ "$TRAVIS_OS_NAME" != "linux" ]]; then ./.travis/build.sh; fi jobs: - include: - - &docker_verify - stage: verify - env: DISTRO=fedora:latest PYTHON="2" - script: - - source ./.travis/lib-util.sh - - util::docker-run $DISTRO ./.travis/verify.sh - - - <<: *docker_verify - env: DISTRO=fedora:latest PYTHON="3" - - # need to explictly define each builder for test due to different os types + include: - stage: test - env: DISTRO=debian:stable PYTHON="2" - - - stage: test - env: DISTRO=debian:stable PYTHON="3" # 3.4, not 3.5 + env: DISTRO=debian:stable PYTHON="3" # 3.7 - stage: test env: DISTRO=debian:stable PYTHON="3" KRB5_VER="heimdal" + # el7 doesn't do python3 modules, and epel7's python3-gssapi is patched - stage: test - env: DISTRO=centos:7 PYTHON="2" # el7 doesn't do python3 modules - - - stage: test - env: DISTRO=fedora:latest PYTHON="3" + env: DISTRO=centos:8 PYTHON="3" - stage: test - env: DISTRO=fedora:latest PYTHON="2" + env: DISTRO=fedora:latest PYTHON="3" FLAKE="yes" + # Travis defaults to 10.13 (i.e., not latest), so specify osx_image - &osx_test stage: test - env: PYTHON="2" KRB5_VER="heimdal" PYENV="2.7.14" + env: PYTHON="3" KRB5_VER="heimdal" PYENV="3.6.3" os: osx osx_image: xcode9.2 language: generic # causes issues with pyenv installer when set to python - - <<: *osx_test - env: PYTHON="3" KRB5_VER="heimdal" PYENV="3.6.3" - - &win_test stage: test - env: PYTHON="2" PYENV="2.7.16" EXTRA_BUILDEXT="--compiler=mingw32" + env: PYTHON="3" PYENV="3.8.1" os: windows language: sh # Windows not supported yet - - <<: *win_test - env: PYTHON="3" PYENV="3.6.8" - - <<: *win_test env: PYTHON="3" PYENV="3.7.3" + - <<: *win_test + env: PYTHON="3" PYENV="3.6.8" - stage: deploy latest docs script: skip @@ -99,7 +79,6 @@ jobs: on: all_branches: true - - stage: deploy script: skip env: @@ -146,17 +125,17 @@ jobs: - ./.travis/before-deploy-windows-wheels.sh - ./.travis/deploy-win.sh env: - - PYTHON="2" - - PYENV="2.7.16" - - EXTRA_BUILDEXT="--compiler=mingw32" + - PYTHON="3" + - PYENV="3.8.1" language: sh # Travis doesn't support python here - <<: *win_deploy env: - PYTHON="3" - - PYENV="3.6.8" + - PYENV="3.7.3" - <<: *win_deploy env: - PYTHON="3" - - PYENV="3.7.3" + - PYENV="3.6.8" + diff --git a/.travis/build.sh b/.travis/build.sh index 4d16b597..202e812e 100755 --- a/.travis/build.sh +++ b/.travis/build.sh @@ -4,6 +4,28 @@ source ./.travis/lib-setup.sh setup::install +if [ x"$FLAKE" = "xyes" ]; then + flake8 setup.py + F8_SETUP=$? + + flake8 gssapi + F8_PY=$? + + # Cython requires special flags since it is not proper Python: + # - E225: missing whitespace around operator + # - E226: missing whitespace around arithmetic operator + # - E227: missing whitespace around bitwise or shift operator + # - E402: module level import not at top of file (needed for the `GSSAPI="blah" lines) + # - E901: SyntaxError or IndentationError + # - E999: Internal AST compilation error (flake8 specific) + flake8 gssapi --filename='*.pyx,*.pxd' --ignore=E225,E226,E227,E402,E901,E999 + F8_MAIN_CYTHON=$? + + if [ $F8_SETUP -ne 0 -o $F8_PY -ne 0 -o $F8_MAIN_CYTHON -ne 0 ]; then + exit 1 + fi +fi + # always build in-place so that Sphinx can find the modules python setup.py build_ext --inplace $EXTRA_BUILDEXT BUILD_RES=$? diff --git a/.travis/lib-setup.sh b/.travis/lib-setup.sh index be069454..0f0c4ce2 100644 --- a/.travis/lib-setup.sh +++ b/.travis/lib-setup.sh @@ -31,8 +31,8 @@ setup::debian::install() { } setup::rh::yuminst() { - # yum has no update-only verb - yum -y --nogpgcheck install $@ + # yum has no update-only verb. Also: modularity just makes this slower. + yum -y --nogpgcheck --disablerepo=\*modul\* install $@ } setup::centos::install() { @@ -67,7 +67,8 @@ setup::rh::install() { } setup::macos::install() { - # install Python from pyenv so we know what version is being used + # Install Python from pyenv so we know what version is being used. This + # doesn't work for newer macos. pyenv install $PYENV pyenv global $PYENV virtualenv -p $(pyenv which python) .venv @@ -83,13 +84,6 @@ setup::windows::install() { # Update path to include them export PATH="$PYPATH:$PYPATH/Scripts:/c/Program Files/MIT/Kerberos/bin:$PATH" - if [ "${PYENV:0:1}" == "2" ]; then - choco install vcredist2008 - # Skip dotnet dependency: - # https://github.com/fredrikaverpil/vcpython27/pull/3 - choco install --ignore-dependencies vcpython27 - fi - python -m pip install --upgrade pip } diff --git a/.travis/lib-util.sh b/.travis/lib-util.sh index 2cf476ad..1e0636d1 100644 --- a/.travis/lib-util.sh +++ b/.travis/lib-util.sh @@ -11,6 +11,7 @@ util::docker-run() { -e PKG_NAME_VER=$PKG_NAME_VER \ -e KRB5_VER=$KRB5_VER \ -e PYTHON=$PYTHON \ + -e FLAKE=$FLAKE \ $distro \ /bin/bash -ex $@ } diff --git a/.travis/lib-verify.sh b/.travis/lib-verify.sh deleted file mode 100644 index fe84670e..00000000 --- a/.travis/lib-verify.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -verify::flake8() { - flake8 setup.py - F8_SETUP=$? - - flake8 gssapi - F8_PY=$? - - # Cython requires special flags since it is not proper Python - # E225: missing whitespace around operator - # E226: missing whitespace around arithmetic operator - # E227: missing whitespace around bitwise or shift operator - # E402: module level import not at top of file (needed for the `GSSAPI="blah" lines) - # E901: SyntaxError or IndentationError - # E999: Internal AST compilation error (flake8 specific) - flake8 gssapi --filename='*.pyx,*.pxd' --ignore=E225,E226,E227,E402,E901,E999 - F8_MAIN_CYTHON=$? - - if [ $F8_SETUP -eq 0 -a $F8_PY -eq 0 -a $F8_MAIN_CYTHON -eq 0 ]; then - return 0 - else - return 1 - fi -} diff --git a/.travis/verify.sh b/.travis/verify.sh deleted file mode 100644 index cf4bb36f..00000000 --- a/.travis/verify.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -ex - -# set up dependencies, etc -source ./.travis/lib-setup.sh -setup::install - -source ./.travis/lib-verify.sh -verify::flake8