greatscottgadgets / apollo

microcontroller-based FPGA / JTAG programmer
BSD 3-Clause "New" or "Revised" License
61 stars 29 forks source link

apollo_fpga: get rid of `poetry` and add `prompt-toolkit` dependency #36

Closed mndza closed 5 months ago

mndza commented 6 months ago

Fixes #35.

mndza commented 6 months ago

Thank you for catching this! Previously I only tested installing this in editable mode and the bug did not appear.

I am able to reproduce this now, ~but the packages solution did not solve it for me. Using apollo_fpga* did, though.~

Edit: forget about what I said, it works. Force-pushing now.

mossmann commented 5 months ago

I tried testing this with a user pip install, replacing a previous installation. The initial uninstall worked:

mossmann@costard:~/src/apollo$ pip3 uninstall apollo_fpga  --break-system-packages
Found existing installation: apollo-fpga 0.0.5
Uninstalling apollo-fpga-0.0.5:
  Would remove:
    /home/mossmann/.local/bin/apollo
    /home/mossmann/.local/lib/python3.11/site-packages/apollo_fpga-0.0.5.dist-info/*
    /home/mossmann/.local/lib/python3.11/site-packages/apollo_fpga/*
Proceed (Y/n)? y
  Successfully uninstalled apollo-fpga-0.0.5

Then the install worked:

mossmann@costard:~/src/apollo$ pip3 install .  --break-system-packages
Defaulting to user installation because normal site-packages is not writeable
Processing /home/mossmann/src/apollo
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: pyusb>1.1.1 in /usr/lib/python3/dist-packages (from apollo-fpga==0.0.5) (1.2.1.post1)
Requirement already satisfied: pyvcd>=0.2.4 in /home/mossmann/.local/lib/python3.11/site-packages (from apollo-fpga==0.0.5) (0.2.4)
Requirement already satisfied: prompt-toolkit>3.0.16 in /usr/lib/python3/dist-packages (from apollo-fpga==0.0.5) (3.0.36)
Building wheels for collected packages: apollo-fpga
  Building wheel for apollo-fpga (pyproject.toml) ... done
  Created wheel for apollo-fpga: filename=apollo_fpga-0.0.5-py3-none-any.whl size=33337 sha256=3bdea1a94735c5f6d2551e562a2e15f679e1f76911113b66c492ec3cb5acdcc9
  Stored in directory: /tmp/pip-ephem-wheel-cache-61jsvh74/wheels/e8/8c/ac/f7cce1ec4ddb45ffe2cc29d17b39d287331da0a67f85a743c7
Successfully built apollo-fpga
Installing collected packages: apollo-fpga
Successfully installed apollo-fpga-0.0.5

But a subsequent uninstall did not:

mossmann@costard:~/src/apollo$ pip3 uninstall apollo_fpga  --break-system-packages
Found existing installation: apollo-fpga 0.0.5
Can't uninstall 'apollo-fpga'. No files were found to uninstall.

I got the same result using a hyphen instead of an underscore:

mossmann@costard:~/src/apollo$ pip3 uninstall apollo-fpga  --break-system-packages
Found existing installation: apollo-fpga 0.0.5
Can't uninstall 'apollo-fpga'. No files were found to uninstall
mossmann commented 5 months ago

My uninstall failure only happens if my working directory is the top level of the repo. We're guessing that this has to do with the way pip resolves package names and is not a bug in apollo. Removing pyproject.toml did not change my result.