Issue Using Poetry in Non-package mode
Opened this issue · 2 comments
I have been trying to use this to deploy sphinx pages automatically. The issue seems to involve loading requirements from my pyproject.toml function, which was mostly generated using Poetry. For my use case I didn't want to run Poetry in package mode, as I didn't see the value in having the code available from Pypi. This, however, seems to make poetry fail to build the package (as it should, I just don't think this should be invoked), and I can't figure out why this issue is occurring or how to avoid it. I tried messing with some optional arguments, but they didn't seem to help.
I have included a link to my testing repo below.
https://github.com/rhit-mierowir/TestingGithub/blob/main/.github/workflows/sphinx-to-GHPages.yml
I think the error is happening here, and I am not sure what to do about it.
This is the error message I get:
...
Is there a way to compile sphinx in a non-package mode?
It seems the value of build-system
in pyproejct.toml changes the behavior of pip? I am not poetry user so I know nothing about poetry's "non-package mode".
Does python -mpip install .[docs]
work on your local?
Sorry for the delay, but I finally got around to testing that command out. It doesn't work, and I don't think I can get it to. From what I can tell, this call to pip requires the following structure:
However, Poetry creates the following structure for dependencies in the "docs" group shown below:
I looked around a bit and I am unaware of a way to map this structure into the one shown above, and the two don't seem particularly compatible. Now that I know the command giving me the error, it seems that pip is automatically invoking poetry for some reason in a way that requires package mode, causing the previous error.
I believe all this part is doing is grabbing the dependencies necessary to build the sphinx page, and if so that could be done with poetry, as I will explain below. If so, would it be possible to add support to poetry?
Create a dependency group and add sphinx to it, this can be done to add each additional dependency to the docs group:
ProjectDirectory$ poetry add sphinx --group docs
Install all packages only from the docs group: (to show dependencies replace "install" with "show")
ProjectDirectory$ poetry install --only docs
To detect if a project uses poetry you could run: "poetry show", which fails with no pyproject.toml file or if [tool.poetry] can't be found.
More commands: https://python-poetry.org/docs/cli/#add
Would it be reasonable to add a flag/setting to the interface that runs the install command instead using poetry instead of the "pip install .[docs]" method?