From 90a024bcff9e50d97dedb298b390918a4748b136 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 3 Oct 2026 07:11:56 +0000 Subject: [PATCH] build: declare Cython as a build dependency `pip install .` failed with "No module named 'Cython'": setup.py imports Cython to compile selected modules, but pyproject.toml had no [build-system] table, so pip's isolated build environment never had it. pyproject.toml now declares setuptools, wheel, and Cython>=3. CI gains a package job (Python 3.12) that installs the package as a consumer would and imports the installed modules from outside the checkout. middleware.auth and middleware.policy are left out of that check: they still import the nonexistent omnibioai_security_sdk package, the known layout issue described in README.md, which this change does not address. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016nxi4bp7DP1ancERNUUfzj --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ pyproject.toml | 6 ++++++ 2 files changed, 39 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bebac50..21f540b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,3 +43,36 @@ jobs: - name: Test run: pytest -q + + package: + name: Install & import (Python 3.12) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + + # Builds the package (including the Cython extensions declared in + # setup.py) the way a consumer's `pip install` does. + - name: Install package + run: | + python -m pip install --upgrade pip + python -m pip install . + + # Run outside the checkout so modules resolve from site-packages, not + # the repository root. middleware.auth and middleware.policy are left + # out: they import the not-yet-existing omnibioai_security_sdk package + # (see the package layout note in README.md). + - name: Import installed modules + working-directory: ${{ runner.temp }} + run: | + python - <<'PY' + import importlib + for name in ("auth.service", "iam.client", "iam.cache", "policy.client", + "core.config", "core.context", "audit.client", "middleware.s2s"): + module = importlib.import_module(name) + print(f"ok {name}: {module.__file__}") + PY diff --git a/pyproject.toml b/pyproject.toml index a7f63b1..b9a44b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,9 @@ +[build-system] +# setup.py imports Cython to compile selected modules, so it must be +# available in pip's isolated build environment. +requires = ["setuptools>=68", "wheel", "Cython>=3"] +build-backend = "setuptools.build_meta" + [project] name = "omnibioai-security-sdk" version = "0.1.0"