Repository navigation
build!: publish to PyPI, with the protocol distribution renamed to agentenv-framework-protocol - #12
Conversation
A release tag now also uploads agentenv-protocol and agentenv-framework to PyPI through trusted publishing, from a GitHub Actions job in the `pypi` environment. It builds them the way the release does, with agentenv-framework pinned to the exact agentenv-protocol it was released with, checks the metadata renders, and skips files already on PyPI so a rerun is safe. It uses only GitHub-owned actions and uv from PyPI. The README becomes the PyPI project page, so it now installs from PyPI, keeps the clone for development, and uses absolute links and image URLs, which PyPI doesn't resolve relatively. The package description says what the SDK is. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
| ### Install the packages | ||
|
|
||
| Neither package is on PyPI yet. Install both from a clone. The distribution is named `agentenv-framework`; the import package is `agent_env` and the command is `agent-env`. The repository is a uv workspace, so one command installs `agentenv-framework` and `agentenv-protocol` as editable packages with their dependencies from PyPI: | ||
| Both packages are on PyPI. The distribution is named `agentenv-framework`; the import package is `agent_env` and the command is `agent-env`. It depends on `agentenv-protocol`, which installs with it: |
There was a problem hiding this comment.
README contradicts itself on PyPI
The install section says both packages are on PyPI, but the Releases section still says neither is on a public index. Readers cannot tell whether pip install agentenv-framework should work. Update the Releases section to match.
Prompt To Fix With AI
This is a comment left during a code review.
Path: README.md
Line: 66
Comment:
**README contradicts itself on PyPI**
The install section says both packages are on PyPI, but the Releases section still says neither is on a public index. Readers cannot tell whether `pip install agentenv-framework` should work. Update the Releases section to match.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| with: | ||
| python-version: "3.12" | ||
| - name: Install uv from public PyPI | ||
| run: python -m pip install --quiet --index-url https://pypi.org/simple uv |
There was a problem hiding this comment.
Release tools can change
Each release installs the latest uv and fetches twine without a version pin. A later tool update could break the checks or upload even when the release code has not changed. Pin both to versions tested with this workflow.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/publish-pypi.yml
Line: 31
Comment:
**Release tools can change**
Each release installs the latest `uv` and fetches `twine` without a version pin. A later tool update could break the checks or upload even when the release code has not changed. Pin both to versions tested with this workflow.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
PyPI refuses `agentenv-protocol`: an unrelated `agent-env-protocol` already exists and normalizes to the same name. The protocol package is now the distribution `agentenv-framework-protocol`. Its import package stays `agentenv_protocol`, and its directory stays `packages/agentenv-protocol`. Everything that names the distribution follows: - agentenv-framework's dependency and the uv workspace source; - the release's exact-pin rewrite and the PyPI workflow, which publishes it from its own `pypi-protocol` environment; - the clean-install gate and the lock check; - the explorer's version lookup (its JSON key is unchanged); - the plugin compatibility and self-install checks, and the A2A install hints; - the docs. The runtime-dependency test now reads an editable install's import packages from its .pth instead of guessing them from the distribution name. BREAKING CHANGE: the protocol distribution is `agentenv-framework-protocol`. Plugins that constrain it should name the new distribution. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
|
||
| # What a plugin may constrain: agent-env, and the protocol package it pins exactly. | ||
| CORE = ("agentenv-framework", "agentenv-protocol") | ||
| CORE = ("agentenv-framework", "agentenv-framework-protocol") |
There was a problem hiding this comment.
Old plugin requirements get skipped
If an existing plugin declares a requirement on agentenv-protocol, the new CORE list does not recognize it. incompatibility() skips the requirement, so the plugin can load even when its declared protocol constraint should stop it. Keep requirements using the former name from silently passing.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agent_env/plugins/_requirements.py
Line: 17
Comment:
**Old plugin requirements get skipped**
If an existing plugin declares a requirement on `agentenv-protocol`, the new `CORE` list does not recognize it. `incompatibility()` skips the requirement, so the plugin can load even when its declared protocol constraint should stop it. Keep requirements using the former name from silently passing.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.The release job's CodeArtifact publish builds the protocol as agentenv-protocol and pins agentenv-framework to that name. That index and its consumers don't change. PyPI gets agentenv-framework-protocol from publish-pypi.yml. The explorer's docs metadata reads the protocol version under either name. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
# Conflicts: # README.md
Each release now also goes to PyPI, and the protocol distribution is renamed so PyPI will accept it.
Why the rename
PyPI refuses
agentenv-protocol: an unrelatedagent-env-protocolalready exists and normalizes to the same name. The protocol package is now the distributionagentenv-framework-protocol.agentenv_protocoland its directory stayspackages/agentenv-protocol, so no code that imports it changes..pth, not from the distribution name.The internal release index
The CircleCI release job still publishes both packages to the internal index, where the protocol keeps its former distribution name. Before building, it renames the protocol package to
agentenv-protocoland pinsagentenv-frameworktoagentenv-protocol==<version>. The consumers and the pin-bump automation read and writeagentenv-protocoland are unchanged. The explorer's docs metadata reads the protocol version under either name.PyPI publishing
.github/workflows/publish-pypi.yml: runs on av*tag, with trusted publishing and no stored token.protocol(environmentpypi-protocol) builds and publishesagentenv-framework-protocol.framework(environmentpypi) buildsagentenv-frameworkpinned to that exact protocol version and publishes it.twine check --strictfirst and skips files already on PyPI, so a rerun is safe.pypiandpypi-protocolexist and accept onlyv*tags.pip install agentenv-framework(the clone stays for development) and uses absolute links and image URLs. The protocol README says how to install it and names its import package.pyproject.toml: the description (the PyPI summary) now says what the package is.PyPI pending publishers:
agentenv-framework(workflowpublish-pypi.yml, environmentpypi) andagentenv-framework-protocol(same workflow, environmentpypi-protocol); ownerscaleapi, repositoryagentenv-framework.Test plan
hellorun twice, every score 1.agentenv_framework_protocol-*/agentenv_framework-*.twine check --strictpasses on all four files.scripts/bump_version.pybumps both versions and both editableuv.lockentries under the new name.circleci config validatepasses.agentenv_protocol-0.1.268and anagentenv-frameworkthat requiresagentenv-protocol==0.1.268.agent-env --versionruns, and the explorer reports both versions.pip install agentenv-frameworkin a clean environment gets the release.🤖 Generated with Claude Code
The PR is not ready to merge while plugins can bypass a declared protocol version requirement.
Fix with agent prompt
Summary
Release tags can now publish both packages to PyPI, with the protocol published before the framework. The protocol’s PyPI distribution is renamed to avoid a name conflict, while its import package stays the same and CircleCI keeps the old name for the internal index.
pip install agentenv-framework.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR T["Release tag"] --> P["Build and publish agentenv-framework-protocol"] P --> F["Build and publish agentenv-framework with exact protocol pin"] T --> I["Internal release build: rename protocol to agentenv-protocol"]Reviews (4) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..."