Skip to content

Commit c1e1f0c

Browse files
authored
Merge pull request #108 from awslabs/feature/pypi-package-rename-orb-py
feat: rename PyPI package to orb-py with namespace support
2 parents cd8f741 + 8d2fc65 commit c1e1f0c

33 files changed

+352
-286
lines changed

.github/actions/get-config/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ outputs:
1919
is-release:
2020
description: 'Whether this is a release build'
2121
value: ${{ steps.config.outputs.is-release }}
22+
pypi-name:
23+
description: 'PyPI package name'
24+
value: ${{ steps.config.outputs.pypi-name }}
2225
runs:
2326
using: 'composite'
2427
steps:
@@ -35,6 +38,7 @@ runs:
3538
REPO_ORG=$(yq '.repository.org' .project.yml)
3639
REPO_NAME=$(yq '.repository.name' .project.yml)
3740
CONTAINER_IMAGE="$REPO_ORG/$REPO_NAME"
41+
PYPI_NAME=$(yq '.project.pypi_name' .project.yml)
3842
3943
# Centralized version generation using Makefile infrastructure
4044
if [[ "${{ github.event_name }}" == "release" ]]; then
@@ -54,6 +58,7 @@ runs:
5458
echo "container-image=$CONTAINER_IMAGE"
5559
echo "package-version=$PACKAGE_VERSION"
5660
echo "is-release=$IS_RELEASE"
61+
echo "pypi-name=$PYPI_NAME"
5762
} >> "$GITHUB_OUTPUT"
5863
5964
echo "Default Python version: $DEFAULT_PYTHON_VERSION"
@@ -62,3 +67,4 @@ runs:
6267
echo "Container image: $CONTAINER_IMAGE"
6368
echo "Package version: $PACKAGE_VERSION"
6469
echo "Is release: $IS_RELEASE"
70+
echo "PyPI name: $PYPI_NAME"

.github/workflows/dev-pypi.yml

Lines changed: 21 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
name: PyPI Publishing
1+
name: TestPyPI Publishing
22

33
# SECURITY NOTE: This workflow uses PyPI Trusted Publishing (OIDC)
44
# No API tokens required - authentication is handled automatically via GitHub's OIDC token
55
#
6+
# This workflow publishes to TestPyPI ONLY for development testing.
7+
# Production releases to PyPI are handled by prod-release.yml
8+
#
69
# Prerequisites:
7-
# 1. Configure trusted publisher on PyPI: https://pypi.org/manage/account/publishing/
8-
# 2. Configure trusted publisher on TestPyPI: https://test.pypi.org/manage/account/publishing/
9-
# 3. See docs/deployment/pypi-setup.md for detailed setup instructions
10+
# 1. Configure trusted publisher on TestPyPI: https://test.pypi.org/manage/account/publishing/
11+
# 2. See docs/deployment/pypi-setup.md for detailed setup instructions
1012

1113
env:
1214
# Comment trigger words for package publishing
@@ -26,14 +28,11 @@ on:
2628
branches: [main]
2729
workflow_dispatch:
2830
inputs:
29-
environment:
30-
description: 'Environment to publish to'
31-
required: true
32-
default: 'testpypi'
33-
type: choice
34-
options:
35-
- testpypi
36-
- pypi
31+
force:
32+
description: 'Force publish even if version exists'
33+
required: false
34+
default: false
35+
type: boolean
3736

3837
concurrency:
3938
group: "pypi-publishing"
@@ -47,7 +46,7 @@ jobs:
4746
outputs:
4847
default-python-version: ${{ steps.config.outputs.default-python-version }}
4948
package-version: ${{ steps.config.outputs.package-version }}
50-
is-release: ${{ steps.config.outputs.is-release }}
49+
pypi-name: ${{ steps.config.outputs.pypi-name }}
5150
steps:
5251
- name: Checkout code
5352
uses: actions/checkout@v6.0.1
@@ -61,8 +60,8 @@ jobs:
6160
runs-on: ubuntu-latest
6261
needs: [get-config]
6362
environment:
64-
name: ${{ needs.get-config.outputs.is-release == 'true' && 'pypi' || github.event.inputs.environment || 'testpypi' }}
65-
url: ${{ needs.get-config.outputs.is-release == 'true' && 'https://pypi.org/p/open-resource-broker' || 'https://test.pypi.org/p/open-resource-broker' }}
63+
name: testpypi
64+
url: https://test.pypi.org/p/${{ needs.get-config.outputs.pypi-name }}
6665
permissions:
6766
id-token: write # IMPORTANT: mandatory for trusted publishing
6867
contents: read # needed to checkout code
@@ -75,20 +74,11 @@ jobs:
7574

