From 228d3ec004fc1a24a9db04b8eec79c55a8bf3e06 Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Wed, 5 Feb 2020 15:49:21 -0500 Subject: [PATCH 1/5] [travis] Merge "verify" and "test" stages --- .travis.yml | 16 ++-------------- .travis/build.sh | 22 ++++++++++++++++++++++ .travis/lib-util.sh | 1 + .travis/lib-verify.sh | 25 ------------------------- .travis/verify.sh | 8 -------- 5 files changed, 25 insertions(+), 47 deletions(-) delete mode 100644 .travis/lib-verify.sh delete mode 100644 .travis/verify.sh diff --git a/.travis.yml b/.travis.yml index 62d45690..9928377a 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,19 +27,8 @@ 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" @@ -54,7 +42,7 @@ jobs: env: DISTRO=centos:7 PYTHON="2" # el7 doesn't do python3 modules - stage: test - env: DISTRO=fedora:latest PYTHON="3" + env: DISTRO=fedora:latest PYTHON="3" FLAKE="yes" - stage: test env: DISTRO=fedora:latest PYTHON="2" 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-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 From c2187edcbd2f8832a2499bcc527bde9433b5811b Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Wed, 5 Feb 2020 15:53:49 -0500 Subject: [PATCH 2/5] [travis] Replace el7 builder with el8 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9928377a..8725777d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,8 +38,9 @@ jobs: - 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 + env: DISTRO=centos:8 PYTHON="3" - stage: test env: DISTRO=fedora:latest PYTHON="3" FLAKE="yes" From 1596ab5129e09ae86442090b9817a3da269e49a2 Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Wed, 5 Feb 2020 16:00:32 -0500 Subject: [PATCH 3/5] Drop python2 builders/releases --- .travis.yml | 28 ++++------------------------ .travis/lib-setup.sh | 7 ------- 2 files changed, 4 insertions(+), 31 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8725777d..af5767ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,9 +29,6 @@ script: jobs: # 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 @@ -45,32 +42,22 @@ jobs: - stage: test env: DISTRO=fedora:latest PYTHON="3" FLAKE="yes" - - stage: test - env: DISTRO=fedora:latest PYTHON="2" - - &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.7.3" 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" - - - stage: deploy latest docs script: skip env: @@ -88,7 +75,6 @@ jobs: on: all_branches: true - - stage: deploy script: skip env: @@ -135,17 +121,11 @@ 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.7.3" language: sh # Travis doesn't support python here - <<: *win_deploy env: - PYTHON="3" - PYENV="3.6.8" - - - <<: *win_deploy - env: - - PYTHON="3" - - PYENV="3.7.3" diff --git a/.travis/lib-setup.sh b/.travis/lib-setup.sh index be069454..f0367961 100644 --- a/.travis/lib-setup.sh +++ b/.travis/lib-setup.sh @@ -83,13 +83,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 } From c5f601c483c49597fc60a79e0a0086fbdc13fd66 Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Wed, 5 Feb 2020 16:34:34 -0500 Subject: [PATCH 4/5] [travis] Disable modularity repos to increase build speed --- .travis/lib-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis/lib-setup.sh b/.travis/lib-setup.sh index f0367961..c0915041 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() { From 97184e05b652d94517406ca82c55150c3f42be00 Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Wed, 5 Feb 2020 16:03:21 -0500 Subject: [PATCH 5/5] [travis] Bump to latest versions for non-Linux platforms --- .travis.yml | 16 +++++++++++++--- .travis/lib-setup.sh | 3 ++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index af5767ae..99694d75 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ jobs: # need to explictly define each builder for test due to different os types include: - 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" @@ -42,6 +42,7 @@ jobs: - stage: test 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="3" KRB5_VER="heimdal" PYENV="3.6.3" @@ -51,10 +52,13 @@ jobs: - &win_test stage: test - env: PYTHON="3" PYENV="3.7.3" + env: PYTHON="3" PYENV="3.8.1" os: windows language: sh # Windows not supported yet + - <<: *win_test + env: PYTHON="3" PYENV="3.7.3" + - <<: *win_test env: PYTHON="3" PYENV="3.6.8" @@ -122,10 +126,16 @@ jobs: - ./.travis/deploy-win.sh env: - PYTHON="3" - - PYENV="3.7.3" + - PYENV="3.8.1" language: sh # Travis doesn't support python here + - <<: *win_deploy + env: + - PYTHON="3" + - PYENV="3.7.3" + - <<: *win_deploy env: - PYTHON="3" - PYENV="3.6.8" + diff --git a/.travis/lib-setup.sh b/.travis/lib-setup.sh index c0915041..0f0c4ce2 100644 --- a/.travis/lib-setup.sh +++ b/.travis/lib-setup.sh @@ -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