Skip to content
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

Support for project files written by Poetry #29

Closed
ghisvail opened this issue Dec 15, 2022 · 2 comments · Fixed by #33
Closed

Support for project files written by Poetry #29

ghisvail opened this issue Dec 15, 2022 · 2 comments · Fixed by #33
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed stale
Milestone

Comments

@ghisvail
Copy link

Using sphinx-pyproject on a project setup with Poetry results in the following error:

dom_toml.parser.BadConfigError: No 'project' table found in .../pyproject.toml

Indeed the project metadata are stored in the [tool.poetry] table, instead of project.

I wonder whether it would be possible to support Poetry's setup by providing a project_table optional parameter defaulting to project which Poetry users could override to tool.poetry?

@alexanderustinov
Copy link

It would be nice to have support for this, but it would not be sufficient to pass different table name - handling of authors differ:

[project]
name = "example"
version = "0.1.0"
authors = [
    {name = "Your Name", email = "you@domain.com"},
]
description = "some description" 
[tool.poetry]
name = "example"
version = "0.1.0"
authors = [
    "Your Name <you@domain.com>",
]
description = "some description" 

Relevant poetry issue python-poetry/poetry#3332
I think it's better to wait for changes in poetry and duplicate tables in pyproject.toml as a workaround.

@domdfcoding
Copy link
Member

I'll happily accept a PR adding support for poetry support, if poetry supporting PEP 621 is a way off.

What's required is a different version of the ProjectParser class that parses from [tool.poetry] instead of [project], and a bit of logic in SphinxConfig.__init__ to decide on which table and class to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants