Skip to content

Commit 4b93f21

Browse files
authored
Merge pull request #441 from hardbyte/release-3.0.0
2 parents d2b20ea + ed9ec6d commit 4b93f21

File tree

114 files changed

+4652
-1784
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+4652
-1784
lines changed

.appveyor.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,31 @@ environment:
33

44
# For Python versions available on Appveyor, see
55
# http://www.appveyor.com/docs/installed-software#python
6+
# Python 3.0-3.3 have reached EOL
67

78
- PYTHON: "C:\\Python27"
89
- PYTHON: "C:\\Python34"
910
- PYTHON: "C:\\Python35"
1011
- PYTHON: "C:\\Python36"
12+
- PYTHON: "C:\\Python37"
1113
- PYTHON: "C:\\Python27-x64"
1214
- PYTHON: "C:\\Python34-x64"
1315
- PYTHON: "C:\\Python35-x64"
1416
- PYTHON: "C:\\Python36-x64"
15-
16-
# Python 3.3 has reached EOL
17+
- PYTHON: "C:\\Python37-x64"
1718

1819
install:
19-
# Prepend Python installation to PATH
20-
- set PATH=%PYTHON_INSTALL%;%PATH%
21-
22-
# Prepend Python scripts to PATH (e.g. py.test)
23-
- set PATH=%PYTHON_INSTALL%\\Scripts;%PATH%
20+
# Prepend Python installation and scripts (e.g. pytest) to PATH
21+
- set PATH=%PYTHON_INSTALL%;%PYTHON_INSTALL%\\Scripts;%PATH%
2422

25-
# We need to install the python-can library itself
26-
- "python -m pip install .[test]"
23+
# We need to install the python-can library itself including the dependencies
24+
- "python -m pip install .[test,neovi]"
2725

2826
build: off
2927

3028
test_script:
31-
- "pytest -v --timeout=300"
29+
# run tests
30+
- "pytest"
31+
32+
# uplad coverage reports
33+
- "codecov"

.codecov.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Validate with curl --data-binary @.codecov.yml https://codecov.io/validate
2+
codecov:
3+
archive:
4+
uploads: no
5+
6+
coverage:
7+
precision: 2
8+
round: down
9+
range: 50...100
10+
status:
11+
project:
12+
default:
13+
# coverage may fall by <1.0% and still be considered "passing"
14+
threshold: 1.0%
15+
patch:
16+
default:
17+
# coverage may fall by <1.0% and still be considered "passing"
18+
threshold: 1.0%
19+
20+
comment:
21+
layout: "header, diff, changes"

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# https://github.com/github/gitignore/blob/da00310ccba9de9a988cc973ef5238ad2c1460e9/Python.gitignore
1+
test/__tempdir__/
2+
.pytest_cache/
3+
4+
# -------------------------
5+
# below: https://github.com/github/gitignore/blob/da00310ccba9de9a988cc973ef5238ad2c1460e9/Python.gitignore
26

37
# Byte-compiled / optimized / DLL files
48
__pycache__/
@@ -11,6 +15,7 @@ __pycache__/
1115
# Distribution / packaging
1216
.Python
1317
env/
18+
venv/
1419
build/
1520
develop-eggs/
1621
dist/

.travis.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,62 @@
11
language: python
22

33
python:
4-
# CPython:
4+
# CPython; versions 3.0-3.3 have reached EOL
55
- "2.7"
6-
# Python 3.3 has reached EOL and pytest fails there
76
- "3.4"
87
- "3.5"
98
- "3.6"
109
- "3.7-dev" # TODO: change to "3.7" once it is supported by travis-ci
1110
- "nightly"
1211
# PyPy:
13-
- "pypy"
14-
- "pypy3.5"
12+
- "pypy" # Python 2.7
13+
- "pypy3.5" # Python 3.5
1514

1615
os:
1716
- linux # Linux is officially supported and we test the library under
1817
# many different Python verions (see "python: ..." above)
1918

2019
# - osx # OSX + Python is not officially supported by Travis CI as of Feb. 2018
2120
# nevertheless, "nightly" and some "*-dev" versions seem to work, so we
22-
# include them explicitly below (see "matrix: include: ..." below)
21+
# include them explicitly below (see "matrix: include: ..." below).
22+
# They only seem to work with the xcode8.3 image, and not the newer ones.
23+
# Thus we will leave this in, until it breaks one day, at which point we
24+
# will probably reomve testing on OSX if it is not supported then.
25+
# See #385 on Github.
2326

