Skip to content

Commit 22dc9e3

Browse files
Merge branch 'develop' into pcan-bit-timing
2 parents cf441e7 + 6c01b3c commit 22dc9e3

File tree

140 files changed

+6131
-1594
lines changed

Some content is hidden

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

140 files changed

+6131
-1594
lines changed

.appveyor.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ install:
1414
# Prepend Python installation and scripts (e.g. pytest) to PATH
1515
- set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
1616

17-
# We need to install the python-can library itself including the dependencies
18-
- "python -m pip install .[test,neovi]"
17+
# Install tox
18+
- "pip install tox"
1919

2020
build: off
2121

2222
test_script:
2323
# run tests
24-
- "pytest"
25-
26-
# uplad coverage reports
27-
- "codecov -X gcov"
24+
- "tox -e appveyor"

.codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Validate with curl --data-binary @.codecov.yml https://codecov.io/validate
22
codecov:
33
archive:
4-
uploads: no
4+
uploads: yes
55

66
coverage:
77
precision: 2

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
os: [ubuntu-latest, macos-latest, windows-latest]
11+
python-version: [3.6, 3.7, 3.8]
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Python ${{ matrix.python-version }}
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install tox
22+
pip install -r requirements-lint.txt
23+
- name: Test with pytest via tox
24+
run: |
25+
tox -e gh
26+
- name: Code Format Check with Black
27+
run: |
28+
black --check --verbose .

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
test/__tempdir__/
22
.pytest_cache/
3+
.mypy_cache/
4+
.dmypy.json
5+
dmypy.json
36

47
# -------------------------
58
# below: https://github.com/github/gitignore/blob/da00310ccba9de9a988cc973ef5238ad2c1460e9/Python.gitignore

.mergify.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
pull_request_rules:
2+
- name: Automatic merge passing PR on up to date branch with approving CR
3+
conditions:
4+
- "#approved-reviews-by>=1"
5+
- "#review-requested=0"
6+
- "#changes-requested-reviews-by=0"
7+
- "#commented-reviews-by=0"
8+
- "status-success=continuous-integration/travis-ci/pr"
9+
- "label!=work-in-progress"
10+
actions:
11+
merge:
12+
method: merge
13+
strict: smart+fasttrack
14+
- name: Request Brian to review changes on core api.
15+
conditions:
16+
- "-files~=^can/interfaces/$"
17+
- "-closed"
18+
- "author!=hardbyte"
19+
actions:
20+
request_reviews:
21+
users:
22+
- hardbyte
23+
24+
- name: delete head branch after merge
25+
conditions:
26+
- merged
27+
actions:
28+
delete_head_branch: {}

.pylintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
# run arbitrary code.
66
extension-pkg-whitelist=
77

8-
# Add files or directories to the blacklist. They should be base names, not
8+
# Add files or directories to be ignored. They should be base names, not
99
# paths.
1010
ignore=CVS
1111

12-
# Add files or directories matching the regex patterns to the blacklist. The
12+
# Add files or directories matching the regex patterns to be ignored. The
1313
# regex matches against base names, not paths.
1414
ignore-patterns=
1515

.pylintrc-wip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
# run arbitrary code.
66
extension-pkg-whitelist=
77

8-
# Add files or directories to the blacklist. They should be base names, not
8+
# Add files or directories to be ignored. They should be base names, not
99
# paths.
1010
ignore=CVS
1111

12-
# Add files or directories matching the regex patterns to the blacklist. The
12+
# Add files or directories matching the regex patterns to to be ignored. The
1313
# regex matches against base names, not paths.
1414
ignore-patterns=
1515

.travis.yml

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ python:
1111
# CPython; only 3.6 is supported
1212
- "3.6"
1313
- "3.7"
14-
- 3.8-dev
14+
- "3.8"
1515
- nightly
1616
# PyPy:
1717
- pypy3
@@ -21,25 +21,19 @@ env:
2121

2222
install:
2323
- if [[ "$TEST_SOCKETCAN" ]]; then sudo bash test/open_vcan.sh ; fi
24-
- travis_retry pip install .[test]
24+
- python setup.py install
2525

