Skip to content

Modernization phase 1.4#2145

Merged
oberstet merged 43 commits intocrossbario:masterfrom
oberstet:modernization-phase-1.4
Dec 18, 2025
Merged

Modernization phase 1.4#2145
oberstet merged 43 commits intocrossbario:masterfrom
oberstet:modernization-phase-1.4

Conversation

@oberstet
Copy link
Contributor

@oberstet oberstet commented Dec 5, 2025

fixes #2144

…io#159)

- Add Phase 1.4: Build Backend Migration (setuptools → hatchling)
- Mark phases 0.1, 0.2, 1.1, 1.2.3, 1.2.4, 1.3 as complete
- Update pyproject.toml template to use hatchling
- Add hatchling build backend row to Modernization Matrix
- Document rationale for hatchling migration (git-aware sdist, PyPA standard)
- Add Phase 1.4.1 (pure Python) and Phase 1.4.2 (CFFI extensions) sub-phases

Note: This work was completed with AI assistance (Claude Code).
- Update pyproject.toml to use hatchling as build backend
- Add tool.hatch.metadata.allow-direct-references for dev-latest deps
- Configure wheel/sdist build targets for proper package structure
- Remove MANIFEST.in (now handled by hatchling)

Part of Phase 1.4 CI/CD Modernization across WAMP Python projects.

Note: This work was completed with AI assistance (Claude Code).
Align with the latest WAMP ecosystem releases using hatchling.

Note: This work was completed with AI assistance (Claude Code).
- Add docs/_graphics/ directory with source SVG files
- Add _build-images just recipe to optimize SVGs using scour
- Add scour>=0.38 to dev dependencies
- Update docs recipe to depend on _build-images
- Add comment in conf.py about logo generation

This brings crossbar in line with the other WAMP Python projects
(txaio, autobahn-python, zlmdb, cfxdb) which use the same pattern
for documentation logo management.

Note: This work was completed with AI assistance (Claude Code).
- Modernize conf.py with Furo theme and Noto fonts from Google Fonts
- Add Crossbar.io logo (crossbar_icon.svg)
- Standardize extensions, project metadata, and spelling configuration
- Preserve JustLexer for code highlighting
- Add docs-spelling just recipe for spell checking

Note: This work was completed with AI assistance (Claude Code).
Add missing install-docs recipe required by docs-spelling and
_build-images recipes.

Note: This work was completed with AI assistance (Claude Code).
- Add [docs] optional dependency group to pyproject.toml
- Add AutoAPI configuration to docs/conf.py
- Exclude test directories from autoapi to avoid syntax error files

Note: This work was completed with AI assistance (Claude Code).
- Replace docs/ai symlink with directory containing individual symlinks
- Create docs/ai/index.rst to collect AI-related docs in toctree
- Add ai/index to docs/index.rst toctree

This organizes AI policy documentation under a dedicated section while
maintaining proper separation from the .ai submodule.

Note: This work was completed with AI assistance (Claude Code).
- Update .ai submodule to include OVERVIEW.md with wamp-xbr section
- Add OVERVIEW.md symlink to project root (via just setup-repo)
- Add docs/OVERVIEW.md symlink for Sphinx documentation
- Add OVERVIEW.md to docs toctree

OVERVIEW.md provides context about the WAMP project ecosystem.

