···59596060key patterns:
6161- `dynamic = ["version"]` - version comes from git tags, not manual editing
6262-- `[dependency-groups]` - dev deps separate from runtime deps
6362- `[project.scripts]` - CLI entry points
6363+6464+## dependency groups vs optional dependencies
6565+6666+these look similar but serve different purposes.
6767+6868+**dependency groups** (PEP 735) are local-only. they never appear in published package metadata. users who `pip install` your package won't see them:
6969+7070+```toml
7171+[dependency-groups]
7272+dev = ["pytest", "ruff"]
7373+docs = ["mkdocs", "mkdocs-material"]
7474+```
7575+7676+install with `uv sync --group dev`. CI can install only what it needs.
7777+7878+**optional dependencies** are published in package metadata. users can install them:
7979+8080+```toml
8181+[project.optional-dependencies]
8282+aws = ["prefect-aws"]
8383+mcp = ["fastmcp>=2.0"]
8484+```
8585+8686+install with `pip install mypackage[aws]` or `uv add 'mypackage[mcp]'`.
8787+8888+use groups for dev/test/CI. use optional deps for features consumers might want.
8989+9090+from [switching a big python library from setup.py to pyproject.toml](https://blog.zzstoatzz.io/switching-a-big-python-library-from-setuppy-to-pyprojecttoml/)
64916592## versioning from git tags
6693···108135myproject = "myproject.cli:main"
109136myproject-mcp = "myproject.mcp:main"
110137```
111111-112112-## optional dependencies
113113-114114-for features that not everyone needs:
115115-116116-```toml
117117-[project.optional-dependencies]
118118-mcp = ["fastmcp>=2.0"]
119119-```
120120-121121-install with `uv sync --extra mcp` or `uv add 'myproject[mcp]'`.
122138123139## uv workspaces
124140