adafruit / circuitpython-build-tools

Build scripts for CircuitPython libraries and the bundle
MIT License
28 stars 18 forks source link

Fix listing dependencies in json #93

Closed Neradoc closed 2 years ago

Neradoc commented 2 years ago

By converting dependencies to _, the 1.10.2 release scrambled the requirements in the json file, moving all "dependencies" to "external dependencies" with an underscored pypi name instead of the library name (adafruit_circuitpython_hid instead of adafruit_hid).

This PR uses - not _ to reference modules from dependencies, so it matches the index used in package_list and the pypi_name field. Use the same function in both parts to emphasize their relatedness. The original name before transformation is still used in external_dependencies.

Note: this does not keep the same format as pipkin as intended by #90. pipkin can map the format function on the list to make sure every reference uses the same format without having to edit the list manually.

Additionally:

With this PR the generated json matches the one generated by 1.10.1 except newly skipped libraries are skipped (pyasn1, pillow, spidev), and bad dependencies are fixed (typing-extensions~).

tekktrik commented 2 years ago

I can try to take a look at this tonight or tomorrow, but adding others in case they can get to it first!

Neradoc commented 2 years ago

I believe this bug has killed the project bundler's ability to include dependencies, since it's not looking in the right list. For example: https://learn.adafruit.com/smart-mirror-with-pyportal/coding-the-smart-mirror

lib
  adafruit_bitmap_font
  adafruit_display_text
  adafruit_pyportal

versus (installing adafruit_pyportal with circup)

lib
  adafruit_bitmap_font
  adafruit_bus_device
  adafruit_display_text
  adafruit_esp32spi
  adafruit_fakerequests.mpy
  adafruit_io
  adafruit_minimqtt
  adafruit_miniqr.mpy
  adafruit_pixelbuf.mpy
  adafruit_portalbase
  adafruit_pyportal
  adafruit_requests.mpy
  adafruit_touchscreen.mpy
  neopixel.mpy
  simpleio.mpy