Note: This work was completed with AI assistance (Claude Code).
- Add optimize-images recipe with SVG optimization and favicon generation
- Update conf.py with Crossbar.io Bright Yellow (#ffff00) brand colors
- Add html_favicon setting for browser tab icon
- Add pygments_dark_style for dark mode code highlighting
- Update docs recipe to depend on optimize-images

Part of docs consistency effort across WAMP Python projects.

Note: This work was completed with AI assistance (Claude Code).
- Add docs/autoapi/ to .gitignore, fix .build to .build/ and docs/_build to docs/_build/
- Standardize AutoAPI config to match txaio pattern:
  - autoapi_add_toctree_entry = True
  - autoapi_keep_files = False
  - autoapi_generate_api_docs = True
  - autoapi_member_order = "alphabetical"
  - Consistent autoapi_options and autoapi_ignore patterns

Note: This work was completed with AI assistance (Claude Code).
- Add private-members and special-members to autoapi_options
- Update page title to "WAMP Router for Distributed & Decentralized Microservices"

Note: This work was completed with AI assistance (Claude Code).
Note: This work was completed with AI assistance (Claude Code).
- Convert README.rst to README.md using pandoc
- Reference AI_ACKNOWLEDGEMENT.md in docs/ai/index.rst toctree

Note: This work was completed with AI assistance (Claude Code).
- Add overview.rst, releases.rst, contributing.rst
- Add programming-guide/index.rst consolidating programming docs
- Add administration-guide/index.rst consolidating admin docs
- Update index.rst with standardized ToC order

Note: This work was completed with AI assistance (Claude Code).
Update readme field from README.rst to README.md after the previous
conversion.

Note: This work was completed with AI assistance (Claude Code).
- Add YAML-formatted SPDX license metadata header to LICENSE
- Include CAA contribution policy references
- Add copyright/trademark footer to docs/index.rst
- EUPL-1.2 license year based on first git commit (2013)

Note: This work was completed with AI assistance (Claude Code).
- Update CONTRIBUTING.md with modern contribution guidelines (keep CAA section)
- Add .readthedocs.yaml for consistent RTD builds with docs dependency
- Update docs/contributing.rst to include CONTRIBUTING.md via MyST parser

Note: This work was completed with AI assistance (Claude Code).
- Rename 'Overview' page to 'Introduction'
- Rename 'Releases' page to 'Release Notes'
- Standardize page titles (e.g., 'Getting Started' not 'Getting started with Crossbar.io')
- Move 'Basic Concepts' into Administration Guide as first entry
- Remove FAQ page (content is redundant with contextual docs)

Note: This work was completed with AI assistance (Claude Code).
- Update .cicd submodule to include sphinx_auto_section_anchors extension
- Add extension to docs/conf.py with path to .cicd/scripts
- Add version links (GitHub/PyPI/RTD) to releases.rst
- Add Release Workflow documentation section for maintainers
- Add prepare-changelog, draft-release, prepare-release justfile recipes

Note: This work was completed with AI assistance (Claude Code).
This ensures the sphinx_auto_section_anchors extension overwrites
auto-generated ids (id1, id2, etc.) with slug-based anchors like
crossbario#25-12-1 instead of #id3.

Note: This work was completed with AI assistance (Claude Code).
- Add Step 4: Disable Git Hooks (if needed)
- Add Step 6: Enable Git Hooks (if previously disabled)
- Renumber remaining steps accordingly

Note: This work was completed with AI assistance (Claude Code).
- Add 6 core badges: PyPI, Python, CI, Docs (RTD), License, Downloads
- Apply consistent badge format to both README.md and docs/index.rst
- Use RTD native badge for documentation status

Note: This work was completed with AI assistance (Claude Code).
Pull in wamp-cicd commit 08c9305 which removes unused variable
in sphinx_auto_section_anchors.py (F841 linting error).

Note: This work was completed with AI assistance (Claude Code).
- Add explanatory comment for override_image_directive=False setting
  explaining it's required for RST badge :target: option support
- Update sphinx>=8.2.3 in docs optional dependency (highest version
  compatible with furo's sphinx<9.0 constraint)

Note: This work was completed with AI assistance (Claude Code).
- Add submodules config for .cicd submodule (sphinx_auto_section_anchors.py)
- Add explicit tag_name to release-production GitHub Release step
  (fixes "GitHub Releases requires a tag" error in workflow_run context)

Note: This work was completed with AI assistance (Claude Code).
Use explicit submodule list instead of 'include: all':
- .ai for AI/audit docs
- .cicd for sphinx_auto_section_anchors extension

Note: This work was completed with AI assistance (Claude Code).
- Add xbr>=25.12.1 to dependencies (now published on PyPI)
- Bump autobahn to >=25.12.2
- Bump zlmdb to >=25.12.2
- Bump cfxdb to >=25.12.2
- Add xbr to dev-latest optional dependency
- Update .ai submodule to latest (d1647dc)
- Update .cicd submodule to latest (0954ce5)

This resolves the ModuleNotFoundError for 'xbr' in CI tests.

Note: This work was completed with AI assistance (Claude Code).
- zlmdb: 25.12.2 -> 25.12.3 (fixes FlatBuffers reflection imports)
- xbr: 25.12.1 -> 25.12.2 (fixes wheel packaging, yapf Python 3.13+ compat)

All smoke tests pass with these updated dependencies.

Note: This work was completed with AI assistance (Claude Code).
@oberstet
Copy link
Contributor Author

local testing results:

Crossbar v25.12.1 - Test Results Summary

Recipe Status Notes
test-smoke ✅ PASS Basic import tests
test-smoke-cli ✅ PASS CLI commands work
test-smoke-init ✅ PASS crossbar init works
test-smoke-lifecycle ✅ PASS Start/stop cycle works
test-crossbar-version ✅ PASS Version info displays correctly
test-crossbar-legal ✅ PASS License info displays correctly
test-crossbar-keys ✅ PASS Key generation works
test-trial ✅ PASS 315 tests, 91 skips, 3 expected failures
test-pytest ✅ PASS 250 passed, 91 skipped
check-format ✅ PASS Ruff formatting check
check-typing ✅ PASS Type checking (ty)
check-bandit ✅ PASS Security analysis
docs ✅ PASS Sphinx docs build (70 warnings)
build ✅ PASS Wheel build
build-sourcedist ✅ PASS Source distribution
build-verifydist ✅ PASS Checksums generated
verify-wheels ✅ PASS Twine check passed
docs-check ❌ FAIL Warnings treated as errors (expected)

Fixes GitHub CI workflow:
- Changed `just smoke` to `just test-smoke` (correct recipe name)

Aligns intersphinx configuration with WAMP ecosystem dependency chain:
- Added xbr to intersphinx mapping (crossbar depends on xbr)
- Added numpy for consistency with other WAMP projects

Note: This work was completed with AI assistance (Claude Code).
Updates tracking tables to reflect actual completion status:
- All 5 dependency packages migrated to hatchling and released to PyPI
- Phase 1.4 tracking table updated with PR/release info
- Modernization Matrix updated (Build System section all complete)
- crossbar ready for release after CI passes

Note: This work was completed with AI assistance (Claude Code).
The functional tests were using `exe = 'crossbar'` which relies on PATH
resolution. On GitHub Actions runners with Ubuntu, this picks up
/snap/bin/crossbar instead of the venv's crossbar, causing tests to fail.

Fixed by:
- start_crossbar(): Use virtualenv parameter to find crossbar binary
- start_cfx(): Derive venv bin dir from sys.executable

Note: This work was completed with AI assistance (Claude Code).
The previous fix incorrectly used the virtualenv fixture path for the
crossbar executable. That fixture creates a temp venv for component
isolation (when --no-install is not used), but the crossbar CLI is in
the venv running pytest (sys.executable's directory).

Both start_crossbar() and start_cfx() now derive the crossbar path from
sys.executable, avoiding both:
1. The snap /snap/bin/crossbar interference on Ubuntu
2. Missing crossbar in the temp virtualenv fixture

Note: This work was completed with AI assistance (Claude Code).
The -W flag treats warnings as errors. With 290+ warnings from
cross-package type references (autobahn.wamp.interfaces.ISession etc.)
that can't be resolved via intersphinx, this causes CI to fail.

The docs build still works correctly and produces valid HTML.
Warnings are still shown but don't fail the build.

Note: This work was completed with AI assistance (Claude Code).
Use shared wamp-cicd actions for consistency across WAMP projects:

- main.yml: Replace actions/upload-artifact@v4 with
  wamp-proto/wamp-cicd/actions/upload-artifact-verified@main
  (adds cryptographic chain-of-custody verification)

- release.yml: Replace inline validation scripts with
  wamp-proto/wamp-cicd/actions/check-release-fileset@main
  (validates wheel targets, source dist, handles metadata)

This aligns crossbar with autobahn-python, zlmdb, cfxdb, and wamp-xbr
which all use these shared actions for artifact handling and release
validation.

Note: This work was completed with AI assistance (Claude Code).
- Add missing `dist` recipe to justfile (builds wheel + sdist)
  This fixes the CI failure: "Justfile does not contain recipe `dist`"

- Expand test matrix to match pyproject.toml classifiers:
  - Add Python 3.13, 3.14, PyPy 3.11
  - Use explicit venv-name mapping for clarity
  - Add fail-fast: false to run all matrix jobs

- Update CodeQL from v3 to v4 (v3 deprecated Dec 2026)

Note: This work was completed with AI assistance (Claude Code).
Adds expanded smoke tests to Unit Tests job:
- test-smoke-cli: Test CLI commands
- test-smoke-init: Test project initialization
- test-smoke-lifecycle: Test start/stop cycle

Adds new Integration Tests job:
- test-integration-ab-examples: Run Autobahn examples with crossbar
- Matrix testing across CPython 3.11-3.14 and PyPy 3.11
- Clones autobahn-python for examples directory

Updates MODERNIZATION.md:
- Added CI/CD Test Recipe Alignment Analysis appendix
- Documents test recipe usage across all 6 WAMP projects
- Tracks recommendations and implementation status

Note: This work was completed with AI assistance (Claude Code).
Generated with `uv lock --python 3.11` to ensure compatibility with
the lowest supported Python version.

The lock file includes all dependency extras (dev, docs, dev-latest)
with markers, so `uv sync` installs only runtime deps, while
`uv sync --extra dev` installs dev tools as well.

Note: This work was completed with AI assistance (Claude Code).
Adds justfile recipes:
- update-uvlock: Update uv.lock with latest resolved deps (Python 3.11+)
- analyze-uvlock: Display dependency statistics and installation modes

Adds docs/uvlock.rst documentation page:
- Explains why crossbar uses uv.lock (application vs library)
- Documents uv sync installation modes with markers
- Shows how to update and analyze uv.lock
- Includes Docker production build example

Note: This work was completed with AI assistance (Claude Code).
Updated analyze-uvlock recipe to use `uv export --frozen` to count
actual packages for each installation mode:
- uv sync: 153 runtime packages
- uv sync --extra dev: 247 packages
- uv sync --extra docs: 186 packages
- uv sync --extra dev-latest: 153 packages
- uv sync --all-extras: 257 packages

Updated docs/uvlock.rst example output to match.

Note: This work was completed with AI assistance (Claude Code).
GitHub Actions doesn't allow checkout paths outside the workspace.
Changed from `../autobahn-python` to `./autobahn-python` and pass
the path explicitly to the test recipe.

Note: This work was completed with AI assistance (Claude Code).
@oberstet oberstet merged commit ab618a1 into crossbario:master Dec 18, 2025
18 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.

Phase 1.4: Packaging Tool Modernization

1 participant