2427
# - windows # Windows is not supported at all by Travis CI as of Feb. 2018
2528

2629
# Linux setup
2730
dist: trusty
28-
sudo: false
31+
sudo: required
2932

3033
matrix:
3134
# see "os: ..." above
3235
include:
3336
- os: osx
37+
osx_image: xcode8.3
3438
python: "3.6-dev"
3539
- os: osx
40+
osx_image: xcode8.3
3641
python: "3.7-dev"
3742
- os: osx
43+
osx_image: xcode8.3
3844
python: "nightly"
3945

4046
allow_failures:
4147
# allow all nighly builds to fail, since these python versions might be unstable
4248
- python: "nightly"
43-
4449
# we do not allow dev builds to fail, since these builds are considered stable enough
4550

4651
install:
4752
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo bash test/open_vcan.sh ; fi
53+
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then travis_retry pip install -r doc/doc-requirements.txt; fi
4854
- travis_retry pip install .[test]
49-
- travis_retry pip install sphinx
5055

5156
script:
52-
- pytest -v --timeout=300
57+
- pytest
58+
- codecov
5359
# Build Docs with Sphinx
54-
#
5560
# -a Write all files
56-
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then python -m sphinx -an doc build; fi
61+
# -n nitpicky
62+
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then python -m sphinx -an doc build; fi

CHANGELOG.txt

