Merged
Conversation
The src layout means `coverage run` cannot find the package at the top-level `pycyphal` path. Use `source_pkgs` so coverage locates the installed package wherever pip placed it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e same Python environment
Triggers on pushes to master that change __init__.py. Skips tagging if the version tag already exists, skips PyPI upload if already published. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New pycyphal2.can.pythoncan module wraps any python-can BusABC as a v2 Interface. A daemon RX thread bridges the blocking bus.recv() into an asyncio queue; TX goes through a PriorityQueue with deadline enforcement and executor-based bus.send(). Malformed wire input (overlength, non- extended, error/remote frames) is silently dropped per project policy. FD capability is resolved at construction from bus.protocol, with an explicit fd= override. The pythoncan optional dependency (python-can~=4.0) is added to pyproject.toml and installed in nox test/mypy sessions. The State enum and abstract state property are removed from the Interface ABC and all implementations (YAGNI -- no backend implemented it). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The last Windows CI failure was a flaky Python-CAN transport test:
paired virtual-bus transports could randomly pick the same local CAN
node-ID, trigger collision handling, and intermittently drop the
expected delivery. This change removes that nondeterminism from the
affected transport-level tests.
- **Root cause**
- Paired `CANTransport` instances created on the same virtual bus were
relying on randomized local node-ID assignment.
- When both transports selected the same node-ID, collision handling
could reroll IDs during the test and race with message delivery.
- **Change**
- Added a small test helper in `tests/can/test_pythoncan.py` to force
distinct local node-IDs for paired transports.
- Applied it to the paired Python-CAN transport tests that exchange
traffic over a shared virtual channel:
- pub/sub
- unicast
- multi-message delivery
- multi-subject delivery
- large multi-frame pub/sub
- bidirectional unicast
- **Effect**
- The tests continue to exercise the same transport behavior, but no
longer depend on randomized node-ID selection.
- This keeps the Windows path deterministic without changing transport
implementation behavior.
```python
def _force_distinct_ids(a: CANTransport, b: CANTransport) -> None:
if a.id != b.id:
return
b._local_node_id = (a.id % 127) + 1 # type: ignore[attr-defined]
b._refresh_filters() # type: ignore[attr-defined]
```
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pavel-kirienko <3298404+pavel-kirienko@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the new implementation that was first announced in #351 almost a year ago.
While Cyphal/CAN is wire-compatible between the two versions, the API is completely different, and so is the design philosophy. PyCyphal v2 does not attempt to be a one-stop shop for Cyphal, rather it focuses on connectivity only, intentionally omitting application-level concerns. As a result, the new API is a tiny fraction of the old.
The new version is not yet ready for use but it will be soon staged on the main branch nevertheless, while we will continue to maintain v1 on a dedicated branch.
Merge checklist
CYPHAL_REMAPby default.__version__tag is pushed on the master branch.