Skip to main content

Python

Build actions for Python projects using uv, a fast Python package manager.

Available Actions

ActionDescription
python-uv-setupInstall Python and uv
python-uv-repository-loginConfigure private PyPI access
python-uv-buildBuild and test
python-uv-cut-tagBump version and create tag
python-uv-repository-publishPublish to PyPI
python-uv-docker-publishBuild 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:

ActionDescription
python-poetry-setupInstall Python and Poetry
python-poetry-loginConfigure 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