BrianPugh / belay

Belay is a python library that enables the rapid development of projects that interact with hardware via a micropython-compatible board.
Apache License 2.0
240 stars 13 forks source link

belay select #127

Closed BrianPugh closed 1 year ago

BrianPugh commented 1 year ago

Features

Breaking

TODO prior to merging:

Screenshots

Screenshot 2023-04-16 at 8 34 07 AM

Screenshot 2023-04-16 at 9 06 48 AM

codecov-commenter commented 1 year ago

Codecov Report

Merging #127 (2e5e42f) into main (ee403a1) will decrease coverage by 3.45%. The diff coverage is 28.31%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
- Coverage   73.97%   70.52%   -3.45%     
==========================================
  Files          38       38              
  Lines        1560     1693     +133     
  Branches      338      298      -40     
==========================================
+ Hits         1154     1194      +40     
- Misses        332      425      +93     
  Partials       74       74              
Flag Coverage Δ
unittests 70.46% <28.31%> (-3.45%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
belay/helpers.py 100.00% <ø> (+5.26%) :arrow_up:
belay/cli/questionary_ext.py 22.58% <22.58%> (ø)
belay/cli/select.py 26.04% <24.46%> (+26.04%) :arrow_up:
belay/__init__.py 100.00% <100.00%> (ø)
belay/cli/main.py 74.24% <100.00%> (ø)
belay/usb_specifier.py 86.36% <100.00%> (+1.74%) :arrow_up:

... and 4 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

raveslave commented 1 year ago

reviewed the commits, looks clean and well thought out. will use it a bit with real hardware next week to see if anything obvious comes up.

this is really what I've missed with both pyboard, mpremote or any python-lib interacting with cdc-ddevices for that matter.

BrianPugh commented 1 year ago

sounds good! I'll leave this PR up in the meantime. I'll also try to flesh out the docs a bit more.

BrianPugh commented 1 year ago

@raveslave have you had a chance to play with this?

BrianPugh commented 1 year ago

Another TODO: we need to figure out a way of making the CLI's fun to use with this new addition. Currently all commands are belay command PORT, but PORT can now be substituted out with the environment variable $BELAY_DEVICE. Maybe it's best to just have it remain as the user explicitly specifying belay command $BELAY_DEVICE.

BrianPugh commented 1 year ago

for now, I'm just going to leave it explicitly up to the user to call belay command $BELAY_DEVICE, we can always improve upon this in the future.

raveslave commented 1 year ago

@raveslave have you had a chance to play with this?

took a while but now yes! I think it came out really neat, very easy to use

BrianPugh commented 1 year ago

Thanks! I really wish I could have it set env vars for us, but it seems impossible. If you ever run into something that could help in this area, please let me know!

raveslave commented 1 year ago

same here, will ask around!