From 3cacefedee25b329dcced22b9e532047837eac4a Mon Sep 17 00:00:00 2001 From: Felix Divo Date: Sat, 10 Feb 2018 15:41:03 +0100 Subject: [PATCH 01/12] added osx & windows to tests --- .travis.yml | 15 ++++++++++++--- setup.py | 3 +++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1b5989ab4..4956eec6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,23 @@ language: python sudo: false + python: + # CPython: - "2.7" - - "pypy" - - "pypy3" - "3.4" - "3.5" - "3.6" - - "3.7-dev" + - "3.7-dev" # TODO: change to "3.7" once it gets released - "nightly" + # PyPy: + - "pypy" + - "pypy3" + +os: + - linux + - osx + - windows + install: - travis_retry pip install . - travis_retry pip install -r requirements.txt diff --git a/setup.py b/setup.py index 8813466ed..98bf4a871 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,9 @@ +# -*- coding: utf-8 -*- + """ python-can requires the setuptools package to be installed. """ + import re import logging from setuptools import setup, find_packages From 36e0d262325341bcb7b41c43375433852fc8ec1b Mon Sep 17 00:00:00 2001 From: Felix Divo Date: Sat, 10 Feb 2018 16:03:12 +0100 Subject: [PATCH 02/12] remove windows since it's not supported and allow osx to fail --- .travis.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4956eec6a..700b774de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ language: python -sudo: false python: # CPython: @@ -15,8 +14,16 @@ python: os: - linux - - osx - - windows + - osx # OSX +# - windows # Windows is not supported by Travis CI as of Feb. 2018 + +sudo: false +dist: trusty + +matrix: + allow_failures: + - os: osx + #python: 3.3 install: - travis_retry pip install . From 1cee6b7745fb58b61de1375a97b682cc1dba9863 Mon Sep 17 00:00:00 2001 From: Felix Divo Date: Sat, 10 Feb 2018 16:33:11 +0100 Subject: [PATCH 03/12] added osx test environments selectively --- .travis.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 700b774de..2c9c344e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,17 +13,27 @@ python: - "pypy3" os: - - linux - - osx # OSX -# - windows # Windows is not supported by Travis CI as of Feb. 2018 + - linux # Linux is officially supported and we test the software under + # many different Python verions (see "python: ..." above) -sudo: false +# - osx # OSX is not officially supported by Travis CI as of Feb. 2018 + # nevertheless, "nightly" and "3.7-dev" seem to work, so we + # include them explicitly below, but allow them to fail as well + # for now + +# - windows # Windows is not supported at all by Travis CI as of Feb. 2018 + +# Linux setup dist: trusty +sudo: false matrix: + # see "os: ..." above allow_failures: - os: osx - #python: 3.3 + python: "3.7-dev" + - os: osx + python: "nightly" install: - travis_retry pip install . From 3ef96d40e81a55498c33bbbc6a13d4cea5ad8dee Mon Sep 17 00:00:00 2001 From: Felix Divo Date: Sat, 10 Feb 2018 16:34:38 +0100 Subject: [PATCH 04/12] fix missing "include" --- .travis.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2c9c344e8..857ce84ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,11 +29,12 @@ sudo: false matrix: # see "os: ..." above - allow_failures: - - os: osx - python: "3.7-dev" - - os: osx - python: "nightly" + include: + allow_failures: + - os: osx + python: "3.7-dev" + - os: osx + python: "nightly" install: - travis_retry pip install . From cbada9b3f2773c28b844d33f1fb18742c832e91b Mon Sep 17 00:00:00 2001 From: Felix Divo Date: Sat, 10 Feb 2018 16:37:20 +0100 Subject: [PATCH 05/12] further experiments --- .travis.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 857ce84ac..8200a7e25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,11 +30,13 @@ sudo: false matrix: # see "os: ..." above include: - allow_failures: - - os: osx - python: "3.7-dev" - - os: osx - python: "nightly" + - os: osx + python: "3.7-dev" + - os: osx + python: "nightly" + allow_failures: + - python: "3.7-dev" + - python: "nightly" install: - travis_retry pip install . From 09f203a331962ef3ffb2feab96b0f2af7dfd7a0b Mon Sep 17 00:00:00 2001 From: Felix Divo Date: Sat, 10 Feb 2018 16:52:43 +0100 Subject: [PATCH 06/12] expermiments --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8200a7e25..8bb0aeb71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,12 @@ matrix: python: "3.7-dev" - os: osx python: "nightly" + - os: osx + python: "3.6-stable" + - os: osx + python: "3.6-dev" + - os: osx + python: "3.6-nightly" allow_failures: - python: "3.7-dev" - python: "nightly" From f5ebba983fb55d683df2773f95dc2364439cb161 Mon Sep 17 00:00:00 2001 From: Felix Divo Date: Sat, 10 Feb 2018 17:30:01 +0100 Subject: [PATCH 07/12] some changes to the README.rst --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 9c14dc954..e3bc565aa 100644 --- a/README.rst +++ b/README.rst @@ -12,7 +12,7 @@ python-can :alt: Documentation Status .. |build| image:: https://travis-ci.org/hardbyte/python-can.svg?branch=develop - :target: https://travis-ci.org/hardbyte/python-can + :target: https://travis-ci.org/hardbyte/python-can/branches :alt: CI Server for develop branch @@ -26,7 +26,7 @@ Python developers; providing `common abstractions to different hardware devices`, and a suite of utilities for sending and receiving messages on a can bus. -The library supports Python 2.7, Python 3.3+ and runs on Mac, Linux and Windows. +The library supports Python 2.7, Python 3.3+ as well as PyPy and runs on Mac, Linux and Windows. You can find more information in the documentation, online at `python-can.readthedocs.org `__. From 6cb4ca4d3f305c7e88e59ede9b2ef358e914eda4 Mon Sep 17 00:00:00 2001 From: Felix Divo Date: Sat, 10 Feb 2018 17:30:16 +0100 Subject: [PATCH 08/12] expermiments --- .travis.yml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8bb0aeb71..b539e576f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: python python: # CPython: - "2.7" + - "3.3" - "3.4" - "3.5" - "3.6" @@ -11,15 +12,16 @@ python: # PyPy: - "pypy" - "pypy3" + - "pypy-dev" + - "pypy3-dev" os: - linux # Linux is officially supported and we test the software under # many different Python verions (see "python: ..." above) -# - osx # OSX is not officially supported by Travis CI as of Feb. 2018 - # nevertheless, "nightly" and "3.7-dev" seem to work, so we - # include them explicitly below, but allow them to fail as well - # for now +# - osx # Python + OSX is not officially supported by Travis CI as of Feb. 2018 + # nevertheless, "nightly" and "something-dev" seem to work, so we + # include them explicitly below # - windows # Windows is not supported at all by Travis CI as of Feb. 2018 @@ -31,17 +33,30 @@ matrix: # see "os: ..." above include: - os: osx - python: "3.7-dev" + python: "2.7-dev" - os: osx - python: "nightly" + python: "3.3-dev" - os: osx - python: "3.6-stable" + python: "3.4-dev" + - os: osx + python: "3.5-dev" - os: osx python: "3.6-dev" - os: osx - python: "3.6-nightly" + python: "3.7-dev" + - os: osx + python: "nightly" + - os: osx + python: "pypy-dev" + - os: osx + python: "pypy3-dev" allow_failures: - - python: "3.7-dev" + # allow dev/nighly builds to fail + #- python: "2.7-dev" + #- python: "3.4-dev" + #- python: "3.5-dev" + #- python: "3.6-dev" + - python: "*-dev" - python: "nightly" install: From 1434658d1ea6d72f4ea51a1510ca1161cce1aae0 Mon Sep 17 00:00:00 2001 From: Felix Divo Date: Sat, 10 Feb 2018 17:39:08 +0100 Subject: [PATCH 09/12] experiments --- .travis.yml | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index b539e576f..92a86aab9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,14 +12,12 @@ python: # PyPy: - "pypy" - "pypy3" - - "pypy-dev" - - "pypy3-dev" os: - linux # Linux is officially supported and we test the software under # many different Python verions (see "python: ..." above) -# - osx # Python + OSX is not officially supported by Travis CI as of Feb. 2018 +# - osx # OSX + Python is not officially supported by Travis CI as of Feb. 2018 # nevertheless, "nightly" and "something-dev" seem to work, so we # include them explicitly below @@ -32,31 +30,17 @@ sudo: false matrix: # see "os: ..." above include: - - os: osx - python: "2.7-dev" - - os: osx - python: "3.3-dev" - - os: osx - python: "3.4-dev" - - os: osx - python: "3.5-dev" - os: osx python: "3.6-dev" - os: osx python: "3.7-dev" - os: osx python: "nightly" - - os: osx - python: "pypy-dev" - - os: osx - python: "pypy3-dev" + + # allow dev/nighly builds to fail allow_failures: - # allow dev/nighly builds to fail - #- python: "2.7-dev" - #- python: "3.4-dev" - #- python: "3.5-dev" - #- python: "3.6-dev" - - python: "*-dev" + - python: "3.6-dev" + - python: "3.7-dev" - python: "nightly" install: From 0046c3e19f1dcf34991dc9e097173e7dcf178228 Mon Sep 17 00:00:00 2001 From: Felix Divo Date: Sat, 10 Feb 2018 17:48:29 +0100 Subject: [PATCH 10/12] don't allow dev builds to fail --- .travis.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 92a86aab9..5ccaa3ff7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,12 +14,12 @@ python: - "pypy3" os: - - linux # Linux is officially supported and we test the software under + - linux # Linux is officially supported and we test the library under # many different Python verions (see "python: ..." above) # - osx # OSX + Python is not officially supported by Travis CI as of Feb. 2018 - # nevertheless, "nightly" and "something-dev" seem to work, so we - # include them explicitly below + # nevertheless, "nightly" and some "*-dev" versions seem to work, so we + # include them explicitly below (see "matrix: include: ..." below) # - windows # Windows is not supported at all by Travis CI as of Feb. 2018 @@ -37,10 +37,9 @@ matrix: - os: osx python: "nightly" - # allow dev/nighly builds to fail + # allow all nighly builds to fail, since these python versions might be unstable + # we do not allow dev builds to fail, since these builds are stable enough allow_failures: - - python: "3.6-dev" - - python: "3.7-dev" - python: "nightly" install: From bb23d5b378514a305c74dcd05916968a2a7b0a7b Mon Sep 17 00:00:00 2001 From: Brian Thorne Date: Sun, 11 Feb 2018 13:44:54 +1100 Subject: [PATCH 11/12] Improve test failure message --- can/__init__.py | 2 +- test/simplecyclic_test.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/can/__init__.py b/can/__init__.py index 4a4dac176..70d3b2531 100644 --- a/can/__init__.py +++ b/can/__init__.py @@ -5,7 +5,7 @@ import logging -__version__ = "2.0.0" +__version__ = "2.1.0.rc2" log = logging.getLogger('can') diff --git a/test/simplecyclic_test.py b/test/simplecyclic_test.py index e3aed2126..d24c0ef77 100644 --- a/test/simplecyclic_test.py +++ b/test/simplecyclic_test.py @@ -12,11 +12,11 @@ def test_cycle_time(self): task = bus.send_periodic(msg, 0.01, 1) self.assertIsInstance(task, can.broadcastmanager.CyclicSendTaskABC) - sleep(1.5) + sleep(2) size = bus2.queue.qsize() - print(size) # About 100 messages should have been transmitted - self.assertTrue(90 < size < 110) + self.assertTrue(90 < size < 110, + '100 +/- 10 messages should have been transmitted. But queue contained {}'.format(size)) last_msg = bus2.recv() self.assertEqual(last_msg, msg) From ce40cb68d0e705132c72e35dc8bde7c47e5af235 Mon Sep 17 00:00:00 2001 From: Brian Thorne Date: Tue, 13 Feb 2018 10:55:17 +1100 Subject: [PATCH 12/12] Make timing tests more forgiving for travis --- test/back2back_test.py | 6 ++++-- test/simplecyclic_test.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/back2back_test.py b/test/back2back_test.py index c20aac5e2..ef6e884f8 100644 --- a/test/back2back_test.py +++ b/test/back2back_test.py @@ -70,11 +70,13 @@ def test_no_message(self): def test_timestamp(self): self.bus2.send(can.Message()) recv_msg1 = self.bus1.recv(TIMEOUT) - time.sleep(1) + time.sleep(5) self.bus2.send(can.Message()) recv_msg2 = self.bus1.recv(TIMEOUT) delta_time = recv_msg2.timestamp - recv_msg1.timestamp - self.assertTrue(0.95 < delta_time < 1.05) + self.assertTrue(4.8 < delta_time < 5.2, + 'Time difference should have been 5s +/- 200ms.' + 'But measured {}'.format(delta_time)) def test_standard_message(self): msg = can.Message(extended_id=False, diff --git a/test/simplecyclic_test.py b/test/simplecyclic_test.py index d24c0ef77..822827c42 100644 --- a/test/simplecyclic_test.py +++ b/test/simplecyclic_test.py @@ -12,7 +12,7 @@ def test_cycle_time(self): task = bus.send_periodic(msg, 0.01, 1) self.assertIsInstance(task, can.broadcastmanager.CyclicSendTaskABC) - sleep(2) + sleep(5) size = bus2.queue.qsize() # About 100 messages should have been transmitted self.assertTrue(90 < size < 110,