-
Hi there, I stumbled upon a weird thing. I'm not sure if this is a bug, fits into the known limitations, or I'm using it completely wrong. I've got a fullstack monorepo with the following structure:
The structure is generated via a copier template. After generating it automatically installs the npm dependencies Note: it will not cd into the corresponding directories and will execute the commands from the When i now install a post_install hook like this: [tool.poe.poetry_hooks]
post_install = "pre-commit-install"
[tool.poe.tasks]
pre-commit-install = "pre-commit install --install-hooks" It will beautifully work if I'm in the BUT running For me it looks like the I know that I am misusing the functionality a bit here. Also it is a bit buggy because the pre-commit config is outside the poetry folder structure. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think this might be a bug. I suspect the issue is that the poethepoet plugin naively assumes it should inherit the CWD from the poetry process here: https://github.com/nat-n/poethepoet/blob/main/poethepoet/plugin.py#L59 There is probably a way for the plugin to get from poetry that it is being run with a different directory (or rather the location of the pyproject.toml used by poetry). It'll take some fiddling to work out how. I suspect the same failure mode will occur when running a poe task directly with I'll add this to my todo list, but if you want a fix soon any help working out exactly how to do this would be appreciated. |
Beta Was this translation helpful? Give feedback.
I think this might be a bug. I suspect the issue is that the poethepoet plugin naively assumes it should inherit the CWD from the poetry process here: https://github.com/nat-n/poethepoet/blob/main/poethepoet/plugin.py#L59
There is probably a way for the plugin to get from poetry that it is being run with a different directory (or rather the location of the pyproject.toml used by poetry). It'll take some fiddling to work out how. I suspect the same failure mode will occur when running a poe task directly with
poetry --directory ...
:(I'll add this to my todo list, but if you want a fix soon any help working out exactly how to do this would be appreciated.