Lines changed: 108 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,109 @@
1+
Version 3.0.0
2+
====
3+
4+
Major features
5+
--------------
6+
7+
* Adds support for developing `asyncio` applications with `python-can` more easily. This can be useful
8+
when implementing protocols that handles simultaneous connections to many nodes since you can write
9+
synchronous looking code without handling multiple threads and locking mechanisms. #388
10+
* New can viewer terminal application. (`python -m can.viewer`) #390
11+
* More formally adds task management responsibility to the `Bus`. By default tasks created with
12+
`bus.send_periodic` will have a reference held by the bus - this means in many cases the user
13+
doesn't need to keep the task in scope for their periodic messages to continue being sent. If
14+
this behavior isn't desired pass `store_task=False` to the `send_periodic` method. Stop all tasks
15+
by calling the bus's new `stop_all_periodic_tasks` method. #412
16+
17+
18+
Breaking changes
19+
----------------
20+
21+
* Interfaces should no longer override `send_periodic` and instead implement
22+
`_send_periodic_internal` to allow the Bus base class to manage tasks. #426
23+
* writing to closed writers is not supported any more (it was supported only for some)
24+
* the file in the reader/writer is now always stored in the attribute uniformly called `file`, and not in
25+
something like `fp`, `log_file` or `output_file`. Changed the name of the first parameter of the
26+
read/writer constructors from `filename` to `file`.
27+
28+
29+
Other notable changes
30+
---------------------
31+
32+
* can.Message class updated #413
33+
- Addition of a `Message.equals` method.
34+
- Deprecate id_type in favor of is_extended_id
35+
- Initializer parameter extended_id deprecated in favor of is_extended_id
36+
- documentation, testing and example updates
37+
- Addition of support for various builtins: __repr__, __slots__, __copy__
38+
* IO module updates to bring consistency to the different CAN message writers and readers. #348
39+
- context manager support for all readers and writers
40+
- they share a common super class called `BaseIOHandler`
41+
- all file handles can now be closed with the `stop()` method
42+
- the table name in `SqliteReader`/`SqliteWriter` can be adjusted
43+
- append mode added in `CSVWriter` and `CanutilsLogWriter`
44+
- [file-like](https://docs.python.org/3/glossary.html#term-file-like-object) and
45+
[path-like](https://docs.python.org/3/glossary.html#term-path-like-object) objects can now be passed to
46+
the readers and writers (except to the Sqlite handlers)
47+
- add a `__ne__()` method to the `Message` class (this was required by the tests)
48+
- added a `stop()` method for `BufferedReader`
49+
- `SqliteWriter`: this now guarantees that all messages are being written, exposes some previously internal metrics
50+
and only buffers messages up to a certain limit before writing/committing to the database.
51+
- the unused `header_line` attribute from `CSVReader` has been removed
52+
- privatized some attributes that are only to be used internally in the classes
53+
- the method `Listener.on_message_received()` is now abstract (using `@abc.abstractmethod`)
54+
* Start testing against Python 3.7 #380
55+
* All scripts have been moved into `can/scripts`. #370, #406
56+
* Added support for additional sections to the config #338
57+
* Code coverage reports added. #346, #374
58+
* Bug fix to thread safe bus. #397
59+
60+
General fixes, cleanup and docs changes: (#347, #348, #367, #368, #370, #371, #373, #420, #417, #419, #432)
61+
62+
Backend Specific Changes
63+
------------------------
64+
65+
3rd party interfaces
66+
~~~~~~~~~~~~~~~~~~~~
67+
68+
* Deprecated `python_can.interface` entry point instead use `can.interface`. #389
69+
70+
neovi
71+
~~~~~
72+
73+
* Added support for CAN-FD #408
74+
* Fix issues checking if bus is open. #381
75+
* Adding multiple channels support. #415
76+
77+
nican
78+
~~~~~
79+
80+
* implements reset instead of custom `flush_tx_buffer`. #364
81+
82+
pcan
83+
~~~~
84+
85+
* now supported on OSX. #365
86+
87+
88+
serial
89+
~~~~~~
90+
91+
* Removed TextIOWrapper from serial. #383
92+
* switch to `serial_for_url` enabling using remote ports via `loop://`, ``socket://` and `rfc2217://` URLs. #393
93+
* hardware handshake using `rtscts` kwarg #402
94+
95+
socketcan
96+
~~~~~~~~~
97+
98+
* socketcan tasks now reuse a bcm socket #404, #425, #426,
99+
* socketcan bugfix to receive error frames #384
100+
101+
vector
102+
~~~~~~
103+
104+
* Vector interface now implements `_detect_available_configs`. #362
105+
* Added support to select device by serial number. #387
106+
1107
Version 2.2.1 (2018-07-12)
2108
=====
3109

@@ -14,7 +120,7 @@ Version 2.2.0 (2018-06-30)
14120
* Added synchronized (thread-safe) Bus variant.
15121
* context manager support for the Bus class.
16122
* Dropped support for Python 3.3 (officially reached end-of-life in Sept. 2017)
17-
* Deprecated the old `CAN` module, please use the newer `can` entry point (will be removed in version 2.4)
123+
* Deprecated the old `CAN` module, please use the newer `can` entry point (will be removed in an upcoming major version)
18124

19125
Version 2.1.0 (2018-02-17)
20126
=====
@@ -34,7 +140,7 @@ Version 2.0.0 (2018-01-05
34140

35141
After an extended baking period we have finally tagged version 2.0.0!
36142

37-
Quite a few major Changes from v1.x:
143+
Quite a few major changes from v1.x:
38144

39145
* New interfaces:
40146
* Vector

CONTRIBUTORS.txt

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
Ben Powell
2-
Brian Thorne <hardbyte@gmail.com>
3-
Geert Linders
4-
Mark Catley
5-
Phillip Dixon <pdixon@dynamiccontrols.com>
6-
Rose Lu
7-
Karl van Workum
8-
Albert Bloomfield <albert.bloomfield@ampeletricvehicles.com>
9-
Sam Bristow
10-
Ethan Zonca
11-
Robert Kaye
12-
Andrew Beal
13-
Jonas Frid
14-
Tynan McAuley
15-
Bruno Pennati
16-
Jack Jester-Weinstein
17-
Joshua Villyard
18-
Giuseppe Corbelli <giuseppe.corbelli@weightpack.com>
19-
Christian Sandberg
20-
Eduard Bröcker <eduard@gmx.de>
21-
Boris Wenzlaff
22-
Pierre-Luc Tessier Gagné
23-
Felix Divo <felix.divo@gmail.com>
1+
Ben Powell
2+
Brian Thorne <hardbyte@gmail.com>
3+
Geert Linders
4+
Mark Catley
5+
Phillip Dixon <pdixon@dynamiccontrols.com>
6+
Rose Lu
7+
Karl van Workum
8+
Albert Bloomfield <albert.bloomfield@ampeletricvehicles.com>
9+
Sam Bristow
10+
Ethan Zonca
11+
Robert Kaye
12+
Andrew Beal
13+
Jonas Frid
14+
Tynan McAuley
15+
Bruno Pennati
16+
Jack Jester-Weinstein
17+
Joshua Villyard
18+
Giuseppe Corbelli <giuseppe.corbelli@weightpack.com>
19+
Christian Sandberg
20+
Eduard Bröcker <eduard@gmx.de>
21+
Boris Wenzlaff
22+
Pierre-Luc Tessier Gagné
23+
Felix Divo <felix.divo@gmail.com>
24+
Kristian Sloth Lauszus <lauszus@gmail.com>

0 commit comments

Comments
 (0)