Skip to content

Conversation

@bokelley
Copy link
Contributor

@bokelley bokelley commented Nov 6, 2025

Problem

The PyPI publish step in Release Please workflow is failing with 403 Forbidden because it's using the wrong secret name.

Root Cause

Previous PRs (#6 and #7) changed the secret name from PYPY_API_TOKEN to PYPI_API_TOKEN and then attempted to revert it, but the revert didn't actually work.

Solution

Change PYPI_API_TOKEN back to PYPY_API_TOKEN which is the actual secret name in the repository.

Testing

After merging, the next release will use the correct secret and should publish successfully to PyPI.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

bokelley and others added 2 commits November 6, 2025 12:56
Previous revert commit didn't actually change the secret name.
The correct secret name in the repository is PYPY_API_TOKEN.

This should fix the 403 Forbidden error when publishing to PyPI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Document key learnings from building the Python AdCP SDK:

**Type Safety & Code Generation:**
- Auto-generate Pydantic models from upstream schemas
- Handle missing schema types with documented type aliases
- Use TYPE_CHECKING for optional dependencies
- Use cast() for JSON deserialization type safety

**Testing Strategy:**
- Mock at the right level (_get_client() not httpx class)
- httpx response.json() is SYNCHRONOUS not async
- Test the API as it exists, not as we wish it existed

**CI/CD & Release:**
- Verify secret names before changing them (PYPY_API_TOKEN not PYPI_API_TOKEN)
- Release Please automates version bumps and PyPI publishing
- Entry points in pyproject.toml enable uvx usage

**Python Patterns:**
- String escaping order matters (backslash first, then quotes)
- Atomic file operations for config files
- Connection pooling for HTTP clients
- Python 3.10+ required for | union syntax

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley merged commit b48a33a into main Nov 6, 2025
6 checks passed
@github-actions github-actions bot mentioned this pull request Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants