Skip to content

Easier use of python venvsΒ #26

Description

@pSpitzner

Hi @BenjaminOddou

thanks for this awesome workflow!

I just set it up, and it took me a while to figure out how to make it respect a local uv venv.

In the end, the solution for me was to:

  • create a .venv in the workflow folder uv venv --python 3.12
  • install pillow there uv pip install pillow
  • edit the two api call scripts to include source .venv/bin/activate before calling python3

Easy enough, but I did not want to modify the workflow, so updates wont break the setup.
Maybe you want to the optional sourcing logic (and add a snippet to the readme that uv venvs are a good idea to keep things contained)

Why?

  • Python via brew is a decent alternative since python3 is not shipping with macOS anymore, but...
  • it gets hard to isolate things
  • brew installs are pretty slow in comparison to creating uv venvs and installing pillow there
  • uv venvs per workflow really seem very sensible to me, since workflows often have very differen requirements (maybe we pitch this idea as a suggest pattern to the alfted devs β€” they are always very helpful and welcome ideas!)

Thanks again,
p

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions