Skip to content

[FEATURE] Configure PyPI package publishing #1

@chaholl

Description

@chaholl

Feature Summary

Configure automated publishing of the promptpack and promptpack-langchain packages to PyPI on tagged releases.

Background

Currently, the project:

  • Has pyproject.toml files configured with hatchling build system for both packages
  • Does not publish to PyPI

Users who want to use the libraries must install from git:

pip install "git+https://github.com/AltairaLabs/promptpack-python.git#subdirectory=packages/promptpack"
pip install "git+https://github.com/AltairaLabs/promptpack-python.git#subdirectory=packages/promptpack-langchain"

Publishing to PyPI would allow:

pip install promptpack
pip install promptpack-langchain

Proposed Implementation

1. PyPI Account Setup

  • Create PyPI account for AltairaLabs (if not exists)
  • Create projects on PyPI: promptpack and promptpack-langchain
  • Set up Trusted Publisher (OIDC) for GitHub Actions (preferred over API tokens)

2. GitHub Workflow

Add a publish workflow that:

  • Triggers only on version tags (v*)
  • Builds both packages using hatchling
  • Publishes to PyPI using trusted publishing
name: Publish to PyPI

on:
  push:
    tags: ["v*"]

jobs:
  publish:
    runs-on: ubuntu-latest
    permissions:
      id-token: write  # Required for trusted publishing
    strategy:
      matrix:
        package: [promptpack, promptpack-langchain]
    steps:
      - uses: actions/checkout@v4
      
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      
      - name: Install build tools
        run: pip install build
      
      - name: Build package
        run: python -m build packages/${{ matrix.package }}
      
      - name: Publish to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          packages-dir: packages/${{ matrix.package }}/dist/

3. Package Dependencies

Note: promptpack-langchain depends on promptpack. Need to ensure:

  • Both packages are published
  • Version constraints are properly specified
  • Publishing order handles dependencies correctly

Tasks

  • Set up PyPI trusted publisher for promptpack
  • Set up PyPI trusted publisher for promptpack-langchain
  • Add publish workflow to CI
  • Test with TestPyPI first
  • Create first release tag to trigger publish
  • Update README with pip install instructions
  • Update omnia-langchain-runtime to use PyPI packages instead of git

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions