https://github.com/python-project-templates/hatch-multi
Create multiple discrete packages from optional-dependencies (extras)
https://github.com/python-project-templates/hatch-multi
build-tool hatch hatchling python
Last synced: 25 days ago
JSON representation
Create multiple discrete packages from optional-dependencies (extras)
- Host: GitHub
- URL: https://github.com/python-project-templates/hatch-multi
- Owner: python-project-templates
- License: apache-2.0
- Created: 2025-07-15T14:10:39.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2026-03-22T17:09:52.000Z (about 1 month ago)
- Last Synced: 2026-03-23T08:14:59.434Z (about 1 month ago)
- Topics: build-tool, hatch, hatchling, python
- Language: Python
- Homepage:
- Size: 597 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# hatch multi
Create multiple discrete packages from optional-dependencies (extras)
[](https://github.com/python-project-templates/hatch-multi/actions/workflows/build.yaml)
[](https://codecov.io/gh/python-project-templates/hatch-multi)
[](https://github.com/python-project-templates/hatch-multi)
[](https://pypi.python.org/pypi/hatch-multi)
## Overview
A small [hatch plugin](https://hatch.pypa.io/latest/) to create multiple discrete packages from a single package, via `optional-dependencies`.
**pyproject.toml**
```toml
[project]
name = "my-project"
...
dynamic = ["dependencies"]
[project.optional-dependencies]
main = [...]
other = [...]
[tool.hatch.metadata.hooks.multi]
primary = "main"
```
```bash
python -m build
# Produces my-project wheel and sdist, with dependencies from [project.optional-dependencies.main]
HATCH_MULTI_BUILD=other python -m build
# Produces my-project-other wheel and sdist, with dependencies from [project.optional-dependencies.other]
```
> [!NOTE]
> This library was generated using [copier](https://copier.readthedocs.io/en/stable/) from the [Base Python Project Template repository](https://github.com/python-project-templates/base).