diff --git a/.travis.yml b/.travis.yml index 1b5989ab4..5ccaa3ff7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,47 @@ language: python -sudo: false + python: + # CPython: - "2.7" - - "pypy" - - "pypy3" + - "3.3" - "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 # 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 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 + +# Linux setup +dist: trusty +sudo: false + +matrix: + # see "os: ..." above + include: + - os: osx + python: "3.6-dev" + - os: osx + python: "3.7-dev" + - os: osx + python: "nightly" + + # 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: "nightly" + install: - travis_retry pip install . - travis_retry pip install -r requirements.txt 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 `__. 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/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 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 e3aed2126..822827c42 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(5) 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)