Skip to content

feat: prep archastro-sdk for PyPI — namespace phx_channel + enrich metadata - #6

Merged
calvin-archastro merged 1 commit into
mainfrom
features/calvin-archastro-24-04-2026-get-ready-for-publishing
Apr 24, 2026
Merged

feat: prep archastro-sdk for PyPI — namespace phx_channel + enrich metadata#6
calvin-archastro merged 1 commit into
mainfrom
features/calvin-archastro-24-04-2026-get-ready-for-publishing

Conversation

@calvin-archastro

Copy link
Copy Markdown
Contributor

Summary

  • Move src/phx_channel/src/archastro/phx_channel/ so the distribution publishes a single top-level archastro package on PyPI (no squatting a generic phx_channel module).
  • Enrich pyproject.toml for PyPI: authors, license, classifiers, urls, optional-deps dev, wheel excludes tests.
  • Regenerate channel classes + contract tests from @archastro/sdk-generator@0.1.4, which emits the new namespace natively. Also picks up the latest ArchAstro/archastro-openapi@main spec.

Import changes (public API)

# before
from phx_channel import Socket, HarnessServiceClient
from phx_channel.channel import ChannelError

# after
from archastro.phx_channel import Socket, HarnessServiceClient
from archastro.phx_channel.channel import ChannelError

Logger name also renamed: "phx_channel""archastro.phx_channel".

pyproject.toml

  • license = { file = "LICENSE" } (MIT, added separately to main as fbe4aab)
  • authors, keywords, trove classifiers, [project.urls]
  • [project.optional-dependencies].dev so pip install -e ".[dev]" works without uv
  • [tool.hatch.build.targets.wheel].packages = ["src/archastro"] + exclude = ["**/tests/**"] — tests don't ship to PyPI anymore

Spec drift

The regen also pulled in the current platform spec from main. Besides the namespace rename, you'll see:

  • New: activity_feed + invites resources and their contract tests
  • Removed: types/{chat,members,orgs,reactions,schedules,system}.py (collapsed/renamed upstream)
  • Changed: a lot of existing resource body signatures to match the current spec

I considered splitting these but they're genuinely coupled — the regen script is the mechanism that brings both the namespace change and the spec into the repo.

Test plan

  • uv run pytest tests/test_http_client.py src/archastro/phx_channel/tests/test_unit.py — 45/45
  • uv run pytest tests/harness — 6/6
  • uv run pytest tests/contract (REST) — 670/670
  • ARCHASTRO_RUN_CHANNEL_CONTRACT_TESTS=1 uv run pytest tests/contract/channels — 51/51
  • uv run ruff check && uv run ruff format --check — clean
  • uv build — produces archastro_sdk-0.1.0-py3-none-any.whl with archastro/ + archastro/phx_channel/, LICENSE in dist-info/licenses/, no test files

Follow-ups (not in this PR)

  • Dry-run publish to TestPyPI before shipping 0.1.0 to prod.

🤖 Generated with Claude Code

…tadata

Single top-level package on PyPI: everything installs under `archastro`.
The hand-written Phoenix Channels client moves from `src/phx_channel/`
to `src/archastro/phx_channel/` so the distribution doesn't squat a
generic top-level name. All imports updated:

  from phx_channel import ...         → from archastro.phx_channel import ...
  from phx_channel.socket import ...  → from archastro.phx_channel.socket import ...

Channel files + contract tests regenerated from @archastro/sdk-generator
0.1.4, which emits the new namespace natively. Spec also pulled to
current ArchAstro/archastro-openapi@main (adds activity_feed + invites
resources; collapses chat/members/orgs/reactions/schedules/system types).

pyproject.toml enriched for PyPI:
  - authors, license = { file = "LICENSE" }, classifiers, project.urls
  - [project.optional-dependencies].dev mirrors [dependency-groups].dev
    so `pip install -e ".[dev]"` works without uv
  - [tool.hatch.build.targets.wheel] excludes **/tests/** so unit tests
    don't ship to PyPI
  - wheel packages: ["src/archastro"] only (phx_channel now nested)

Logger names upgraded to `archastro.phx_channel`. CI workflow path
and README updated to match the new layout.

Test coverage: 45 unit + 6 harness + 670 REST contract + 51 channel
contract = 772 passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@calvin-archastro
calvin-archastro merged commit e14326e into main Apr 24, 2026
2 checks passed
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.

1 participant