Skip to content

Commit c98d762

Browse files
committed
Add explanation of standard project structure (#8713)
1 parent 93baede commit c98d762

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/pyproject.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,24 @@ 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
581+
582+
Poetry considers a "standard project structure" to be:
583+
584+
```bash
585+
project_name/
586+
├── pyproject.toml
587+
├── README.md
588+
├── project_name/
589+
│ └── __init__.py
590+
└── tests/
591+
└── __init__.py
592+
The top-level directory contains pyproject.toml and README.md.
593+
The main package directory matches the name field in pyproject.toml (or a snake_case variant).
594+
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 %}}
597+
580598
```toml
581599
[tool.poetry]
582600
# ...

0 commit comments

Comments
 (0)