Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .audit/oberstet_modernization-phase-13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- [ ] I did **not** use any AI-assistance tools to help create this pull request.
- [x] I **did** use AI-assistance tools to *help* create this pull request.
- [x] I have read, understood and followed the project's AI_POLICY.md when creating code, documentation etc. for this pull request.

Submitted by: @oberstet
Date: 2025-12-02
Related issue(s): #1790
Branch: oberstet:modernization-phase-1.3
29 changes: 13 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,14 @@ jobs:
source $HOME/.cargo/env
echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: Install ty (Astral type checker)
run: uv tool install ty

- name: Verify toolchain installation
run: |
just --version
uv --version
ty --version

- name: Setup uv cache
uses: actions/cache@v4
Expand All @@ -82,12 +86,10 @@ jobs:
- name: Code formatting / linting (via ruff)
run: just check-format cpy314

# FIXME: Found 239 errors in 45 files (checked 163 source files)
# - name: Code static typing (via mypy)
# run: just check-typing cpy314
- name: Code static typing (via ty)
run: just check-typing cpy314

- name: Code test coverage (Combined Twisted + asyncio) - WITH NVX
continue-on-error: true
run: just check-coverage-combined cpy314 1

- name: Upload coverage report (with-nvx)
Expand All @@ -99,7 +101,6 @@ jobs:
retention-days: 14

- name: Code test coverage (Combined Twisted + asyncio) - WITHOUT NVX
continue-on-error: true
run: just check-coverage-combined cpy314 0

- name: Upload coverage report (without-nvx)
Expand All @@ -111,19 +112,15 @@ jobs:
retention-days: 14

- name: Unit test - Twisted / trial - WITH NVX
continue-on-error: true
run: just test-twisted cpy314 1

- name: Unit test - Twisted / trial - WITHOUT NVX
continue-on-error: true
run: just test-twisted cpy314 0

- name: Unit test - asyncio / pytest - WITH NVX
continue-on-error: true
run: just test-asyncio cpy314 1

- name: Unit test - asyncio / pytest - WITHOUT NVX
continue-on-error: true
run: just test-asyncio cpy314 0

test-serdes:
Expand Down Expand Up @@ -472,7 +469,7 @@ jobs:
- name: Store original generated files checksum
run: |
echo "==> Computing checksums of committed FlatBuffers files..."
find autobahn/wamp/gen/ -name "*.py" -o -name "*.bfbs" | sort | xargs sha256sum > /tmp/original-checksums.txt
find src/autobahn/wamp/gen/ -name "*.py" -o -name "*.bfbs" | sort | xargs sha256sum > /tmp/original-checksums.txt
echo "Found $(wc -l < /tmp/original-checksums.txt) committed generated files"

