From f2e7d5fd36d34802f43232c26836eee3e7123218 Mon Sep 17 00:00:00 2001 From: liam-m Date: Wed, 6 Nov 2019 07:33:50 +0000 Subject: [PATCH 01/12] Split Travis config into jobs --- .travis.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index cadf41b..34dca0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,14 +7,20 @@ python: - "3.7" - "3.8" - "nightly" -install: - - pip install mypy - - pip install coverage - - pip install pylint -script: - - mypy primes.py binary_search.py --strict - - python test.py - - coverage run --include=primes.py,test.py,binary_search.py test.py && coverage report -m --fail-under=100 --rcfile=coveragerc - - python speed_test.py --all - - python speed_test.py --fermat 6 - - pylint primes.py binary_search.py +jobs: + include: + - name: "mypy" + install: pip install mypy + script: mypy primes.py binary_search.py --strict + - name: "pylint" + install: pip install pylint + script: pylint primes.py binary_search.py + - name: "Unit Tests" + script: python test.py + - name: "Coverage" + install: pip install coverage + script: coverage run --include=primes.py,test.py,binary_search.py test.py && coverage report -m --fail-under=100 --rcfile=coveragerc + - name: "Speed Test All" + script: python speed_test.py --all + - name: "Speed Test 6 Fermat Numbers" + script: python speed_test.py --fermat 6 From 7d010b80b1b543338b63b341c9aa9d3692c61449 Mon Sep 17 00:00:00 2001 From: liam-m Date: Wed, 6 Nov 2019 21:10:20 +0000 Subject: [PATCH 02/12] Test --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 34dca0b..9adcae9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,11 @@ jobs: - name: "mypy" install: pip install mypy script: mypy primes.py binary_search.py --strict + python: + - "3.6" + - "3.7" + - "3.8" + - "nightly" - name: "pylint" install: pip install pylint script: pylint primes.py binary_search.py From a823b47cc0a09c59d560c877dde0ed78f15f18c1 Mon Sep 17 00:00:00 2001 From: liam-m Date: Wed, 6 Nov 2019 21:19:29 +0000 Subject: [PATCH 03/12] Test --- .travis.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9adcae9..5fb4177 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,14 +9,13 @@ python: - "nightly" jobs: include: + - python: "3.6" + - python: "3.7" + - python: "3.8" + - python: "nightly" - name: "mypy" install: pip install mypy script: mypy primes.py binary_search.py --strict - python: - - "3.6" - - "3.7" - - "3.8" - - "nightly" - name: "pylint" install: pip install pylint script: pylint primes.py binary_search.py From 87e06fec61e241ab664e995d13b469281fe78c94 Mon Sep 17 00:00:00 2001 From: liam-m Date: Wed, 6 Nov 2019 21:28:00 +0000 Subject: [PATCH 04/12] Sigh --- .travis.yml | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 69 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5fb4177..db9bd37 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,22 +9,87 @@ python: - "nightly" jobs: include: - - python: "3.6" - - python: "3.7" - - python: "3.8" - - python: "nightly" - name: "mypy" + python: "3.6" install: pip install mypy script: mypy primes.py binary_search.py --strict - name: "pylint" + python: "3.6" install: pip install pylint script: pylint primes.py binary_search.py - name: "Unit Tests" + python: "3.6" script: python test.py - name: "Coverage" + python: "3.6" install: pip install coverage script: coverage run --include=primes.py,test.py,binary_search.py test.py && coverage report -m --fail-under=100 --rcfile=coveragerc - name: "Speed Test All" + python: "3.6" script: python speed_test.py --all - name: "Speed Test 6 Fermat Numbers" + python: "3.6" + script: python speed_test.py --fermat 6 + - name: "mypy" + python: "3.7" + install: pip install mypy + script: mypy primes.py binary_search.py --strict + - name: "pylint" + python: "3.7" + install: pip install pylint + script: pylint primes.py binary_search.py + - name: "Unit Tests" + python: "3.7" + script: python test.py + - name: "Coverage" + python: "3.7" + install: pip install coverage + script: coverage run --include=primes.py,test.py,binary_search.py test.py && coverage report -m --fail-under=100 --rcfile=coveragerc + - name: "Speed Test All" + python: "3.7" + script: python speed_test.py --all + - name: "Speed Test 6 Fermat Numbers" + python: "3.7" + script: python speed_test.py --fermat 6 + - name: "mypy" + python: "3.8" + install: pip install mypy + script: mypy primes.py binary_search.py --strict + - name: "pylint" + python: "3.8" + install: pip install pylint + script: pylint primes.py binary_search.py + - name: "Unit Tests" + python: "3.8" + script: python test.py + - name: "Coverage" + python: "3.8" + install: pip install coverage + script: coverage run --include=primes.py,test.py,binary_search.py test.py && coverage report -m --fail-under=100 --rcfile=coveragerc + - name: "Speed Test All" + python: "3.8" + script: python speed_test.py --all + - name: "Speed Test 6 Fermat Numbers" + python: "3.8" + script: python speed_test.py --fermat 6 + - name: "mypy" + python: "nightly" + install: pip install mypy + script: mypy primes.py binary_search.py --strict + - name: "pylint" + python: "nightly" + install: pip install pylint + script: pylint primes.py binary_search.py + - name: "Unit Tests" + python: "nightly" + script: python test.py + - name: "Coverage" + python: "nightly" + install: pip install coverage + script: coverage run --include=primes.py,test.py,binary_search.py test.py && coverage report -m --fail-under=100 --rcfile=coveragerc + - name: "Speed Test All" + python: "nightly" + script: python speed_test.py --all + - name: "Speed Test 6 Fermat Numbers" + python: "nightly" script: python speed_test.py --fermat 6 From cd7bd23175a749e996ff3d89a7be9478ab550a40 Mon Sep 17 00:00:00 2001 From: liam-m Date: Wed, 6 Nov 2019 21:28:25 +0000 Subject: [PATCH 05/12] Update .travis.yml --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index db9bd37..fd3a712 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,6 @@ version: ~> 1.0 os: linux dist: xenial # required for Python >= 3.7 language: python -python: - - "3.6" - - "3.7" - - "3.8" - - "nightly" jobs: include: - name: "mypy" From fc0a4902091b7820e6dc423fd3c568eca1a9aa41 Mon Sep 17 00:00:00 2001 From: liam-m Date: Wed, 6 Nov 2019 21:39:17 +0000 Subject: [PATCH 06/12] Try using YAML aliases https://docs.travis-ci.com/user/build-stages/using-yaml-aliases/ --- .travis.yml | 121 +++++++++++++++++++++++----------------------------- 1 file changed, 54 insertions(+), 67 deletions(-) diff --git a/.travis.yml b/.travis.yml index fd3a712..f9ba984 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,87 +4,74 @@ dist: xenial # required for Python >= 3.7 language: python jobs: include: - - name: "mypy" - python: "3.6" + - &mypy + name: "mypy" install: pip install mypy script: mypy primes.py binary_search.py --strict - - name: "pylint" - python: "3.6" - install: pip install pylint - script: pylint primes.py binary_search.py - - name: "Unit Tests" - python: "3.6" - script: python test.py - - name: "Coverage" - python: "3.6" - install: pip install coverage - script: coverage run --include=primes.py,test.py,binary_search.py test.py && coverage report -m --fail-under=100 --rcfile=coveragerc - - name: "Speed Test All" - python: "3.6" - script: python speed_test.py --all - - name: "Speed Test 6 Fermat Numbers" + - <<: *mypy python: "3.6" - script: python speed_test.py --fermat 6 - - name: "mypy" + - <<: *mypy python: "3.7" - install: pip install mypy - script: mypy primes.py binary_search.py --strict - - name: "pylint" - python: "3.7" - install: pip install pylint - script: pylint primes.py binary_search.py - - name: "Unit Tests" - python: "3.7" - script: python test.py - - name: "Coverage" - python: "3.7" - install: pip install coverage - script: coverage run --include=primes.py,test.py,binary_search.py test.py && coverage report -m --fail-under=100 --rcfile=coveragerc - - name: "Speed Test All" - python: "3.7" - script: python speed_test.py --all - - name: "Speed Test 6 Fermat Numbers" - python: "3.7" - script: python speed_test.py --fermat 6 - - name: "mypy" + - <<: *mypy python: "3.8" - install: pip install mypy - script: mypy primes.py binary_search.py --strict - - name: "pylint" - python: "3.8" - install: pip install pylint - script: pylint primes.py binary_search.py - - name: "Unit Tests" - python: "3.8" - script: python test.py - - name: "Coverage" - python: "3.8" - install: pip install coverage - script: coverage run --include=primes.py,test.py,binary_search.py test.py && coverage report -m --fail-under=100 --rcfile=coveragerc - - name: "Speed Test All" - python: "3.8" - script: python speed_test.py --all - - name: "Speed Test 6 Fermat Numbers" - python: "3.8" - script: python speed_test.py --fermat 6 - - name: "mypy" - python: "nightly" - install: pip install mypy - script: mypy primes.py binary_search.py --strict - - name: "pylint" + - <<: *mypy python: "nightly" + - &pylint + name: "pylint" install: pip install pylint script: pylint primes.py binary_search.py - - name: "Unit Tests" + - <<: *pylint + python: "3.6" + - <<: *pylint + python: "3.7" + - <<: *pylint + python: "3.8" + - <<: *pylint python: "nightly" + - &unit-tests + name: "Unit Tests" script: python test.py - - name: "Coverage" + - <<: *unit-tests + python: "3.6" + - <<: *unit-tests + python: "3.7" + - <<: *unit-tests + python: "3.8" + - <<: *unit-tests python: "nightly" + - &coverage + name: "Coverage" install: pip install coverage script: coverage run --include=primes.py,test.py,binary_search.py test.py && coverage report -m --fail-under=100 --rcfile=coveragerc - - name: "Speed Test All" + - <<: *coverage + python: "3.6" + - <<: *coverage + python: "3.7" + - <<: *coverage + python: "3.8" + - <<: *coverage python: "nightly" + - &speed-test-all + name: "Speed Test All" + python: "3.6" script: python speed_test.py --all - - name: "Speed Test 6 Fermat Numbers" + - <<: *speed-test-all + python: "3.6" + - <<: *speed-test-all + python: "3.7" + - <<: *speed-test-all + python: "3.8" + - <<: *speed-test-all python: "nightly" + - &speed-test-fermat + name: "Speed Test 6 Fermat Numbers" + python: "3.6" script: python speed_test.py --fermat 6 + - <<: *speed-test-fermat + python: "3.6" + - <<: *speed-test-fermat + python: "3.7" + - <<: *speed-test-fermat + python: "3.8" + - <<: *speed-test-fermat + python: "nightly" From 9e095789cc0f42d7234e5b4082856c7084663f44 Mon Sep 17 00:00:00 2001 From: liam-m Date: Wed, 6 Nov 2019 21:41:33 +0000 Subject: [PATCH 07/12] Don't really need to run mypy, pylint, or coverage on every version --- .travis.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index f9ba984..a2db106 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,24 +8,12 @@ jobs: name: "mypy" install: pip install mypy script: mypy primes.py binary_search.py --strict - - <<: *mypy - python: "3.6" - - <<: *mypy - python: "3.7" - - <<: *mypy - python: "3.8" - <<: *mypy python: "nightly" - &pylint name: "pylint" install: pip install pylint script: pylint primes.py binary_search.py - - <<: *pylint - python: "3.6" - - <<: *pylint - python: "3.7" - - <<: *pylint - python: "3.8" - <<: *pylint python: "nightly" - &unit-tests @@ -43,12 +31,6 @@ jobs: name: "Coverage" install: pip install coverage script: coverage run --include=primes.py,test.py,binary_search.py test.py && coverage report -m --fail-under=100 --rcfile=coveragerc - - <<: *coverage - python: "3.6" - - <<: *coverage - python: "3.7" - - <<: *coverage - python: "3.8" - <<: *coverage python: "nightly" - &speed-test-all From c9e8f272b5df3b2aa2ce70323ff26dcfc2ddecca Mon Sep 17 00:00:00 2001 From: liam-m Date: Wed, 6 Nov 2019 21:43:26 +0000 Subject: [PATCH 08/12] Try to avoid jobs running on default (3.6) python --- .travis.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index a2db106..acca8ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,20 +2,15 @@ version: ~> 1.0 os: linux dist: xenial # required for Python >= 3.7 language: python +python: "nightly" jobs: include: - - &mypy - name: "mypy" + - name: "mypy" install: pip install mypy script: mypy primes.py binary_search.py --strict - - <<: *mypy - python: "nightly" - - &pylint - name: "pylint" + - name: "pylint" install: pip install pylint script: pylint primes.py binary_search.py - - <<: *pylint - python: "nightly" - &unit-tests name: "Unit Tests" script: python test.py @@ -27,12 +22,9 @@ jobs: python: "3.8" - <<: *unit-tests python: "nightly" - - &coverage - name: "Coverage" + - name: "Coverage" install: pip install coverage script: coverage run --include=primes.py,test.py,binary_search.py test.py && coverage report -m --fail-under=100 --rcfile=coveragerc - - <<: *coverage - python: "nightly" - &speed-test-all name: "Speed Test All" python: "3.6" From f0fb0eaff33cedaf744049e3096a7f8c711fc16a Mon Sep 17 00:00:00 2001 From: liam-m Date: Wed, 6 Nov 2019 21:52:08 +0000 Subject: [PATCH 09/12] Avoid duplicate name in validation --- .travis.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index acca8ca..996a3d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,40 +12,49 @@ jobs: install: pip install pylint script: pylint primes.py binary_search.py - &unit-tests - name: "Unit Tests" script: python test.py - <<: *unit-tests + name: "Unit Tests 3.6" python: "3.6" - <<: *unit-tests + name: "Unit Tests 3.7" python: "3.7" - <<: *unit-tests + name: "Unit Tests 3.8" python: "3.8" - <<: *unit-tests + name: "Unit Tests Nightly" python: "nightly" - name: "Coverage" install: pip install coverage script: coverage run --include=primes.py,test.py,binary_search.py test.py && coverage report -m --fail-under=100 --rcfile=coveragerc - &speed-test-all - name: "Speed Test All" python: "3.6" script: python speed_test.py --all - <<: *speed-test-all + name: "Speed Test All 3.6" python: "3.6" - <<: *speed-test-all + name: "Speed Test All 3.7" python: "3.7" - <<: *speed-test-all + name: "Speed Test All 3.8" python: "3.8" - <<: *speed-test-all + name: "Speed Test All Nightly" python: "nightly" - &speed-test-fermat - name: "Speed Test 6 Fermat Numbers" python: "3.6" script: python speed_test.py --fermat 6 - <<: *speed-test-fermat + name: "Speed Test 6 Fermat Numbers 3.6" python: "3.6" - <<: *speed-test-fermat + name: "Speed Test 6 Fermat Numbers 3.7" python: "3.7" - <<: *speed-test-fermat + name: "Speed Test 6 Fermat Numbers 3.8" python: "3.8" - <<: *speed-test-fermat + name: "Speed Test 6 Fermat Numbers Nightly" python: "nightly" From f80710ac5e93e47597343cd5933f34490e06c536 Mon Sep 17 00:00:00 2001 From: liam-m Date: Wed, 6 Nov 2019 21:54:28 +0000 Subject: [PATCH 10/12] Avoid redundant jobs --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 996a3d5..2ff1495 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,6 @@ jobs: script: pylint primes.py binary_search.py - &unit-tests script: python test.py - - <<: *unit-tests name: "Unit Tests 3.6" python: "3.6" - <<: *unit-tests @@ -31,7 +30,6 @@ jobs: - &speed-test-all python: "3.6" script: python speed_test.py --all - - <<: *speed-test-all name: "Speed Test All 3.6" python: "3.6" - <<: *speed-test-all @@ -46,7 +44,6 @@ jobs: - &speed-test-fermat python: "3.6" script: python speed_test.py --fermat 6 - - <<: *speed-test-fermat name: "Speed Test 6 Fermat Numbers 3.6" python: "3.6" - <<: *speed-test-fermat From 9502afe8c2ee7f3ac621a0008a65edb87d46fc71 Mon Sep 17 00:00:00 2001 From: liam-m Date: Wed, 6 Nov 2019 22:10:41 +0000 Subject: [PATCH 11/12] Join speed test jobs --- .travis.yml | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2ff1495..4598f1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,31 +27,18 @@ jobs: - name: "Coverage" install: pip install coverage script: coverage run --include=primes.py,test.py,binary_search.py test.py && coverage report -m --fail-under=100 --rcfile=coveragerc - - &speed-test-all + - &speed-test + script: + - python speed_test.py --all + - python speed_test.py --fermat 6 + name: "Speed Test 3.6" python: "3.6" - script: python speed_test.py --all - name: "Speed Test All 3.6" - python: "3.6" - - <<: *speed-test-all - name: "Speed Test All 3.7" - python: "3.7" - - <<: *speed-test-all - name: "Speed Test All 3.8" - python: "3.8" - - <<: *speed-test-all - name: "Speed Test All Nightly" - python: "nightly" - - &speed-test-fermat - python: "3.6" - script: python speed_test.py --fermat 6 - name: "Speed Test 6 Fermat Numbers 3.6" - python: "3.6" - - <<: *speed-test-fermat - name: "Speed Test 6 Fermat Numbers 3.7" + - <<: *speed-test + name: "Speed Test 3.7" python: "3.7" - - <<: *speed-test-fermat - name: "Speed Test 6 Fermat Numbers 3.8" + - <<: *speed-test + name: "Speed Test 3.8" python: "3.8" - - <<: *speed-test-fermat - name: "Speed Test 6 Fermat Numbers Nightly" + - <<: *speed-test + name: "Speed Test Nightly" python: "nightly" From 3f9f29297235b6ebd3f32edb09a11afa3fce4ac7 Mon Sep 17 00:00:00 2001 From: liam-m Date: Wed, 6 Nov 2019 22:17:27 +0000 Subject: [PATCH 12/12] Join mypy and pylint stages Not worth the overhead of setting up the environment when each takes a few seconds to do the important part --- .travis.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4598f1c..8a2baac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,12 +5,13 @@ language: python python: "nightly" jobs: include: - - name: "mypy" - install: pip install mypy - script: mypy primes.py binary_search.py --strict - - name: "pylint" - install: pip install pylint - script: pylint primes.py binary_search.py + - name: "Type check and lint" + install: + - pip install mypy + - pip install pylint + script: + - mypy primes.py binary_search.py --strict + - pylint primes.py binary_search.py - &unit-tests script: python test.py name: "Unit Tests 3.6"