From 491a691fd1faffab1c48956bafd711e7c653db54 Mon Sep 17 00:00:00 2001 From: Sai Asish Y Date: Sun, 31 May 2026 03:16:07 -0700 Subject: [PATCH 1/6] fix(pcan): swap SetValue and GetErrorText docstrings (#2058) * fix(pcan): swap SetValue and GetErrorText docstrings The docstrings for SetValue and GetErrorText in pcan/basic.py were swapped: SetValue described returning an error text and GetErrorText described configuring a channel value. Swap them so each docstring matches its function. Fixes #2047 * ci: retrigger flaky test_send_periodic_duration Signed-off-by: Sai Asish Y --------- Signed-off-by: Sai Asish Y --- can/interfaces/pcan/basic.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/can/interfaces/pcan/basic.py b/can/interfaces/pcan/basic.py index 4d175c645..3654699c5 100644 --- a/can/interfaces/pcan/basic.py +++ b/can/interfaces/pcan/basic.py @@ -990,12 +990,10 @@ def GetValue(self, Channel, Parameter): logger.error("Exception on PCANBasic.GetValue") raise - # Returns a descriptive text of a given TPCANStatus - # error code, in any desired language + # Configures or sets a PCAN Channel value # def SetValue(self, Channel, Parameter, Buffer): - """Returns a descriptive text of a given TPCANStatus error - code, in any desired language + """Configures or sets a PCAN Channel value Remarks: Parameters can be present or not according with the kind @@ -1036,7 +1034,8 @@ def SetValue(self, Channel, Parameter, Buffer): raise def GetErrorText(self, Error, Language=0): - """Configures or sets a PCAN Channel value + """Returns a descriptive text of a given TPCANStatus error + code, in any desired language Remarks: From 0d5b7fb82943bee093a3d0078b9cfd94b8a4f7c7 Mon Sep 17 00:00:00 2001 From: Pierre-Luc Date: Sat, 6 Jun 2026 05:15:35 -0400 Subject: [PATCH 2/6] refactor(notifier): change listeners from list to set for uniqueness (#2066) This prevents adding the same listener multiple times Co-authored-by: Pierre-Luc Tessier Gagne --- can/notifier.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/can/notifier.py b/can/notifier.py index cb91cf7b4..fd21a0662 100644 --- a/can/notifier.py +++ b/can/notifier.py @@ -133,7 +133,7 @@ def __init__( :raises ValueError: If a passed in *bus* is already assigned to an active :class:`~can.Notifier`. """ - self.listeners: list[MessageRecipient] = list(listeners) + self.listeners: set[MessageRecipient] = set(listeners) self._bus_list: list[BusABC] = [] self.timeout = timeout self._loop = loop @@ -278,20 +278,18 @@ def _on_error(self, exc: Exception) -> bool: return was_handled def add_listener(self, listener: MessageRecipient) -> None: - """Add new Listener to the notification list. - If it is already present, it will be called two times - each time a message arrives. + """Add new Listener to the notification set. :param listener: Listener to be added to the list to be notified """ - self.listeners.append(listener) + self.listeners.add(listener) def remove_listener(self, listener: MessageRecipient) -> None: - """Remove a listener from the notification list. This method + """Remove a listener from the notification set. This method throws an exception if the given listener is not part of the stored listeners. - :param listener: Listener to be removed from the list to be notified + :param listener: Listener to be removed from the set to be notified :raises ValueError: if `listener` was never added to this notifier """ self.listeners.remove(listener) From 41f575d93aed3a7458c03ec4433ea5b823d248bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 23:28:08 +0000 Subject: [PATCH 3/6] Bump the dev-deps group across 1 directory with 4 updates Updates the requirements on [black](https://github.com/psf/black), [mypy](https://github.com/python/mypy), [pytest-cov](https://github.com/pytest-dev/pytest-cov) and [coverage](https://github.com/coveragepy/coveragepy) to permit the latest version. Updates `black` to 26.5.1 - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/26.1a1...26.5.1) Updates `mypy` to 2.1.0 - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.19.0...v2.1.0) Updates `pytest-cov` to 7.1.0 - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v7.0.0...v7.1.0) Updates `coverage` to 7.14.1 - [Release notes](https://github.com/coveragepy/coveragepy/releases) - [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst) - [Commits](https://github.com/coveragepy/coveragepy/compare/7.13.0...7.14.1) --- updated-dependencies: - dependency-name: black dependency-version: 26.5.1 dependency-type: direct:development dependency-group: dev-deps - dependency-name: mypy dependency-version: 2.1.0 dependency-type: direct:development dependency-group: dev-deps - dependency-name: pytest-cov dependency-version: 7.1.0 dependency-type: direct:development dependency-group: dev-deps - dependency-name: coverage dependency-version: 7.14.1 dependency-type: direct:development dependency-group: dev-deps ... Signed-off-by: dependabot[bot] --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 23bebd12e..9dd55f8df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,16 +92,16 @@ docs = [ lint = [ "pylint==4.0.*", "ruff==0.15.*", - "black==26.1.*", - "mypy==1.19.*", + "black==26.5.*", + "mypy==2.1.*", ] test = [ "pytest==9.0.*", "pytest-timeout==2.4.*", "pytest-modern==0.7.*;platform_system!='Windows'", "coveralls==4.1.*", - "pytest-cov==7.0.*", - "coverage==7.13.*", + "pytest-cov==7.1.*", + "coverage==7.14.*", "hypothesis==6.*", "parameterized==0.9.*", ] From 2d77d4a6ac7b5531bb76c3fd3ae286727039cffe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 23:26:30 +0000 Subject: [PATCH 4/6] Bump the github-actions group across 1 directory with 5 updates Bumps the github-actions group with 5 updates in the / directory: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `6.0.2` | `6.0.3` | | [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | `7.3.1` | `8.1.0` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `7.0.0` | `7.0.1` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `8.0.0` | `8.0.1` | | [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) | `1.13.0` | `1.14.0` | Updates `actions/checkout` from 6.0.2 to 6.0.3 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...df4cb1c069e1874edd31b4311f1884172cec0e10) Updates `astral-sh/setup-uv` from 7.3.1 to 8.1.0 - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/5a095e7a2014a4212f075830d4f7277575a9d098...08807647e7069bb48b6ef5acd8ec9567f424441b) Updates `actions/upload-artifact` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/bbbca2ddaa5d8feaa63e36b76fdaad77386f024f...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a) Updates `actions/download-artifact` from 8.0.0 to 8.0.1 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3...3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c) Updates `pypa/gh-action-pypi-publish` from 1.13.0 to 1.14.0 - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e...cef221092ed1bacb1cc03d23a2d87d1d172e277b) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: astral-sh/setup-uv dependency-version: 8.1.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/upload-artifact dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: actions/download-artifact dependency-version: 8.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: pypa/gh-action-pypi-publish dependency-version: 1.14.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 796e7c65a..26da1e61c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,12 +33,12 @@ jobs: ] fail-fast: false steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # 6.0.3 with: fetch-depth: 0 persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # 7.3.1 + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # 8.1.0 - name: Install tox run: uv tool install tox --with tox-uv - name: Setup SocketCAN @@ -66,7 +66,7 @@ jobs: needs: test runs-on: ubuntu-latest steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # 6.0.3 with: fetch-depth: 0 persist-credentials: false @@ -79,12 +79,12 @@ jobs: static-code-analysis: runs-on: ubuntu-latest steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # 6.0.3 with: fetch-depth: 0 persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # 7.3.1 + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # 8.1.0 - name: Install tox run: uv tool install tox --with tox-uv - name: Run linters @@ -97,12 +97,12 @@ jobs: docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # 6.0.3 with: fetch-depth: 0 persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # 7.3.1 + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # 8.1.0 - name: Install tox run: uv tool install tox --with tox-uv - name: Build documentation @@ -113,18 +113,18 @@ jobs: name: Packaging runs-on: ubuntu-latest steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # 6.0.3 with: fetch-depth: 0 persist-credentials: false - name: Install uv - uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # 7.3.1 + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # 8.1.0 - name: Build wheel and sdist run: uv build - name: Check build artifacts run: uvx twine check --strict dist/* - name: Save artifacts - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # 7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # 7.0.1 with: name: release path: ./dist @@ -140,7 +140,7 @@ jobs: # upload to PyPI only on release if: github.event.release && github.event.action == 'published' steps: - - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # 8.0.0 + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1 with: path: dist merge-multiple: true @@ -151,4 +151,4 @@ jobs: subject-path: 'dist/*' - name: Publish release distributions to PyPI - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # 1.13.0 + uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # 1.14.0 From 6b1f0533e727748b93db6645e9cb752a599d3799 Mon Sep 17 00:00:00 2001 From: zariiii9003 <52598363+zariiii9003@users.noreply.github.com> Date: Sat, 6 Jun 2026 12:39:54 +0200 Subject: [PATCH 5/6] update gh workflow files (#2067) --- .github/dependabot.yml | 10 ++++++++-- .github/workflows/ci.yml | 8 ++++++++ .mergify.yml | 25 ------------------------- 3 files changed, 16 insertions(+), 27 deletions(-) delete mode 100644 .mergify.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index dbe907783..70463c491 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,7 +9,10 @@ updates: # Enable version updates for development dependencies directory: "/" schedule: - interval: "monthly" + interval: "cron" + cronjob: "0 0 1 */3 *" # Run once every 3 months + cooldown: + default-days: 7 versioning-strategy: "increase-if-necessary" groups: dev-deps: @@ -20,7 +23,10 @@ updates: # Enable version updates for GitHub Actions directory: "/" schedule: - interval: "monthly" + interval: "cron" + cronjob: "0 0 1 */3 *" # Run once every 3 months + cooldown: + default-days: 7 groups: github-actions: patterns: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26da1e61c..e9655039f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,8 @@ jobs: persist-credentials: false - name: Install uv uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # 8.1.0 + with: + enable-cache: false - name: Install tox run: uv tool install tox --with tox-uv - name: Setup SocketCAN @@ -85,6 +87,8 @@ jobs: persist-credentials: false - name: Install uv uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # 8.1.0 + with: + enable-cache: false - name: Install tox run: uv tool install tox --with tox-uv - name: Run linters @@ -103,6 +107,8 @@ jobs: persist-credentials: false - name: Install uv uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # 8.1.0 + with: + enable-cache: false - name: Install tox run: uv tool install tox --with tox-uv - name: Build documentation @@ -119,6 +125,8 @@ jobs: persist-credentials: false - name: Install uv uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # 8.1.0 + with: + enable-cache: false - name: Build wheel and sdist run: uv build - name: Check build artifacts diff --git a/.mergify.yml b/.mergify.yml deleted file mode 100644 index 52b243cd3..000000000 --- a/.mergify.yml +++ /dev/null @@ -1,25 +0,0 @@ -queue_rules: - - name: default - conditions: - - "status-success=test" # "GitHub Actions works slightly differently [...], only the job name is used." - - "status-success=format" - -pull_request_rules: - - name: Automatic merge passing PR on up to date branch with approving CR - conditions: - - "base=develop" - - "#approved-reviews-by>=1" - - "#review-requested=0" - - "#changes-requested-reviews-by=0" - - "status-success=test" - - "status-success=format" - - "label!=work-in-progress" - actions: - queue: - name: default - - - name: Delete head branch after merge - conditions: - - merged - actions: - delete_head_branch: {} From b4f82abede25ff83376be793a2935c41f81c3869 Mon Sep 17 00:00:00 2001 From: dreamer0129 Date: Sat, 6 Jun 2026 18:53:52 +0800 Subject: [PATCH 6/6] fix: only call _validate() when strict=True (#2062) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: only call _validate() when strict=True _validate() was called unconditionally, rejecting brp values > 64 even when strict=False. This is too restrictive for some peripherals like FYSETC UCAN which support brp up to 1024. Only call _validate() when strict=True, matching the behavior of _restrict_to_minimum_range(). Fixes #2061 * add news fragment --------- Co-authored-by: 小慧 Co-authored-by: zariiii9003 <52598363+zariiii9003@users.noreply.github.com> --- can/bit_timing.py | 2 +- doc/changelog.d/2061.fixed.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 doc/changelog.d/2061.fixed.rst diff --git a/can/bit_timing.py b/can/bit_timing.py index 2bb04bfbe..4311ff9a4 100644 --- a/can/bit_timing.py +++ b/can/bit_timing.py @@ -74,8 +74,8 @@ def __init__( "sjw": sjw, "nof_samples": nof_samples, } - self._validate() if strict: + self._validate() self._restrict_to_minimum_range() def _validate(self) -> None: diff --git a/doc/changelog.d/2061.fixed.rst b/doc/changelog.d/2061.fixed.rst new file mode 100644 index 000000000..48afb4c86 --- /dev/null +++ b/doc/changelog.d/2061.fixed.rst @@ -0,0 +1 @@ +Fix ``can.BitTiming`` rejecting bit rate prescaler values greater than 64 even when ``strict=False``. \ No newline at end of file