Fabric icon indicating copy to clipboard operation
Fabric copied to clipboard

[Feature request]: Install with `pipx`

Open invisiblethreat opened this issue 1 year ago • 1 comments

What do you need?

The very nature of pipx is designed to handle some of the less friendly parts of the installer, like aliases with the full poetry virtual environment in the path. This would also support installing the helpers as first-class citizens/binaries/callables. There would need to be a few dependencies added for the helpers via poetry shell and the helpers directory would need to be installed via the pyproject.toml, but I think it would give a really clean result.

I can work on this feature, but wanted buy-in before formalizing the work and submitting a PR.

Caveat: no access to Windows for testing, but have worked this out for macOS/Linux.

Example:

$ which fabric
fabric not found


$ cd fabric && pipx install .
  installed package fabric 0.2.0, installed using Python 3.12.2
  These apps are now globally available
    - fabric
    - fabric-api
    - fabric-webui
    - save
    - ts
    - yt
done! ✨ 🌟 ✨

$ which fabric
/Users/swalsh/.local/bin/fabric

$ yt https://youtu.be/K9mhIUc_hRk | fabric -p extract_wisdom | save fabric-context -t context -t markdown
## SUMMARY

The content features ... snipped for brevity

$ pipx uninstall fabric
uninstalled fabric! ✨ 🌟 ✨

$ fabric -h
zsh: command not found: fabric

invisiblethreat avatar Mar 11 '24 21:03 invisiblethreat

Hey, thanks for the suggestion! Your pipx trick worked for me over here on Windows 10 as well! Actually I had fabric working over on my WSL installation & just ended up using the same fabric. Everything went smoothly possibly partially because I already pipx installed.

Anyway, here are the general steps I took, (post-git clone):

  1. In a VS Code powershell terminal, cd fabric
  2. I think I did run pipx install . once before getting into the shell but was getting pyperclip errors so I did a poetry shell.
  3. From the poetry shell, pipx install . and everything went smoothly there.
  4. fabric --setup (etc.)
  5. yt https://youtu.be/K9mhIUc_hRk | fabric -p extract_wisdom which ran successfully
  6. BONUS: Windows Ollama also seemed to be working with it (though openhermes wasn't great at extracting the wisdom)..

Now I'm assuming everytime I want to run fabric, I'll need to start poetry shell from its dir. (Maybe not though, I'm new to poetry.)

Gerkinfeltser avatar Mar 13 '24 01:03 Gerkinfeltser

@invisiblethreat Looks like this has been released if you want to test. I had some issues getting it to work, but I'll caulk that up to removing the older version and/or installing pipx and getting it working properly. I'm curious how it goes for you!

zestysoft avatar Mar 14 '24 05:03 zestysoft

Does this mean we no longer need to use $> poetry shell?

BryanKerrEdTech avatar Mar 14 '24 05:03 BryanKerrEdTech

I didn't need to use that, but I can't say my system is a clean state as far as globally installed python modules go. The whole premise of using pipx however is to create separate virtual environments for each pipx install you do. My understanding is that pipx looks for files like poetrys' pyproject.toml when installing.

zestysoft avatar Mar 14 '24 07:03 zestysoft

Pipx added!

danielmiessler avatar Mar 14 '24 18:03 danielmiessler