nat-n / poethepoet

A task runner that works well with poetry.
https://poethepoet.natn.io/
MIT License
1.45k stars 59 forks source link

Running tasks broken dependencies with poetry #108

Closed OceanManOne closed 1 year ago

OceanManOne commented 1 year ago

Hi

I'm having an issue where I try to create tasks on installation for various ubuntu packages (to be run in a docker build process). The issue is that in the pyproject.toml there are dependencies which are relative, for example: lib1 = {path = "../../lib1"} but those packages aren't available anymore because I've dropped them in the building process.

Trying to run any task with poetry results in: Directory ../../lib1 does not exist error and the task isn't executed.

Task: [tool.poe.tasks] [tool.poe.tasks.install-lib1] help = "Install lib1" shell = "echo test"

I'm not sure why running the plugin tries to access the dependencies but I assume it shouldn't. Not sure if there is a way to avoid this issue at the moment.

nat-n commented 1 year ago

Hi @OceanManOne,

Hard to say what's happening here, but maybe I can offer some clues.

Does the same thing happen when running other poetry commands? If so it's probably not to do with poe.

Does the same thing happen if you just call the poe command on poetry without a task? (like poetry poe)

Poe doesn't know anything about declared dependencies, but it does try to use the poetry managed venv for running tasks so that tasks benefit those dependencies, and for this it will call poetry env info and maybe also poetry run .... My best guess is that when calling poetry to get details about the env poetry raises that error.

I'm curious what you're trying to achieve here... why don't you bring all the dependencies into the container?