From d7bafb7f9ee916aeb7d4030c6a2d2dca1c06e3a3 Mon Sep 17 00:00:00 2001 From: cclauss Date: Fri, 31 Aug 2018 12:22:45 +0200 Subject: [PATCH 01/14] Travis CI: Add Python 3.6 testing on Linux in allow_failures mode A different take on #71 --- .travis.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index c5abc6f2..ca198f74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,24 +2,30 @@ language: go go: - "1.10.x" -os: - - linux - - osx +matrix: + allow_failures: + python: 3.6 + include: + - python: 2.7 + env: PIP_SUDO="" + - python: 3.6 + env: PIP_SUDO="" + - os: osx + env: PIP_SUDO="sudo" + before_script: - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # /~https://github.com/travis-ci/travis-ci/issues/8920#issuecomment-352661024 # Run gofmt and lint serially to avoid confusing output. Run tests in parallel # for speed. - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo pip2 install pytest pytest-cov coverage; fi - - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then pip2 install pytest pytest-cov coverage --user ; fi + - ${PIP_SUDO} python -m pip install pytest pytest-cov coverage + script: # Install the thing - cd grumpy-tools-src - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo pip2 install . ; fi - - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then pip2 install . --user ; fi + - ${PIP_SUDO} python -m pip install . - which grumpy - cd ../grumpy-runtime-src - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo pip2 install . ; fi - - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then pip2 install . --user ; fi + - ${PIP_SUDO} python -m pip install . # Test the thing - cd ../grumpy-tools-src - pytest From d8fbe2703d6b3a9ce3caa155b5d46603b9945b78 Mon Sep 17 00:00:00 2001 From: cclauss Date: Fri, 31 Aug 2018 12:34:16 +0200 Subject: [PATCH 02/14] language: python, go:, python: --- .travis.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ca198f74..3c8ac833 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,16 +4,22 @@ go: matrix: allow_failures: - python: 3.6 + - python: 3.6 include: - - python: 2.7 + - language: python + go: + python: 2.7 env: PIP_SUDO="" - - python: 3.6 + - language: python + go: + python: 3.6 env: PIP_SUDO="" - os: osx env: PIP_SUDO="sudo" before_script: + - python --version && pip --version + - sudo pip install --upgrade pip - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # /~https://github.com/travis-ci/travis-ci/issues/8920#issuecomment-352661024 # Run gofmt and lint serially to avoid confusing output. Run tests in parallel # for speed. From eee9e661c7f9d79370ffc1e67e18652a6a450e99 Mon Sep 17 00:00:00 2001 From: cclauss Date: Fri, 31 Aug 2018 12:40:57 +0200 Subject: [PATCH 03/14] language: python, go: "1.10.x", python: --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3c8ac833..a7e1249b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,19 +7,18 @@ matrix: - python: 3.6 include: - language: python - go: + go: "1.10.x" python: 2.7 env: PIP_SUDO="" - language: python - go: + go: "1.10.x" python: 3.6 env: PIP_SUDO="" - os: osx env: PIP_SUDO="sudo" before_script: - - python --version && pip --version - - sudo pip install --upgrade pip + - go version && python --version && pip --version - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # /~https://github.com/travis-ci/travis-ci/issues/8920#issuecomment-352661024 # Run gofmt and lint serially to avoid confusing output. Run tests in parallel # for speed. From 863584bc05cf99ce40fa12eea1277b08e7add43e Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 1 Sep 2018 03:24:46 +0200 Subject: [PATCH 04/14] apt-get install golang-1.10-go from ppa:gophers/archive --- .travis.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index a7e1249b..6e68a25f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,29 @@ -language: go -go: - - "1.10.x" +language: python + +addons: + apt: + sources: + - sourceline: 'ppa:gophers/archive' + update: true + packages: golang-1.10-go matrix: allow_failures: - python: 3.6 include: - - language: python - go: "1.10.x" - python: 2.7 + - python: 2.7 env: PIP_SUDO="" - - language: python - go: "1.10.x" - python: 3.6 + - python: 3.6 env: PIP_SUDO="" - os: osx env: PIP_SUDO="sudo" before_script: - - go version && python --version && pip --version + - PATH=/usr/lib/go-1.10/bin:${PATH} + - go version + - python --version && python -m pip --version + - ${PIP_SUDO] pip install --upgrade pip + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # /~https://github.com/travis-ci/travis-ci/issues/8920#issuecomment-352661024 # Run gofmt and lint serially to avoid confusing output. Run tests in parallel # for speed. From 95c83eae80e3d7598a9ac0849e5a824175d97f57 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 1 Sep 2018 08:17:30 +0200 Subject: [PATCH 05/14] ] --> } --- .travis.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e68a25f..f37193ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,17 +18,16 @@ matrix: - os: osx env: PIP_SUDO="sudo" -before_script: +install: + - ${PIP_SUDO} pip install --upgrade pip - PATH=/usr/lib/go-1.10/bin:${PATH} - go version - - python --version && python -m pip --version - - ${PIP_SUDO] pip install --upgrade pip - - - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # /~https://github.com/travis-ci/travis-ci/issues/8920#issuecomment-352661024 -# Run gofmt and lint serially to avoid confusing output. Run tests in parallel -# for speed. - ${PIP_SUDO} python -m pip install pytest pytest-cov coverage +before_script: + # /~https://github.com/travis-ci/travis-ci/issues/8920#issuecomment-352661024 + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" + script: # Install the thing - cd grumpy-tools-src @@ -40,6 +39,8 @@ script: - cd ../grumpy-tools-src - pytest - cd ../grumpy-runtime-src + # Run gofmt and lint serially to avoid confusing output. Run tests in parallel + # for speed. - make gofmt lint && make -j2 test # OSX swallows error logs: /~https://github.com/travis-ci/travis-ci/issues/6018 From 195c728417aaa1adf81caf079ad470d7d936aa6c Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 1 Sep 2018 08:29:02 +0200 Subject: [PATCH 06/14] fcntl first --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f37193ac..fceac5b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,11 +22,11 @@ install: - ${PIP_SUDO} pip install --upgrade pip - PATH=/usr/lib/go-1.10/bin:${PATH} - go version - - ${PIP_SUDO} python -m pip install pytest pytest-cov coverage before_script: # /~https://github.com/travis-ci/travis-ci/issues/8920#issuecomment-352661024 - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" + - ${PIP_SUDO} python -m pip install pytest pytest-cov coverage script: # Install the thing From 31b0be605408356ed4cefa02f41aeb1799799307 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 1 Sep 2018 10:05:40 +0200 Subject: [PATCH 07/14] language: - go - python --- .travis.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index fceac5b4..8e053dce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,9 @@ -language: python +language: + - go + - python -addons: - apt: - sources: - - sourceline: 'ppa:gophers/archive' - update: true - packages: golang-1.10-go +go: + - "1.10.x" matrix: allow_failures: @@ -20,8 +18,6 @@ matrix: install: - ${PIP_SUDO} pip install --upgrade pip - - PATH=/usr/lib/go-1.10/bin:${PATH} - - go version before_script: # /~https://github.com/travis-ci/travis-ci/issues/8920#issuecomment-352661024 From 314db71b8987a0432b7efebe5e4b985efa4326f1 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 1 Sep 2018 10:12:35 +0200 Subject: [PATCH 08/14] Bring back ${USER_FLAG} --- .travis.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8e053dce..90d3f341 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,27 +10,32 @@ matrix: - python: 3.6 include: - python: 2.7 - env: PIP_SUDO="" + env: + - PIP_SUDO="" + USER_FLAG="--user" - python: 3.6 - env: PIP_SUDO="" + - PIP_SUDO="" + USER_FLAG="--user" - os: osx - env: PIP_SUDO="sudo" + - PIP_SUDO="sudo" + USER_FLAG="" install: - - ${PIP_SUDO} pip install --upgrade pip + - python --version && python -m pip --version + - ${PIP_SUDO} pip install --upgrade pip ${USER_FLAG} before_script: # /~https://github.com/travis-ci/travis-ci/issues/8920#issuecomment-352661024 - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" - - ${PIP_SUDO} python -m pip install pytest pytest-cov coverage + - ${PIP_SUDO} python -m pip install pytest pytest-cov coverage ${USER_FLAG} script: # Install the thing - cd grumpy-tools-src - - ${PIP_SUDO} python -m pip install . + - ${PIP_SUDO} python -m pip install . ${USER_FLAG} - which grumpy - cd ../grumpy-runtime-src - - ${PIP_SUDO} python -m pip install . + - ${PIP_SUDO} python -m pip install . ${USER_FLAG} # Test the thing - cd ../grumpy-tools-src - pytest From ff11c7cf89b438707a0e6a8931ff9a0857abf9ac Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 1 Sep 2018 10:14:19 +0200 Subject: [PATCH 09/14] Fix env: --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 90d3f341..a0328615 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,9 +14,11 @@ matrix: - PIP_SUDO="" USER_FLAG="--user" - python: 3.6 + env: - PIP_SUDO="" USER_FLAG="--user" - os: osx + env: - PIP_SUDO="sudo" USER_FLAG="" From 59d343b506ffc9abe4374e7b206056a6bcc7bb05 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sun, 2 Sep 2018 15:48:28 +0200 Subject: [PATCH 10/14] Tests: Py2.7&Go 1.10.x, Py2.7&Go 1.11.x, Py3.6&Go 1.10.x, and Mac Py2.7&Go 1.10.x --- .travis.yml | 50 +++++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index a0328615..8a5c2440 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,49 +1,57 @@ -language: - - go - - python +language: python -go: - - "1.10.x" +cache: + directories: + - $HOME/.cache/pip + - $HOME/.cache/pre-commit matrix: allow_failures: - python: 3.6 + - env: GO="stable" include: - python: 2.7 - env: - - PIP_SUDO="" - USER_FLAG="--user" + env: GO=1.10.x + - python: 2.7 + env: GO=stable # Currently 1.11 - python: 3.6 - env: - - PIP_SUDO="" - USER_FLAG="--user" + env: GO=1.10.x - os: osx - env: - - PIP_SUDO="sudo" - USER_FLAG="" + language: go + go: 1.10.x + install: brew install python@2 install: - - python --version && python -m pip --version - - ${PIP_SUDO} pip install --upgrade pip ${USER_FLAG} + - | + export GOPATH=~/gopath + export PATH="$GOPATH/bin:$PATH" + export TRAVIS_BUILD_DIR="$GOPATH/src/github.com/$TRAVIS_REPO_SLUG" + mkdir -p "$TRAVIS_BUILD_DIR" + rsync -az . "$TRAVIS_BUILD_DIR" + cd "$TRAVIS_BUILD_DIR" + # Use the current gimme because Travis gimme does not support syntax "1.10.x" and "stable" + eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=${GO} bash)" before_script: + - go version && python --version && python -m pip --version # /~https://github.com/travis-ci/travis-ci/issues/8920#issuecomment-352661024 - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" - - ${PIP_SUDO} python -m pip install pytest pytest-cov coverage ${USER_FLAG} + - pip install --upgrade pip + - pip install pytest pytest-cov coverage script: # Install the thing - cd grumpy-tools-src - - ${PIP_SUDO} python -m pip install . ${USER_FLAG} + - pip install . - which grumpy - cd ../grumpy-runtime-src - - ${PIP_SUDO} python -m pip install . ${USER_FLAG} + - pip install . # Test the thing + # Run gofmt and lint serially to avoid confusing output. Run tests in parallel + # for speed. - cd ../grumpy-tools-src - pytest - cd ../grumpy-runtime-src - # Run gofmt and lint serially to avoid confusing output. Run tests in parallel - # for speed. - make gofmt lint && make -j2 test # OSX swallows error logs: /~https://github.com/travis-ci/travis-ci/issues/6018 From f761215117cac178749be5e4a41a645963e89b12 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sun, 2 Sep 2018 16:11:54 +0200 Subject: [PATCH 11/14] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 8a5c2440..bf26c109 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ matrix: - os: osx language: go go: 1.10.x + env: PYTHON=2.7 install: brew install python@2 install: From f8c16d93711c26ba3bc43c6447738f27770fef61 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sun, 2 Sep 2018 16:29:36 +0200 Subject: [PATCH 12/14] OSX_PYTHON=2.7 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bf26c109..0c816eda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ matrix: - os: osx language: go go: 1.10.x - env: PYTHON=2.7 + env: OSX_PYTHON=2.7 install: brew install python@2 install: From dba59fe7f07873957f332e216d81bd4f40003ce5 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sun, 2 Sep 2018 17:28:52 +0200 Subject: [PATCH 13/14] Use flake8 on Python 3 to detect syntax errors --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 0c816eda..ce2a3028 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,9 @@ matrix: env: GO=stable # Currently 1.11 - python: 3.6 env: GO=1.10.x + script: # To detect Python 3 syntax errors in grumpy-tools + - pip install --upgrade flake8 + - flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics grumpy-tools-src - os: osx language: go go: 1.10.x From 1b7a26af9f7bcabc7a93e7ead72e666bbae64f03 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sun, 2 Sep 2018 17:49:52 +0200 Subject: [PATCH 14/14] Not dot --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ce2a3028..3662638b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ matrix: env: GO=1.10.x script: # To detect Python 3 syntax errors in grumpy-tools - pip install --upgrade flake8 - - flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics grumpy-tools-src + - flake8 --count --select=E901,E999,F821,F822,F823 --show-source --statistics grumpy-tools-src - os: osx language: go go: 1.10.x