Skip to content

Modernize examples for Python 3.13/3.14, fix transport leaks#56

Closed
ulvs wants to merge 6 commits into
masterfrom
fix_3_14
Closed

Modernize examples for Python 3.13/3.14, fix transport leaks#56
ulvs wants to merge 6 commits into
masterfrom
fix_3_14

Conversation

@ulvs

@ulvs ulvs commented Jun 10, 2026

Copy link
Copy Markdown
Member
  • Examples switched from asyncio.get_event_loop() / run_forever() / run_until_complete() to asyncio.run(); removed deprecated pkg_resources (carried forward from Geoff's work on this branch).
  • Removed the dead PYTHON3 import gate in qtm_rt/__init__.py.
  • QRTConnection is now an async context manager and disconnect() is idempotent; Discover closes its UDP datagram transport on iteration end. Eliminates asyncio ResourceWarnings under 3.14.
  • Demo.qtm moved out of the package (qtm_rt/data/Demo.qtmexamples/Demo.qtm); the release workflow attaches it to the GitHub Release as a downloadable asset, README points pip users there.
  • CLAUDE.md added and updated to reflect current state (Python 3.10+, pyproject.toml, FIFO request_queue after Fix RT connection drop when responses race with caller timeouts #48).

Verified end-to-end against QTM 2026.3 Beta on Python 3.14. All seven examples shut down without ResourceWarning. basic_example, stream_6dof_example, advanced_example, control_example work fully; the remaining three fail at QTM-environmental preconditions (camera image-output mode, live capture for calibration, trigger configuration), not SDK issues.

Authored-by-Geoff commits preserved in history.

Geoff Bache and others added 6 commits June 10, 2026 20:54
The file is no longer shipped in the wheel/sdist. Examples reference it
via a path next to the script, and the release workflow attaches it to
the GitHub Release as a downloadable asset.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closes the asyncio transport-leak ResourceWarnings that surface under
Python 3.14 (the GC-based cleanup path no longer fires before the
warning). QRTConnection now supports `async with` so the transport is
closed deterministically on scope exit; disconnect() is idempotent.

Discover does the same for its UDP datagram transport.

All seven examples updated to use the new context-manager form. Verified
end-to-end against QTM 2026.3 Beta on Python 3.14:
- basic, stream_6dof, advanced, control: full pass, no ResourceWarning.
- image, calibration, asyncio_everything: fail at QTM-environmental
  preconditions (camera image mode, live capture for calibration,
  trigger configuration) but shut down cleanly, no ResourceWarning.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Python floor 3.7 -> 3.10 (per #50)
- Release flow now goes through GitHub Actions / Trusted Publishing,
  pyproject.toml owns the version, setup.py is gone
- request_queue is FIFO (popleft) after #48
- Mention QRTConnection's new async-context-manager surface

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ulvs

ulvs commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

Closing in favor of a much smaller PR with only the unique pieces (QRTConnection async context manager + Discover UDP transport cleanup + CLAUDE.md) rebased on the new master. #58 already covered example modernization, PYTHON3 removal, release-asset upload, and CI matrix, and review here would be noisy.

@ulvs ulvs closed this Jun 10, 2026
@ulvs ulvs deleted the fix_3_14 branch June 10, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant