Python
Build actions for Python projects using uv, a fast Python package manager.
Available Actions
| Action | Description |
|---|---|
python-uv-setup | Install Python and uv |
python-uv-repository-login | Configure private PyPI access |
python-uv-build | Build and test |
python-uv-cut-tag | Bump version and create tag |
python-uv-repository-publish | Publish to PyPI |
python-uv-docker-publish | Build and push Docker image |
Version File
uv reads and writes versions in pyproject.toml:
[project]
name = "my-service"
version = "1.2.3"
Example Usage
steps:
- uses: actions/checkout@v4
- uses: p6m-actions/python-uv-setup@v1
- uses: p6m-actions/python-uv-repository-login@v1
with:
artifactory-hostname: ${{ vars.ARTIFACTORY_HOSTNAME }}
artifactory-project: ${{ vars.ARTIFACTORY_PROJECT }}
artifactory-username: ${{ secrets.ARTIFACTORY_USERNAME }}
artifactory-token: ${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }}
- uses: p6m-actions/python-uv-build@v1
- uses: p6m-actions/python-uv-docker-publish@v1
with:
image: ${{ vars.ARTIFACTORY_HOSTNAME }}/${{ vars.ARTIFACTORY_PROJECT }}-docker-local/applications/my-service
platforms: linux/amd64,linux/arm64
Poetry Support
For projects using Poetry instead of uv:
| Action | Description |
|---|---|
python-poetry-setup | Install Python and Poetry |
python-poetry-login | Configure private PyPI access |
note
For new projects, uv is recommended over Poetry for faster dependency resolution.
Dockerfile
note
Dockerfile patterns depend on your specific project structure. The python-uv-docker-publish action handles building and publishing the container image using your project's Dockerfile.
See Containerization for general patterns including:
- Multi-stage builds vs copying pre-built artifacts
- Non-root user configuration
- Health check setup
Related
- Python Setup Guide - Local development environment
- Containerization - General container patterns