install-poetry icon indicating copy to clipboard operation
install-poetry copied to clipboard

Venv procedure Windows in README

Open Investigamer opened this issue 3 years ago • 5 comments

The Venv procedure outlined in the README for using a matrix that includes windows is incorrect. For windows it would be ".venv/scripts/activate", if you precede that with "source" it will throw an error that there's no command named source. This makes using source $venv with a windows workflow impossible unfortunately. Maybe just include "source" in the $venv variable and exclude it for windows version?

Investigamer avatar Aug 05 '22 08:08 Investigamer

I'm pretty sure source works if you remember to set the shell as bash, no?

sondrelg avatar Aug 05 '22 08:08 sondrelg

Could you give me an example workflow for how to do this? I'm still pretty new to workflows, I ended up just eliminating venv from my workflow altogether, but I'm trying to do a workflow that builds an executable for windows, macos, and linux with pyinstaller, you can see my current implementation here (also uses poetry): https://github.com/MrTeferi/MTG-Art-Downloader/blob/main/.github/workflows/build.yml

Investigamer avatar Aug 05 '22 08:08 Investigamer

It's described pretty well here I think. You just need to add the defaults entry in your workflow file around like 10-11 I think

sondrelg avatar Aug 05 '22 09:08 sondrelg

In other words, I think the windows example from the docs will work for you, if you remember to set the default shell to be bash 🙂

sondrelg avatar Aug 05 '22 09:08 sondrelg

Oh yeah I see the line! I'll give that a shot, thanks!

Investigamer avatar Aug 09 '22 09:08 Investigamer

Did you manage to get this working @MrTeferi?

sondrelg avatar Sep 01 '22 20:09 sondrelg

I test on windows and calling activate manually is unnecessary. After poetry is run, the env is automatically activated in the workflow

miigotu avatar Sep 18 '22 21:09 miigotu

In that case, I guess we can consider this closed. Thanks @miigotu 👍

sondrelg avatar Sep 19 '22 13:09 sondrelg