• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pybricks / pybricksdev / 9734482634
54%

Build:
DEFAULT BRANCH: master
Ran 30 Jun 2024 07:40PM UTC
Jobs 1
Files 25
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

30 Jun 2024 07:39PM UTC coverage: 50.427% (-0.2%) from 50.589%
9734482634

push

github

dlech
pybricksdev.cli: initialize thread to MTA on Windows

This fixes crashes like the following due to changes in Bleak that
detects issues on Windows where callbacks won't be called because
the pythoncom package sets the threading model to STA and there is
no Windows message loop running.

By initializing the thread to MTA before pythoncom is (lazy) imported,
we avoid this issue.

Issue: https://github.com/hbldh/bleak/discussions/1607#discussioncomment-9918382

```
Traceback (most recent call last):
  File "C:\Users\david\work\pybricksdev\.venv\Scripts\\pybricksdev", line 6, in <module>
    sys.exit(main())
             ^^^^^^
  File "C:\Users\david\work\pybricksdev\pybricksdev\cli\__init__.py", line 387, in main
    asyncio.run(subparsers.choices[args.tool].tool.run(args))
  File "C:\Users\david\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\david\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\david\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 650, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\david\work\pybricksdev\pybricksdev\cli\lwp3\repl.py", line 134, in repl
    device = await BleakScanner.find_device_by_filter(match_lwp3_uuid)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\david\work\pybricksdev\.venv\Lib\site-packages\bleak\__init__.py", line 444, in find_device_by_filter
    async with cls(**kwargs) as scanner:
  File "C:\Users\david\work\pybricksdev\.venv\Lib\site-packages\bleak\__init__.py", line 158, in __aenter__
    await self._backend.start()
  File "C:\Users\david\work\pybricksdev\.venv\Lib\site-packages\bleak\backends\winrt\scanner.py", line 225, in start
    await assert_... (continued)

78 of 294 branches covered (26.53%)

Branch coverage included in aggregate %.

1633 of 3099 relevant lines covered (52.69%)

0.53 hits per line

Jobs
ID Job ID Ran Files Coverage
1 9734482634.1 30 Jun 2024 07:40PM UTC 0
50.43
GitHub Action Run
Source Files on build 9734482634
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #9734482634
  • 978c346e on github
  • Prev Build on master (#9557686470)
  • Next Build on master (#9734485418)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc