greatscottgadgets / cynthion

USB test instrument
https://greatscottgadgets.com/cynthion/
BSD 3-Clause "New" or "Revised" License
42 stars 11 forks source link

wheel: assets should install to `site-packages/cynthion/assets`, not `site-packages/assets` #126

Closed claui closed 1 week ago

claui commented 1 week ago

Summary

While trying to create system packages on Linux for Cynthion and for the gateware binaries and bitstreams, I noticed that the cynthion wheels on PyPI currently ship a directory that installs to site-packages/assets (i.e., an immediate subdirectory of site-packages).

I believe this may be a mistake, and that the actual intention was to ship a directory that installs tosite-packages/cynthion/assets, not site-packages/assets.

Expected behavior

Actual behavior

Steps to reproduce

  1. Create and activate a fresh Python virtual environment. For example on a Linux shell:

    cd "$(mktemp -d)"
    python -m venv .venv
    . .venv/bin/activate
  2. Install Cynthion v0.1.1 from PyPI:

    pip install cynthion==0.1.1
  3. Confirm that the assets directory is a direct subdirectory of site-packages:

    $ ls .venv/lib/python3.*/site-packages/
    […] assets […] cynthion […]
    $ ls .venv/lib/python3.*/site-packages/assets/
    54-cynthion.rules       CynthionPlatformRev0D2  CynthionPlatformRev0D5  CynthionPlatformRev1D0  CynthionPlatformRev1D3
    apollo.bin              CynthionPlatformRev0D3  CynthionPlatformRev0D6  CynthionPlatformRev1D1  CynthionPlatformRev1D4
    CynthionPlatformRev0D1  CynthionPlatformRev0D4  CynthionPlatformRev0D7  CynthionPlatformRev1D2  moondancer.bin
  4. Confirm that the cynthion_assets_directory() function returns a non-existent directory:

    $ python -c "import cynthion; print(cynthion.cynthion_assets_directory())"
    /tmp/yourtempdir/.venv/lib/python3.12/site-packages/cynthion/assets
  5. Confirm that calls to the find_cynthion_asset function return nothing:

    $ python -c "import cynthion; print(cynthion.find_cynthion_asset('apollo.bin'))"
    None
    $ python -c "import cynthion; print(cynthion.find_cynthion_asset('moondancer.bin'))"
    None

Note

I haven’t been able to check whether the cynthion CLI command works as intended, because my Cynthion is yet to arrive.
Several people on Discord have reported their setup is working. So what am I missing?