OK, my workarounds (multiple problems):
I checked the code, and found it did not actually use _download_http_url. Or, at least not in any of the files I checked!
So I removed _download_http_url from the imports from the following files:
- build.py
- install.py
- uninstall.py
- shell.py
- flash.py
and now ‘aip help’ works for me. That’s probably the right fix, as far as it goes, but it’s not enough.
- I had to manually create the directory ~/.config/api/modules
Then:
ERROR: unpack_url() got an unexpected keyword argument 'downloader'
ERROR: Exception:
Traceback (most recent call last):
File "/Users/rwk/opt/anaconda3/envs/arduino/lib/python3.7/site-packages/aip/build.py", line 325, in downloadAll
download_dir=None,
TypeError: unpack_url() got an unexpected keyword argument 'downloader'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/rwk/opt/anaconda3/envs/arduino/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 189, in _main
status = self.run(options, args)
File "/Users/rwk/opt/anaconda3/envs/arduino/lib/python3.7/site-packages/aip/build.py", line 382, in run
self.downloadAll(seesion)
File "/Users/rwk/opt/anaconda3/envs/arduino/lib/python3.7/site-packages/aip/build.py", line 329, in downloadAll
os.remove(ardupycoredir)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/rwk/.config/aip/ardupycore/Seeeduino/hardware/samd/1.3.0/core'
For this, I compared the build.py code with the prepare.py code, and found they disagree about the ‘downloader’ argument.
build.py calls it as a keyword argument, e.g. ‘downloader=downloader’.
prepare.py expects it as a positional argument.
Replacing ‘downloader=downloader’ in two places in build.py seems to resolve that.
The next problem I had is that ‘aip board’ failed. It really does not like my XIAO-based Altoid MIDI Box, which indeed is not an Ardupy device—but it should not refuse to list my WIO. My workaround here (for now) is to unplug my Altoid MIDI Box, but WTF? I am going to have to come up with a fix for that, too. MIDI devices disappearing confuse Logic Pro X.
Finally, ‘aip install’ failed, also due to the mismatch of arguments to unpack_url. The fix was again, in two places, to replace ‘downloader=downloader’ with just ‘downloader’.
This finally got me to where I seem to have a working install. All the commands appear to work.
This is all the sort of stuff that shouldn’t make it into the wild—but I’m not sure what to suggest! Perhaps the hardware access could be mocked, and CI tests run against that? You really don’t want to rely on humans testing this stuff. I’d be happy to work with y’all to improve the build/release process, but of course, I don’t know your starting point or what issues you face.