7675
- name: Determine version and target
7776
run: |
78-
if [[ "${{ needs.get-config.outputs.is-release }}" == "true" ]]; then
79-
{
80-
echo "VERSION=${{ needs.get-config.outputs.package-version }}"
81-
echo "TARGET=pypi"
82-
echo "IS_RELEASE=true"
83-
} >> "$GITHUB_ENV"
84-
else
85-
# Dev version for TestPyPI - use centralized version
86-
{
87-
echo "VERSION=${{ needs.get-config.outputs.package-version }}"
88-
echo "TARGET=testpypi"
89-
} >> "$GITHUB_ENV"
90-
fi
91-
echo "Publishing to: $TARGET with version: $VERSION"
77+
{
78+
echo "VERSION=${{ needs.get-config.outputs.package-version }}"
79+
echo "TARGET=testpypi"
80+
} >> "$GITHUB_ENV"
81+
echo "Publishing to: TestPyPI with version: $VERSION"
9282
9383
- name: Setup Python and UV
9484
uses: ./.github/actions/setup-uv-cached
@@ -110,37 +100,23 @@ jobs:
110100
verbose: true
111101
skip-existing: true
112102

113-
- name: Publish to PyPI
114-
if: github.event_name == 'release'
115-
uses: pypa/gh-action-pypi-publish@release/v1
116-
with:
117-
verbose: true
118-
skip-existing: true
119-
120103
- name: Create deployment summary
121104
run: |
122105
{
123106
echo "## Package Published Successfully"
124107
echo ""
125-
if [ "$TARGET" = "pypi" ]; then
126-
echo "**Environment:** Production PyPI"
127-
echo "**Installation:** \`pip install open-resource-broker\`"
128-
else
129-
echo "**Environment:** Test PyPI"
130-
echo "**Installation:** \`pip install --index-url https://test.pypi.org/simple/ open-resource-broker\`"
131-
fi
108+
echo "**Environment:** Test PyPI"
109+
echo "**Installation:** \`pip install --index-url https://test.pypi.org/simple/ ${{ needs.get-config.outputs.pypi-name }}\`"
132110
echo ""
133111
echo "**Version:** $VERSION"
134112
echo "**Commands:**"
135113
echo "- \`orb --help\`"
136-
echo "- \`open-resource-broker --help\`"
137114
} >> "$GITHUB_STEP_SUMMARY"
138115
139116
generate-sbom:
140117
name: Generate SBOM
141118
runs-on: ubuntu-latest
142119
needs: [get-config, publish]
143-
if: github.event_name == 'release' || github.event.inputs.environment == 'pypi'
144120

145121
permissions:
146122
contents: read

.github/workflows/prod-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
container-image: ${{ steps.config.outputs.container-image }}
3232
package-version: ${{ steps.config.outputs.package-version }}
3333
is-release: ${{ steps.config.outputs.is-release }}
34+
pypi-name: ${{ steps.config.outputs.pypi-name }}
3435
steps:
3536
- name: Checkout code
3637
uses: actions/checkout@v6.0.1

.github/workflows/security-code.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
uses: actions/dependency-review-action@v4
113113
with:
114114
fail-on-severity: moderate
115-
allow-licenses: MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC
115+
allow-licenses: MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, Unlicense
116116

117117
codeql-analysis:
118118
name: CodeQL Analysis

