circup.exe option

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
blakebr
 
Posts: 942
Joined: Tue Apr 17, 2012 6:23 pm

circup.exe option

Post by blakebr »

Hi,

Is there an option in circup.exe to define the name of the CIRCUITPY drive to be scanned/updated? Can it be added?

I have multiple CircuitPython devices connected to my Windows 10 PC. To keep me straight I have renamed those drives using the drive Rename option under This PC. As it is now I must rename the drive back to CIRCUITPY >> run circup.exe update >> rename the drive back to the preferred name. This is a PITA.

circup update --all --drive=MYCPDRIVE

Bruce

User avatar
neradoc
 
Posts: 542
Joined: Wed Apr 27, 2016 2:38 pm

Re: circup.exe option

Post by neradoc »

Hi, there is the --path option to give the path or on windows I guess the letter.
You can open an issue in the circup repo with your suggestion.
https://github.com/adafruit/circup

Code: Select all

PS D:\> circup --help
Usage: circup [OPTIONS] COMMAND [ARGS]...

  A tool to manage and update libraries on a CircuitPython device.

Options:
  --verbose         Comprehensive logging is sent to stdout.
  --path DIRECTORY  Path to CircuitPython directory. Overrides automatic path
                    detection.
  --version         Show the version and exit.
  --help            Show this message and exit.

Commands:
  bundle-add     Add bundles to the local bundles list, by "user/repo"...
  bundle-remove  Remove one or more bundles from the local bundles list.
  bundle-show    Show the list of bundles, default and local, with URL,...
  freeze         Output details of all the modules found on the connected...
  install        Install a named module(s) onto the device.
  list           Lists all out of date modules found on the connected...
  show           Show a list of available modules in the bundle.
  uninstall      Uninstall a named module(s) from the connected device.
  update         Update modules on the device. Use --all to automatically
                 update all modules without Major Version warnings.
I wrote discotool as a generic tool to find boards by name and drive name. It does more complex things than circup needs, but it will automatically find any Circuitpython board and run circup commands by passing the drive path. It can filter by drive name, board name, serial number...
It can be installed with pip.
https://github.com/Neradoc/discotool

It can do that:
  • discotool update --all
    Call "circup update --all" on all detected boards, updating all libraries.
  • discotool install --auto
    Call "circup install --auto" to install code.py requirements on all detected board.
  • discotool -m MYCPDRIVE update
    Call "circup update" only on the board with that drive name (or any board with a drive name containing that word to be exact).
And much more.
You can check the name, drives and serial number by simply calling discotool.

Code: Select all

PS D:\> discotool
- CLUE nRF52840 Express
        Adafruit Industries LLC [SN:880E9C9E016C]
        COM3 (REPL)
- Trinket M0
        Adafruit Industries LLC [SN:E0ED4F3324B02032E3841418F]
        COM4 (REPL)
        COM11 (DATA)
        G:\ "TRINFOOT"

User avatar
blakebr
 
Posts: 942
Joined: Tue Apr 17, 2012 6:23 pm

Re: circup.exe option

Post by blakebr »

Neradoc,

Thanks for your suggestions, but not wanting to setup a full up Linux machine
I applied parts of what you said to my Windows 10 machine. All my playing came down to:

Code: Select all

circup --path H: upgrade --all
This code did all I need done to a select (H:) CircuitPython machine. My libraries were WAY out of date, so it took a while to update 283 libraries.

Thanks again for pointing me in the right direction.

Bruce

User avatar
neradoc
 
Posts: 542
Joined: Wed Apr 27, 2016 2:38 pm

Re: circup.exe option

Post by neradoc »

I'm glad you got it solved !
Note that nothing I mentioned requires a linux machine, it all works on Windows 10.

User avatar
blakebr
 
Posts: 942
Joined: Tue Apr 17, 2012 6:23 pm

Re: circup.exe option

Post by blakebr »

Neradoc,

The installer for circup.exe sticks the executable down deep in the directory tree.

Code: Select all

C:\Users\Bruce\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts
To save me the suffering of tracing that path down the rabbit hole and typing each CircuitPython device's drive designation (H:) I created this Windows batch file. When saved in a convenient location where the end user can easily find it, it will go to the circup directory and update the AdaFruit devices on drives G: through P:.

Code: Select all

echo "CircuitPython circuip.bat file"
cd C:\Users\Bruce\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts
dir
pause
circup --path G: update --all
circup --path H: update --all
circup --path I: update --all
circup --path J: update --all
circup --path K: update --all
circup --path L: update --all
circup --path M: update --all
circup --path N: update --all
circup --path O: update --all
circup --path P: update --all
dir
pause

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”