Build Tools¶
Configure your preferred Python build tool.
Overview¶
releasio supports three popular Python build and publish tools:
| Tool | Description | Default |
|---|---|---|
| uv | Fast, modern package manager | Yes |
| poetry | Dependency management and packaging | No |
| pdm | Modern Python package manager | No |
uv (Default)¶
uv is a fast Python package installer and resolver.
Configuration¶
Commands Used¶
| Action | Command |
|---|---|
| Build | uv build |
| Publish | uv publish |
| Publish (OIDC) | uv publish --trusted-publishing always |
Project Setup¶
[project]
name = "my-package"
version = "1.0.0"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
Workflow Example¶
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v4
- uses: mikeleppane/releasio@v2
with:
command: release
dry-run: 'false'
github-token: ${{ secrets.GITHUB_TOKEN }}
Why uv?¶
- Fast: 10-100x faster than pip
- Modern: First-class
pyproject.tomlsupport - Reliable: Deterministic resolution
- Compatible: Works with existing tools
Poetry¶
Poetry is a tool for dependency management and packaging.
Configuration¶
Commands Used¶
| Action | Command |
|---|---|
| Build | poetry build |
| Publish | poetry publish |
| Publish (token) | poetry publish --username __token__ --password $TOKEN |
Project Setup¶
[tool.poetry]
name = "my-package"
version = "1.0.0"
description = "My awesome package"
authors = ["Your Name <you@example.com>"]
[tool.poetry.dependencies]
python = "^3.11"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Workflow Example¶
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Poetry
run: pipx install poetry
- uses: mikeleppane/releasio@v2
with:
command: release
dry-run: 'false'
github-token: ${{ secrets.GITHUB_TOKEN }}
pypi-token: ${{ secrets.PYPI_TOKEN }}
Poetry and Trusted Publishing
Poetry doesn't natively support OIDC trusted publishing. Use an API token for authentication.
Version Location¶
Poetry stores version in [tool.poetry]:
releasio automatically detects and updates this.
PDM¶
PDM is a modern Python package and dependency manager.
Configuration¶
Commands Used¶
| Action | Command |
|---|---|
| Build | pdm build |
| Publish | pdm publish |
| Publish (token) | pdm publish --username __token__ --password $TOKEN |
Project Setup¶
[project]
name = "my-package"
version = "1.0.0"
requires-python = ">=3.11"
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
Workflow Example¶
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install PDM
run: pipx install pdm
- uses: mikeleppane/releasio@v2
with:
command: release
dry-run: 'false'
github-token: ${{ secrets.GITHUB_TOKEN }}
pypi-token: ${{ secrets.PYPI_TOKEN }}
PDM Features¶
- PEP 582 support (local packages)
- Fast dependency resolution
- Lock file support
- Plugin system
Comparison¶
| Feature | uv | Poetry | PDM |
|---|---|---|---|
| Speed | Fastest | Good | Good |
| Lock file | Yes | Yes | Yes |
| OIDC support | Yes | No | No |
| Dependency groups | Yes | Yes | Yes |
| PEP 621 | Yes | Partial | Yes |
| Scripts | Yes | Yes | Yes |
Recommendation¶
| Use Case | Recommended Tool |
|---|---|
| New projects | uv |
| Existing Poetry projects | Poetry |
| PEP 582 workflow | PDM |
| Maximum speed | uv |
| Rich plugin ecosystem | Poetry |
Tool Detection¶
releasio can auto-detect your build tool:
| Indicator | Detected Tool |
|---|---|
poetry.lock |
Poetry |
pdm.lock |
PDM |
uv.lock |
uv |
[tool.poetry] in pyproject.toml |
Poetry |
| Default | uv |
To override, set explicitly:
Custom Build Commands¶
For advanced use cases, configure custom build hooks:
[hooks]
# Custom build command
build = "make build VERSION={version}"
# Or multiple commands
pre_release = [
"npm run build", # Build frontend
"uv build", # Build Python package
]
Lock File Updates¶
releasio can update lock files when bumping versions:
This runs:
| Tool | Command |
|---|---|
| uv | uv lock |
| Poetry | poetry lock --no-update |
| PDM | pdm lock |
Troubleshooting¶
"Tool not found"¶
Solution: Install the tool in your workflow:
"Build failed"¶
Checklist:
- Valid
pyproject.toml - All dependencies installed
- Correct Python version
- Build backend installed
"Publish authentication failed"¶
For Poetry/PDM: Use API token:
For uv: Use trusted publishing:
See Also¶
- PyPI Publishing - Complete publishing guide
- Trusted Publishing - OIDC authentication
- Configuration Reference - All options