.project.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
project:
66
name: open-resource-broker
7+
pypi_name: orb-py # PyPI distribution name
78
short_name: orb # CLI command name
89
version: 1.0.0
910
description: "Cloud provider integration plugin for IBM Spectrum Symphony Host Factory"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Quality Checks](https://github.com/awslabs/open-resource-broker/workflows/Quality%20Checks/badge.svg)](https://github.com/awslabs/open-resource-broker/actions/workflows/ci-quality.yml)
55
[![Security Scanning](https://github.com/awslabs/open-resource-broker/workflows/Security%20Scanning/badge.svg)](https://github.com/awslabs/open-resource-broker/actions/workflows/security-code.yml)
66
[![Latest Release](https://img.shields.io/github/v/release/awslabs/open-resource-broker)](https://github.com/awslabs/open-resource-broker/releases)
7-
[![PyPI Version](https://img.shields.io/pypi/v/open-resource-broker)](https://pypi.org/project/open-resource-broker/)
7+
[![PyPI Version](https://img.shields.io/pypi/v/orb-py)](https://pypi.org/project/orb-py/)
88
[![License](https://img.shields.io/github/license/awslabs/open-resource-broker)](LICENSE)
99

1010
A cloud provider integration plugin for IBM Spectrum Symphony Host Factory, enabling dynamic provisioning of compute resources with a REST API interface and structured architecture implementation.
@@ -65,7 +65,7 @@ curl http://localhost:8000/health
6565

6666
```bash
6767
# Install from PyPI
68-
pip install open-resource-broker
68+
pip install orb-py
6969

7070
# Verify installation
7171
orb --version
@@ -104,7 +104,7 @@ make dev
104104

105105
| Method | Location | Use Case | Command |
106106
|--------|----------|----------|---------|
107-
| **PyPI** | System Python | End users | `pip install open-resource-broker` |
107+
| **PyPI** | System Python | End users | `pip install orb-py` |
108108
| **System** | `/usr/local/orb/` or `~/.local/orb/` | Production deployment | `make install-system` |
109109
| **Local** | `./.venv/` | Development | `make dev-install` |
110110

@@ -410,7 +410,7 @@ make test-performance
410410

411411
### Project Health & Metrics
412412

413-
[![Python Versions](https://img.shields.io/pypi/pyversions/open-resource-broker)](https://pypi.org/project/open-resource-broker/)
413+
[![Python Versions](https://img.shields.io/pypi/pyversions/orb-py)](https://pypi.org/project/orb-py/)
414414
[![Success Rate](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/fgogolli/ec3393a523fa3a6b6ff89a0636de3085/raw/success-rate.json)](https://github.com/awslabs/open-resource-broker/actions/workflows/health-monitoring.yml)
415415
[![Avg Duration](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/fgogolli/ec3393a523fa3a6b6ff89a0636de3085/raw/avg-duration.json)](https://github.com/awslabs/open-resource-broker/actions/workflows/health-monitoring.yml)
416416
[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/fgogolli/50bc37df3c178a0846dbd3682a71d50a/raw/coverage.json)](https://github.com/awslabs/open-resource-broker/actions/workflows/advanced-metrics.yml)

dev-tools/scripts/generate_pyproject.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ def update_pyproject_selective(pyproject_path: Path) -> None:
7979
# Get metadata updates
8080
package_name = _get_config_value(".project.name")
8181
package_name_short = _get_config_value(".project.short_name")
82+
83+
# Get PyPI-specific name, fallback to package_name if not set
84+
pypi_name = _get_config_value(".project.pypi_name")
85+
if not pypi_name or pypi_name == "null":
86+
pypi_name = package_name
87+
8288
version = _get_config_value(".project.version")
8389
description = _get_config_value(".project.description")
8490
author = _get_config_value(".project.author")
@@ -114,7 +120,7 @@ def update_pyproject_selective(pyproject_path: Path) -> None:
114120
new_lines.extend(
115121
[
116122
"[project]",
117-
f'name = "{package_name}"',
123+
f'name = "{pypi_name}"',
118124
f'version = "{version}"',
119125
f'description = "{description}"',
120126
'readme = "README.md"',

docs/root/deployment/pypi-setup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ To verify trusted publishing is working:
119119
3. **Verify Package:**
120120
```bash
121121
# Test installation from Test PyPI
122-
pip install --index-url https://test.pypi.org/simple/ open-resource-broker
122+
pip install --index-url https://test.pypi.org/simple/ orb-py
123123

124124
# Test installation from Production PyPI
125-
pip install open-resource-broker
125+
pip install orb-py
126126
```
127127

128128
## Security Best Practices

docs/root/deployment/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ gcloud run deploy orb-api \
116116
#### Direct Installation
117117
```bash
118118
# Install from PyPI
119-
pip install open-resource-broker
119+
pip install orb-py
120120

121121
# Or install from source
122122
git clone <repository-url>

docs/root/deployment/traditional.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ source orb-env/bin/activate
2121

2222
```bash
2323
# Install from PyPI
24-
pip install open-resource-broker
24+
pip install orb-py
2525

2626
# Or install from source
2727
git clone <repository-url>

0 commit comments

Comments
 (0)