Open jbrubake opened 1 year ago
I am new to peru and a long time user of pipx. peru looks really promising and pipx is brilliant. It would be super to get them working together.
I believe this issue relates to the plugin architecture for peru. IIUC peru plugins are executable files; for this issue curl_plugin.py
is the relevant plugin.
If I install peru with pipx; then pipx sets up a virtual environment and installs peru there. pipx adds a symbolic link to the peru command from that virtual envinronment to the PATH. Continuing the example above, the shebang line is:
#!/home/maxwell-k/.local/pipx/venvs/peru/bin/python
However the shebang line for curl_plugin.py
is:
#! /usr/bin/env python3
This means that curl_plugin.py
is executed by a Python interpreter that does not have the peru package installed. That explains the error message!
@oconnor663 is support for pipx something you would consider?
Thank you for your work on peru!
If anyone has suggestions for an implementation perhaps I can start on a PR. I'm not very familiar with the peru code; one option might be to switch to an entry point for curl_plugin.py
so that pipx will update the shebang line or to special case .py
files.
Turns out there was a much easier fix than I expected; I've opened a pull request.
To test the proposed fix using the steps to reproduce above; in place of using pipx install peru
to install peru, try:
pipx install git+https://github.com/maxwell-k/peru
Or if you prefer to run sync directly:
pipx run --spec=git+https://github.com/maxwell-k/peru peru sync
I used
pipx
to installperu
in a venv.peru
runs thegit module
properly but thecurl module
fails. Specifically theimport peru.main
at line 13 inperu/resources/plugins/curl/curl_plugin.py
failsTo test, I installed
peru
usingpip
but not inside a venv and it works fine so its either something weird thatpipx
is doing, or the venv in general