nat-n / poethepoet

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

Poe plugin fails poetry when running outside of python project #53

Closed JarnoRFB closed 2 years ago

JarnoRFB commented 2 years ago

Thanks for the great project!

I installed poe as a plugin using poetry plugin add poethepoet[poetry_plugin] with the latest pre-release of poetry. However, when I now run poetry in a directory where there is not pyproject.toml I get the error

  PoeException

  Poe could not find a pyproject.toml file in /my/path or its parents

  at .local/share/pypoetry/venv/lib/python3.9/site-packages/poethepoet/config.py:219 in find_pyproject_toml
      215│ 
      216│         maybe_result = self.cwd.joinpath(self.TOML_NAME)
      217│         while not maybe_result.exists():
      218│             if maybe_result.parent == Path("/"):
    → 219│                 raise PoeException(
      220│                     f"Poe could not find a pyproject.toml file in {self.cwd} or"
      221│                     " its parents"
      222│                 )
      223│             maybe_result = maybe_result.parents[1].joinpath(self.TOML_NAME).resolve()

This is inconvenient, because running poetry new is no longer possible this way. I think the desired behavior should just be that the fact that no pyproject.toml exists should just be ignored.

nat-n commented 2 years ago

Oh no! that's not meant to happen. Thanks for reporting it :)

I'll look into getting this fixed shortly.

nat-n commented 2 years ago

It is done! https://github.com/nat-n/poethepoet/releases/tag/v0.12.3