Skip to content

Commit f88d29a

Browse files
committed
Docs: Add Standard Project Structure snippet for Poetry package auto-detection (#8713)
1 parent c98d762 commit f88d29a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/pyproject.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,9 @@ A list of packages and modules to include in the final distribution.
577577
If your project structure differs from the standard one supported by `poetry`,
578578
you can specify the packages you want to include in the final distribution.
579579

580-
#### Standard Project Structure
580+
### Standard Project Structure
581581

582-
Poetry considers a "standard project structure" to be:
582+
Poetry automatically detects your main package if it follows this layout:
583583

584584
```bash
585585
project_name/
@@ -589,11 +589,13 @@ project_name/
589589
│ └── __init__.py
590590
└── tests/
591591
└── __init__.py
592+
This layout assumes:
592593
The top-level directory contains pyproject.toml and README.md.
593594
The main package directory matches the name field in pyproject.toml (or a snake_case variant).
594595
Tests go in a separate tests/ directory.
595-
{{% note %}} If your project matches this layout, Poetry will auto-detect your main package, and you do not need to list it in [tool.poetry.packages]. {{% /note %}}
596-
{{% warning %}} If your project differs from this standard layout — for example, packages inside a lib/ directory, or the top-level package name doesn’t match name in pyproject.toml — you must explicitly list them in [tool.poetry.packages] to include them in your distribution. {{% /warning %}}
596+
{{% note %}} If your project matches this layout, Poetry auto-detects the main package, so you do not need to list it in [tool.poetry.packages]. {{% /note %}}
597+
{{% warning %}} Non-standard layouts (e.g., packages inside lib/ or top-level package name differs from name in pyproject.toml) require explicit entries in [tool.poetry.packages]. {{% /warning %}}
598+
597599

598600
```toml
599601
[tool.poetry]

0 commit comments

Comments
 (0)