Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
zariiii9003 authored Oct 26, 2023
2 parents 38439f1 + 38c4dc4 commit c29257b
Show file tree
Hide file tree
Showing 99 changed files with 2,264 additions and 1,096 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
experimental: [false]
python-version: [
"3.7",
"3.8",
"3.9",
"3.10",
"3.11",
"pypy-3.7",
"3.12",
"pypy-3.8",
"pypy-3.9",
]
include:
# Only test on a single configuration while there are just pre-releases
- os: ubuntu-latest
experimental: true
python-version: "3.12.0-alpha - 3.12.0"
# uncomment when python 3.13.0 alpha is available
#include:
# # Only test on a single configuration while there are just pre-releases
# - os: ubuntu-latest
# experimental: true
# python-version: "3.13.0-alpha - 3.13.0"
fail-fast: false
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -84,10 +84,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-lint.txt
- name: mypy 3.7
run: |
mypy --python-version 3.7 .
pip install -e .[lint]
- name: mypy 3.8
run: |
mypy --python-version 3.8 .
Expand All @@ -100,6 +97,9 @@ jobs:
- name: mypy 3.11
run: |
mypy --python-version 3.11 .
- name: mypy 3.12
run: |
mypy --python-version 3.12 .
- name: ruff
run: |
ruff check can
Expand All @@ -108,9 +108,7 @@ jobs:
pylint --rcfile=.pylintrc \
can/**.py \
can/io \
setup.py \
doc/conf.py \
scripts/**.py \
examples/**.py \
can/interfaces/socketcan
Expand All @@ -125,7 +123,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-lint.txt
pip install -e .[lint]
- name: Code Format Check with Black
run: |
black --check --verbose .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-lint.txt
pip install -e .[lint]
- name: Code Format Check with Black
run: |
black --verbose .
Expand Down
77 changes: 77 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,80 @@
Version 4.3.0rc0
===========

Breaking Changes
----------------
* Raise Minimum Python Version to 3.8 (#1597)
* Do not stop notifier if exception was handled (#1645)

Bug Fixes
---------
* Vector: channel detection fails, if there is an active flexray channel (#1634)
* ixxat: Fix exception in 'state' property on bus coupling errors (#1647)
* NeoVi: Fixed serial number range (#1650)
* PCAN: Fix timestamp offset due to timezone (#1651)
* Catch `pywintypes.error` in broadcast manager (#1659)
* Fix BLFReader error for incomplete or truncated stream (#1662)
* PCAN: remove Windows registry check to fix 32bit compatibility (#1672)
* Vector: Skip the `can_op_mode check` if the device reports `can_op_mode=0` (#1678)
* Vector: using the config from `detect_available_configs` might raise XL_ERR_INVALID_CHANNEL_MASK error (#1681)

Features
--------

### API
* Add `modifier_callback` parameter to `BusABC.send_periodic` for auto-modifying cyclic tasks (#703)
* Add `protocol` property to BusABC to determine active CAN Protocol (#1532)
* Change Bus constructor implementation and typing (#1557)
* Add optional `strict` parameter to relax BitTiming & BitTimingFd Validation (#1618)
* Add `BitTiming.iterate_from_sample_point` static methods (#1671)

### IO
* Can Player compatibility with interfaces that use additional configuration (#1610)

### Interface Improvements
* Kvaser: Add BitTiming/BitTimingFd support to KvaserBus (#1510)
* Ixxat: Implement `detect_available_configs` for the Ixxat bus. (#1607)
* NeoVi: Enable send and receive on network ID above 255 (#1627)
* Vector: Send HighPriority Message to flush Tx buffer (#1636)
* PCAN: Optimize send performance (#1640)
* PCAN: Support version string of older PCAN basic API (#1644)
* Kvaser: add parameter exclusive and `override_exclusive` (#1660)

### Miscellaneous
* Distinguish Text/Binary-IO for Reader/Writer classes. (#1585)
* Convert setup.py to pyproject.toml (#1592)
* activate ruff pycodestyle checks (#1602)
* Update linter instructions in development.rst (#1603)
* remove unnecessary script files (#1604)
* BigEndian test fixes (#1625)
* align `ID:` in can.Message string (#1635)
* Use same configuration file as Linux on macOS (#1657)
* We do not need to account for drift when we `USE_WINDOWS_EVENTS` (#1666, #1679)
* Update linters, activate more ruff rules (#1669)
* Add Python 3.12 Support / Test Python 3.12 (#1673)


Version 4.2.2
=============

Bug Fixes
---------
* Fix socketcan KeyError (#1598, #1599).
* Fix IXXAT not properly shutdown message (#1606).
* Fix Mf4Reader and TRCReader incompatibility with extra CLI args (#1610).
* Fix decoding error in Kvaser constructor for non-ASCII product name (#1613).


Version 4.2.1
=============

Bug Fixes
---------
* The ASCWriter now logs the correct channel for error frames (#1578, #1583).
* Fix PCAN library detection (#1579, #1580).
* On Windows, the first two periodic frames were sent without delay (#1590).


Version 4.2.0
=============

Expand Down
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ python-can
:target: https://pypi.python.org/pypi/python-can/
:alt: Supported Python implementations

.. |downloads| image:: https://pepy.tech/badge/python-can
.. |downloads| image:: https://static.pepy.tech/badge/python-can
:target: https://pepy.tech/project/python-can
:alt: Downloads on PePy

.. |downloads_monthly| image:: https://pepy.tech/badge/python-can/month
.. |downloads_monthly| image:: https://static.pepy.tech/badge/python-can/month
:target: https://pepy.tech/project/python-can
:alt: Monthly downloads on PePy

Expand Down Expand Up @@ -62,7 +62,8 @@ Library Version Python
------------------------------ -----------
2.x 2.6+, 3.4+
3.x 2.7+, 3.5+
4.x 3.7+
4.0+ 3.7+
4.3+ 3.8+
============================== ===========


Expand Down
14 changes: 8 additions & 6 deletions can/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import logging
from typing import Any, Dict

__version__ = "4.2.0"
__version__ = "4.3.0rc0"
__all__ = [
"ASCReader",
"ASCWriter",
Expand All @@ -25,6 +25,7 @@
"CanInitializationError",
"CanInterfaceNotImplementedError",
"CanOperationError",
"CanProtocol",
"CanTimeoutError",
"CanutilsLogReader",
"CanutilsLogWriter",
Expand Down Expand Up @@ -60,6 +61,7 @@
"exceptions",
"interface",
"interfaces",
"io",
"listener",
"logconvert",
"log",
Expand All @@ -74,10 +76,6 @@
"viewer",
]

log = logging.getLogger("can")

rc: Dict[str, Any] = {}

from . import typechecking # isort:skip
from . import util # isort:skip
from . import broadcastmanager, interface
Expand All @@ -88,7 +86,7 @@
ModifiableCyclicTaskABC,
RestartableCyclicTaskABC,
)
from .bus import BusABC, BusState
from .bus import BusABC, BusState, CanProtocol
from .exceptions import (
CanError,
CanInitializationError,
Expand Down Expand Up @@ -125,3 +123,7 @@
from .notifier import Notifier
from .thread_safe_bus import ThreadSafeBus
from .util import set_logging_level

log = logging.getLogger("can")

rc: Dict[str, Any] = {}
34 changes: 34 additions & 0 deletions can/_entry_points.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import importlib
import sys
from dataclasses import dataclass
from importlib.metadata import entry_points
from typing import Any, List


@dataclass
class _EntryPoint:
key: str
module_name: str
class_name: str

def load(self) -> Any:
module = importlib.import_module(self.module_name)
return getattr(module, self.class_name)


# See https://docs.python.org/3/library/importlib.metadata.html#entry-points,
# "Compatibility Note".
if sys.version_info >= (3, 10):

def read_entry_points(group: str) -> List[_EntryPoint]:
return [
_EntryPoint(ep.name, ep.module, ep.attr) for ep in entry_points(group=group)
]

else:

def read_entry_points(group: str) -> List[_EntryPoint]:
return [
_EntryPoint(ep.name, *ep.value.split(":", maxsplit=1))
for ep in entry_points().get(group, [])
]
Loading

0 comments on commit c29257b

Please sign in to comment.