-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Poe not finding the poetry executable #121
Comments
Hi @jacobm-splunk, thanks for the feedback. I'll admit I'm a little confused by this, and would appreciate some help understanding what's going wrong here or what poe should perhaps do differently. Is the issue that poetry is itself installed into the poetry managed venv, and poe is trying to use that one instead of the one from the user's environment? I guess poetry is installed as a transitive dependency of a poetry plugin that is installed as dev dependency? If that's the case then this much is to be expected since with Although that doesn't fully explain why it doesn't work... I'm also a bit confused why it's trying to execute poetry via a relative path... does It might be interesting to check the following: poetry -C <pyproject_dir> run which poetry
poetry -C <pyproject_dir> run python -c "import sys; print(sys.path)"
poetry -C <pyproject_dir> run python -c "from subprocess import run; run(['which', 'poetry'])" Also I wonder if it makes a different if you cd into the project directory first? Any reason not to do this? Finally I'm curious why you're using |
Hi @nat-n,
Poe is trying to use the one installed in the poetry venv, but I don't think that's actually the root of the issue. It's expected since, we're running it with poetry.
Yes, sort of. It's being installed as part of a gitlab pipeline where poetry is being used to manage our dependencies.
Yes, exactly.
Basically,
We're mostly using it to run poe since we're using poetry to manage our dependencies. We could definitely just install poe through pip and it would probably work. I can try to those commands if you need them, but I'm pretty sure the issue is mostly a mismatch between the current working directory and the relative path generated through |
Thanks for the extra info, it makes sense now. I think this might work as a fix: 9ba7285 @jacobm-splunk Could you do me a favour and try out the fix with this pre-release? https://pypi.org/project/poethepoet/0.18.2b1/ |
I probably won't have time in the next month or two to get this done. The patching process is fairly involve on our systems. I can however try it if this got merged. |
@jacobm-splunk The fix is shipped in 0.19.0 🙂 |
Poe isn't finding the poetry executable:
We are running it with the
--root
option:poetry -C <pyproject_dir> run poe --root <path/to/pyproject.toml>
This works when run locally, but not when run in CI (Gitlab)
It looks like the
which poetry
is not finding the correct poetry executable path, because I confirmed thatconnector_gen/.venv/bin/poetry
exists relative to the root of the repo.I patched executor/poetry.py and this is the poetry executable and current working directory it's finding:
poetry_cmd: connector_gen/.venv/bin/poetry
cwd: /builds/phantom/connector-gen/connector_gen
Basically, the poetry command it's finding with
which poetry
is relative to the repo root, but the current working directory is one directory in where our pyproject.toml is.Pyproject.toml is on directory from the root of the repo in connector_gen/pyproject.toml
The text was updated successfully, but these errors were encountered: