Closed kzrnm closed 9 months ago
# Microsoft.PowerShell_profile.ps1
Set-Alias poetry "${env:APPDATA}\pypoetry\venv\Scripts\poetry.exe"
I use poetry via alias on PowerShell, so that python interpreter cannot find poetry command and raise FileNotFoundError
at PoetryExecutor.
In poetry run
, poetry adds its venv directory to the $PATH
of the subprocess.
Git bash,
virtualenvs.in-project = true
[tool.poe.tasks.env]
shell = "/usr/bin/env | /usr/bin/grep ^PATH="
$ env PATH="" $APPDATA/pypoetry/venv/Scripts/poetry run poe env
Poe => /usr/bin/env | /usr/bin/grep ^PATH=
PATH=/mingw64/bin:/usr/bin:/c/Users/kzrnm/bin:/z/poethepoet/.venv/Scripts
PowerShell
virtualenvs.in-project = false
[tool.poe.tasks.env]
shell = "(dir Env:PATH).Value"
PS> $env:PATH=""
PS> & "$env:APPDATA/pypoetry/venv/Scripts/poetry" run poe env
Poe => (dir Env:PATH).Value
C:\Program Files\PowerShell\7;C:\Users\kzrnm\AppData\Local\pypoetry\Cache\virtualenvs\poethepoet-zPZo9g_N-py3.9\Scripts;
@nat-n I updated fix/poetry
to the latest.
i don't know why, but CI have worked.
poe cannot run
PoetryExecutor
if poetry is set as an alias instead of$PATH
.I want to skip
PoetryExecutor
when poetry is not found.