This document covers the private PyPI setup and publishing flow for the Workflow CLI and its shared models package:
| Package | PyPI Name | Description |
|---|---|---|
| CLI | agents-workflow-cli |
Standalone CLI tool for managing workflows |
| Models | agents-workflow-models |
Shared Pydantic v2 schemas and enums |
Both are hosted on a private AWS CodeArtifact registry:
Domain: agents-platform
Repository: agents-python-packages
Endpoint: https://agents-platform-<AWS_ACCOUNT_ID>.d.codeartifact.us-east-1.amazonaws.com/pypi/agents-python-packages/
Note:
<AWS_ACCOUNT_ID>is the internal platform AWS account ID and is not published in this repository. Internal developers can retrieve it afteraws sso loginwithaws sts get-caller-identity --query Account --output text, or find it in the internal platform onboarding docs. Export it asCODEARTIFACT_OWNERbefore running theawscommands below.
All CodeArtifact configuration lives in the root Makefile with sensible defaults:
| Variable | Default |
|---|---|
CODEARTIFACT_DOMAIN |
agents-platform |
CODEARTIFACT_REPO |
agents-python-packages |
CODEARTIFACT_OWNER |
<AWS_ACCOUNT_ID> |
CODEARTIFACT_REGION |
us-east-1 |
CODEARTIFACT_UPSTREAM |
public:pypi |
Override per-call (make codeartifact-setup CODEARTIFACT_DOMAIN=other) or by
exporting environment variables.
Create the CodeArtifact domain, repository, and upstream PyPI connection (idempotent -- safe to run more than once):
# From the repo root
make codeartifact-setupThis runs:
aws codeartifact create-domain(skipped if it already exists)aws codeartifact create-repository(skipped if it already exists)aws codeartifact associate-external-connectionwithpublic:pypi
Verify the result:
make codeartifact-infoGet a short-lived auth token and the repository endpoint:
make codeartifact-loginThis prints the token and endpoint URL which you can export for uv or pip.
# Grab credentials
export CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token \
--domain agents-platform \
--domain-owner "$CODEARTIFACT_OWNER" \
--region us-east-1 \
--query authorizationToken --output text)
export CODEARTIFACT_ENDPOINT=$(aws codeartifact get-repository-endpoint \
--domain agents-platform \
--domain-owner "$CODEARTIFACT_OWNER" \
--repository agents-python-packages \
--format pypi \
--region us-east-1 \
--query repositoryEndpoint --output text)
# Install the CLI as a uv tool
uv tool install agents-workflow-cli \
--index-url "https://aws:${CODEARTIFACT_AUTH_TOKEN}@${CODEARTIFACT_ENDPOINT#https://}simple/"
# Or add the shared models as a project dependency
uv add agents-workflow-models \
--index-url "https://aws:${CODEARTIFACT_AUTH_TOKEN}@${CODEARTIFACT_ENDPOINT#https://}simple/"From the repo root:
# Publish the CLI
make codeartifact-publish-cli
# Publish the shared models
make codeartifact-publish-modelsEach target runs uv build then uv publish with UV_PUBLISH_URL,
UV_PUBLISH_USERNAME=aws, and UV_PUBLISH_PASSWORD set automatically via
aws codeartifact get-authorization-token.
Set these in Bitbucket repository settings:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_DEFAULT_REGION(defaults tous-east-1)
The CodeArtifact domain/repo/owner defaults are baked into the pipeline file. Override them via pipeline variables if needed.
The release validation script (scripts/release/validate_release.py) enforces:
- Semver format (
X.Y.Z) inpyproject.tomland__init__.py - Version sync between
pyproject.tomland__init__.py - Tag matches the package version (when
--tagis provided)
# Validate locally (from workflow-cli/)
python scripts/release/validate_release.py --package cli
python scripts/release/validate_release.py --package models
python scripts/release/validate_release.py --package all
# Validate against a specific tag
python scripts/release/validate_release.py --package cli --tag "cli-v0.1.1"Tests covering these checks live in tests/test_release_validation.py.
-
Bump the version in both places — they must match:
- CLI:
pyproject.toml([project].version) andsrc/cli/__init__.py(__version__) - Models:
shared-models/pyproject.tomlandshared-models/src/workflow_models/__init__.py
- CLI:
-
Validate before pushing:
uv run pytest tests/test_release_validation.py
-
Commit and tag:
git commit -am "release: bump CLI to 0.2.0" git tag cli-v0.2.0 git push origin feature/... --tags -
CI publishes automatically when the tag matches
cli-v*ormodels-v*.Or publish manually from the repo root:
make codeartifact-publish-cli make codeartifact-publish-models
The backend Docker image installs agents-workflow-models from CodeArtifact
instead of copying the source from the monorepo. This is handled transparently
via BuildKit secrets and UV_NO_SOURCES.
backend/pyproject.tomldeclares a namedcodeartifactindex alongside the existing local path source in[tool.uv.sources]- The Dockerfile sets
UV_NO_SOURCES=1which tells uv to ignore the local path source and resolve packages from the CodeArtifact index instead - The CodeArtifact auth token is injected via
--mount=type=secretso it never appears in image layers uv lock --no-sourcesre-resolves the lockfile without path sources, thenuv syncinstalls everything from the index
Locally, uv sync uses the [tool.uv.sources] path source as usual:
cd backend
uv sync --all-groups # Uses ../workflow-cli/shared-models (editable)Via docker compose (local development):
# Set the CodeArtifact token (or add to .env)
export CODEARTIFACT_TOKEN=$(aws codeartifact get-authorization-token \
--domain agents-platform --domain-owner "$CODEARTIFACT_OWNER" \
--region us-east-1 --query authorizationToken --output text)
docker compose build agents-api
# Or use make (auto-fetches the token):
make buildVia devops Makefile (CI/production):
cd backend/devops/app-stack
make build # Auto-fetches CodeArtifact token and passes as secretCodeArtifact rejects duplicate version uploads. Bump the version in
pyproject.toml and __init__.py, then publish again.
Ensure your AWS CLI is configured with credentials that have
codeartifact:GetAuthorizationToken and codeartifact:GetRepositoryEndpoint
permissions. Run aws sts get-caller-identity to verify.
CodeArtifact tokens expire after 12 hours. Run make codeartifact-login again.
Ensure the package version in backend/pyproject.toml is published to
CodeArtifact. Check with:
make codeartifact-login
# Use the token/endpoint to browse available versionsIf you recently bumped the version, publish first:
make codeartifact-publish-modelsThe build requires a CodeArtifact auth token. Either:
- Set
CODEARTIFACT_TOKENin your environment or.envfile, or - Use
make buildwhich auto-fetches the token