2626
script:
2727
- |
28+
# install tox
29+
pip install tox
2830
# Run the tests
29-
python setup.py test
30-
# preserve the error code
31-
RETURN_CODE=$?
32-
# Upload the coverage to codecov.io
33-
codecov -X gcov
34-
# set error code
35-
(exit $RETURN_CODE);
36-
31+
tox -e travis
3732
3833
jobs:
3934
allow_failures:
4035
# we allow all dev & nightly builds to fail, since these python versions might
4136
# still be very unstable
42-
- python: 3.8-dev
4337
- python: nightly
4438

4539
include:
@@ -80,12 +74,43 @@ jobs:
8074
before_install:
8175
- travis_retry pip install -r requirements-lint.txt
8276
script:
77+
# -------------
78+
# pylint checking:
8379
# Slowly enable all pylint warnings by adding addressed classes of
8480
# warnings to the .pylintrc-wip file to prevent them from being
8581
# re-introduced
86-
- pylint --rcfile=.pylintrc-wip can/
87-
# mypy checking
88-
- mypy --python-version=3.7 --ignore-missing-imports --no-implicit-optional can/bit_timing.py can/broadcastmanager.py can/bus.py can/interface.py can/listener.py can/logger.py can/message.py can/notifier.py can/player.py can/thread_safe_bus.py can/util.py
82+
# check the entire main codebase
83+
- pylint --rcfile=.pylintrc-wip can/**.py
84+
- pylint --rcfile=.pylintrc setup.py
85+
- pylint --rcfile=.pylintrc doc.conf
86+
# check the scripts folder
87+
- find scripts -type f -name "*.py" | xargs pylint --rcfile=.pylintrc
88+
# check the examples
89+
- find examples -type f -name "*.py" | xargs pylint --rcfile=.pylintrc-wip
90+
# -------------
91+
# mypy checking:
92+
- mypy
93+
--python-version=3.7
94+
--ignore-missing-imports
95+
--no-implicit-optional
96+
can/bit_timing.py
97+
can/broadcastmanager.py
98+
can/bus.py
99+
can/interface.py
100+
can/interfaces/slcan.py
101+
can/interfaces/socketcan/**.py
102+
can/interfaces/virtual.py
103+
can/listener.py
104+
can/logger.py
105+
can/message.py
106+
can/notifier.py
107+
can/player.py
108+
can/thread_safe_bus.py
109+
can/typechecking.py
110+
can/util.py
111+
can/io/**.py
112+
scripts/**.py
113+
examples/**.py
89114
- stage: linter
90115
name: "Formatting Checks"
91116
python: "3.7"

CHANGELOG.txt

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,61 @@
1+
Version 4.0.0
2+
====
3+
4+
(In development)
5+
6+
7+
Version 3.3.4
8+
====
9+
10+
Last call for Python2 support.
11+
12+
* #850 Fix socket.error is a deprecated alias of OSError used on Python versions lower than 3.3.
13+
14+
Version 3.3.3
15+
====
16+
17+
Backported fixes from 4.x development branch which targets Python 3.
18+
19+
* #798 Backport caching msg.data value in neovi interface.
20+
* #796 Fix Vector CANlib treatment of empty app name.
21+
* #771 Handle empty CSV file.
22+
* #741 ASCII reader can now handle FD frames.
23+
* #740 Exclude test packages from distribution.
24+
* #713 RTR crash fix in canutils log reader parsing RTR frames.
25+
* #701 Skip J1939 messages in ASC Reader.
26+
* #690 Exposes a configuration option to allow the CAN message player to send error frames
27+
(and sets the default to not send error frames).
28+
* #638 Fixes the semantics provided by periodic tasks in SocketCAN interface.
29+
* #628 Avoid padding CAN_FD_MESSAGE_64 objects to 4 bytes.
30+
* #617 Fixes the broken CANalyst-II interface.
31+
* #605 Socketcan BCM status fix.
32+
33+
34+
Version 3.3.2
35+
====
36+
37+
Minor bug fix release addressing issue in PCAN RTR.
38+
39+
Version 3.3.1
40+
====
41+
42+
Minor fix to setup.py to only require pytest-runner when necessary.
43+
44+
Version 3.3.0
45+
====
46+
47+
* Adding CAN FD 64 frame support to blf reader
48+
* Updates to installation instructions
49+
* Clean up bits generator in PCAN interface #588
50+
* Minor fix to use latest tools when building wheels on travis.
51+
52+
Version 3.2.1
53+
====
54+
55+
* CAN FD 64 frame support to blf reader
56+
* Minor fix to use latest tools when building wheels on travis.
57+
* Updates links in documentation.
58+
159
Version 3.2.0
260
====
361

README.rst

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
python-can
22
==========
33

4-
|release| |docs| |build_travis| |build_appveyor| |coverage| |downloads| |formatter|
4+
|release| |downloads| |downloads_monthly| |formatter|
5+
6+
|docs| |build_travis| |build_appveyor| |coverage|
57

68
.. |release| image:: https://img.shields.io/pypi/v/python-can.svg
79
:target: https://pypi.python.org/pypi/python-can/
810
:alt: Latest Version on PyPi
911

12+
.. |downloads| image:: https://pepy.tech/badge/python-can
13+
:target: https://pepy.tech/project/python-can
14+
:alt: Downloads on PePy
15+
16+
.. |downloads_monthly| image:: https://pepy.tech/badge/python-can/month
17+
:target: https://pepy.tech/project/python-can/month
18+
:alt: Monthly downloads on PePy
19+
20+
.. |formatter| image:: https://img.shields.io/badge/code%20style-black-000000.svg
21+
:target: https://github.com/python/black
22+
:alt: This project uses the black formatter.
23+
1024
.. |docs| image:: https://readthedocs.org/projects/python-can/badge/?version=stable
1125
:target: https://python-can.readthedocs.io/en/stable/
1226
:alt: Documentation
@@ -23,13 +37,9 @@ python-can
2337
:target: https://codecov.io/gh/hardbyte/python-can/branch/develop
2438
:alt: Test coverage reports on Codecov.io
2539

26-
.. |downloads| image:: https://pepy.tech/badge/python-can
27-
:target: https://pepy.tech/project/python-can
28-
:alt: Downloads on PePy
29-
30-
.. |formatter| image:: https://img.shields.io/badge/code%20style-black-000000.svg
31-
:target: https://github.com/python/black
32-
:alt: This project uses the black formatter.
40+
.. image:: https://img.shields.io/endpoint.svg?url=https://gh.mergify.io/badges/hardbyte/python-can&style=flat
41+
:target: https://mergify.io
42+
:alt: Mergify Status
3343

3444
The **C**\ ontroller **A**\ rea **N**\ etwork is a bus standard designed
3545
to allow microcontrollers and devices to communicate with each other. It
@@ -44,13 +54,13 @@ messages on a can bus.
4454
The library currently supports Python 3.6+ as well as PyPy 3 and runs
4555
on Mac, Linux and Windows.
4656

47-
============================= ===========
48-
Library Version Python
49-
----------------------------- -----------
50-
2.x 2.6+, 3.4+
51-
3.x 2.7+, 3.5+
52-
4.x *(currently on devlop)* 3.6+
53-
============================= ===========
57+
============================== ===========
58+
Library Version Python
59+
------------------------------ -----------
60+
2.x 2.6+, 3.4+
61+
3.x 2.7+, 3.5+
62+
4.x *(currently on develop)* 3.6+
63+
============================== ===========
5464

5565

5666
Features
@@ -89,7 +99,7 @@ Example usage
8999
90100
# iterate over received messages
91101
for msg in bus:
92-
print("{X}: {}".format(msg.arbitration_id, msg.data))
102+
print("{:X}: {}".format(msg.arbitration_id, msg.data))
93103
94104
# or use an asynchronous notifier
95105
notifier = can.Notifier(bus, [can.Logger("recorded.log"), can.Printer()])

0 commit comments

Comments
 (0)