- name: Build FlatBuffers binary schema & Python wrappers
Expand All @@ -483,17 +480,17 @@ jobs:
flatc --version
echo "Generated FlatBuffers binary schema & Python wrappers:"
echo "======================================================"
cloc autobahn/wamp/gen/
cloc src/autobahn/wamp/gen/
echo ""
ls -la autobahn/wamp/gen/schema/
ls -la src/autobahn/wamp/gen/schema/
echo ""
openssl sha256 autobahn/wamp/gen/schema/*.bfbs
openssl sha256 src/autobahn/wamp/gen/schema/*.bfbs
echo ""

- name: Verify regenerated files match committed files
run: |
echo "==> Computing checksums of regenerated files..."
find autobahn/wamp/gen/ -name "*.py" -o -name "*.bfbs" | sort | xargs sha256sum > /tmp/regenerated-checksums.txt
find src/autobahn/wamp/gen/ -name "*.py" -o -name "*.bfbs" | sort | xargs sha256sum > /tmp/regenerated-checksums.txt

echo "==> Comparing checksums..."
if diff -u /tmp/original-checksums.txt /tmp/regenerated-checksums.txt; then
Expand All @@ -516,8 +513,8 @@ jobs:
with:
name: flatbuffers-schema-${{ matrix.python-env }}
path: |
autobahn/wamp/gen/
autobahn/wamp/flatbuffers/
src/autobahn/wamp/gen/
src/autobahn/wamp/flatbuffers/
retention-days: 7

build-package:
Expand Down
54 changes: 48 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ distclean:
# 1. Remove top-level directories known to us.
# This is fast for the common cases.
echo "--> Removing venvs, cache, and build/dist directories..."
rm -rf {{UV_CACHE_DIR}} {{VENV_DIR}} build/ dist/ wheelhouse/ .pytest_cache/ .ruff_cache/ .mypy_cache/
rm -rf {{UV_CACHE_DIR}} {{VENV_DIR}} build/ dist/ wheelhouse/ .pytest_cache/ .ruff_cache/ .ty/
rm -rf .wstest docs/_build/

rm -f ./*.so
Expand Down Expand Up @@ -602,8 +602,10 @@ check-format venv="": (install-tools venv)
echo "==> Linting code with ${VENV_NAME}..."
"${VENV_PATH}/bin/ruff" check .

# Run static type checking with mypy
check-typing venv="": (install-tools venv) (install-dev venv)
# Run static type checking with ty (Astral's Rust-based type checker)
# FIXME: Many type errors need to be fixed. For now, we ignore most rules
# to get CI passing. Create follow-up issue to address type errors.
check-typing venv="": (install venv)
#!/usr/bin/env bash
set -e
VENV_NAME="{{ venv }}"
Expand All @@ -613,8 +615,31 @@ check-typing venv="": (install-tools venv) (install-dev venv)
echo "==> Defaulting to venv: '${VENV_NAME}'"
fi
VENV_PATH="{{ VENV_DIR }}/${VENV_NAME}"
echo "==> Running static type checks with ${VENV_NAME}..."
"${VENV_PATH}/bin/mypy" src/autobahn/
echo "==> Running static type checks with ty (using ${VENV_NAME} for type stubs)..."
# Note: Only check src/autobahn/, not src/flatbuffers/ (generated code)
# FIXME: Many ignores needed until type annotations are fixed
ty check \
--python "${VENV_PATH}/bin/python" \
--ignore unresolved-import \
--ignore unresolved-attribute \
--ignore unresolved-reference \
--ignore possibly-missing-attribute \
--ignore possibly-missing-import \
--ignore call-non-callable \
--ignore invalid-assignment \
--ignore invalid-argument-type \
--ignore invalid-return-type \
--ignore invalid-method-override \
--ignore invalid-type-form \
--ignore unsupported-operator \
--ignore too-many-positional-arguments \
--ignore unknown-argument \
--ignore non-subscriptable \
--ignore not-iterable \
--ignore no-matching-overload \
--ignore conflicting-declarations \
--ignore deprecated \
src/autobahn/

# Run coverage for Twisted tests only
check-coverage-twisted venv="" use_nvx="": (install-tools venv) (install-dev venv)
Expand Down Expand Up @@ -1095,8 +1120,25 @@ build venv="": (install-build-tools venv)
VENV_PATH="{{ VENV_DIR }}/${VENV_NAME}"
VENV_PYTHON=$(just --quiet _get-venv-python "${VENV_NAME}")
echo "==> Building wheel package..."
# Set environment variable for NVX acceleration (only affects wheels)

# Build the wheel with NVX acceleration
AUTOBAHN_USE_NVX=1 ${VENV_PYTHON} -m build --wheel

# Convert linux wheels to manylinux format using auditwheel
if [ -x "${VENV_PATH}/bin/auditwheel" ]; then
for wheel in dist/*-linux_*.whl; do
if [ -f "$wheel" ]; then
echo "==> Converting $(basename $wheel) to manylinux format..."
"${VENV_PATH}/bin/auditwheel" show "$wheel"
"${VENV_PATH}/bin/auditwheel" repair "$wheel" -w dist/
# Remove the original linux wheel after successful repair
rm "$wheel"
fi
done
else
echo "WARNING: auditwheel not available, skipping manylinux conversion"
fi

ls -la dist/

# Build source distribution only (no wheels, no NVX flag needed)
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ dev = [
"bumpversion>=0.5.3",
"codecov>=2.0.15",
"humanize>=4.0.0",
"mypy>=0.610; python_version >= '3.4' and platform_python_implementation != 'PyPy'",
# Note: ty (Astral type checker) is installed via `uv tool install ty`
# It's a standalone Rust binary, not a Python package dependency
"myst-parser>=4.0.1",
"passlib",
"pep8-naming>=0.3.3",
Expand Down
Empty file added src/autobahn/py.typed
Empty file.