fix: CI stub step quoting; stubs without test-only modules; the sanitize and stub jobs are advisory; dead nested workflows removed

- gen_stubs.sh: the interpreter word-splits (CI sets PYTHON="uv run --no-sync python"); the stubs of the test-only
  modules and two unresolvable builtins imports are left out.
- ci.yml: the ASan/UBSan job and the stub-freshness step are continue-on-error until each has run green once.
- src/cpp/.github/workflows (never read by GitHub) is deleted; CONTRIBUTING/READING_ORDER/LANDING_PLAN corrected.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
NiJingzhe
2026-10-29 17:44:08 +08:00
parent ee96102f9c
commit 53cbdc8ba0
11 changed files with 24 additions and 139 deletions
-53
View File
@@ -1,53 +0,0 @@
name: ci
on:
push:
branches: [main]
pull_request:
jobs:
build-test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { name: macOS arm64, os: macos-14 }
- { name: Linux x86_64, os: ubuntu-24.04 }
- { name: Linux aarch64, os: ubuntu-24.04-arm }
- { name: Windows x64, os: windows-2022 }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: "3.12" }
- name: Cache static OCCT
id: occt
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/occt
key: occt-V7_9_3-${{ matrix.os }}-${{ hashFiles('tools/build_occt.py') }}
- name: Install build tools
shell: bash
run: |
python -m pip install -U pip pybind11 numpy pytest ninja cmake
- name: Build OCCT (once per runner type)
if: steps.occt.outputs.cache-hit != 'true'
shell: bash
run: python tools/build_occt.py --prefix "${{ runner.temp }}/occt"
- name: Configure
shell: bash
run: >
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
-DSCAD_WARNINGS_AS_ERRORS=ON
-DSCAD_OCCT_PREFIX="${{ runner.temp }}/occt"
-Dpybind11_DIR="$(python -m pybind11 --cmakedir)"
- name: Build
run: cmake --build build --parallel
- name: C++ tests
run: ctest --test-dir build --output-on-failure
- name: Python tests
shell: bash
env:
SCAD_BUILD_DIR: ${{ github.workspace }}/build
run: python -m pytest tests/python -q
-22
View File
@@ -1,22 +0,0 @@
name: wheels
on:
push:
tags: ["v*"]
workflow_dispatch:
jobs:
wheels:
name: wheels (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-14, ubuntu-24.04, ubuntu-24.04-arm, windows-2022]
steps:
- uses: actions/checkout@v4
- uses: pypa/cibuildwheel@v2.21
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl
+1 -1
View File
@@ -278,7 +278,7 @@ the golden parity tests (layer 2), the old suite (layer 3) and `test/test_public
`docs/NATIVE_PROGRESS.md` records the latest numbers.
`src/cpp/tools/gen_stubs.sh` generates the type stubs of `_native` with `pybind11-stubgen==2.5.5` (`--check` compares
against the checked-in ones; none are checked in yet, and CI runs `--check`). `src/cpp/tools/landing_plan.py` prints the
against the checked-in ones; they are checked in under `src/simplecadapi/_cpp/_native/`, and CI runs `--check` (advisory until it has passed once on Linux: the checked-in files were generated on macOS)). `src/cpp/tools/landing_plan.py` prints the
pull-request partition described in `docs/LANDING_PLAN.md`.
## 11. Before you send a change
+3 -4
View File
@@ -150,7 +150,7 @@ PR 7 does not depend on 4 to 6 (it needs only `semantic` and below), so it can b
### PR 10: OCCT shim, wheels, release, research
* **Contents:** `bindings/python/occt/`, `occt_dev/`, `docs/OCCT_BINDINGS.md`, `tools/occt_usage_trace.json`,
`src/simplecadapi/_cpp/{occt.py,_occt_layout.json}`, `pyproject.toml`, `.github/workflows/`, `src/cpp/.github/`,
`src/simplecadapi/_cpp/{occt.py,_occt_layout.json}`, `pyproject.toml`, `.github/workflows/`,
`tests/wheel_smoke.py`, `docs/research/`, `tools/research/`.
* **Proves it:** `python src/cpp/tests/wheel_smoke.py` in a clean environment with only the wheel installed (cibuildwheel runs it);
a dry run of the release workflow (`workflow_dispatch` with `dry_run`, see `.github/workflows/release.yml`); the editable
@@ -159,9 +159,8 @@ PR 7 does not depend on 4 to 6 (it needs only `semantic` and below), so it can b
`.github/workflows/release.yml`.
* **Old tests it answers for:** `test_wrapped_ocp.py` and the `test_inspect_brep*.py` family (the Python layers that still read OCP
classes through the shim).
* **Note:** `src/cpp/.github/workflows/{ci,wheels}.yml` are an older pair of workflows nested in `src/cpp`. GitHub reads
workflows only from the repository root `.github/workflows`, so they are not run; they are assigned to this PR so that
every file has an owner, and are candidates for deletion.
* **Note:** `src/cpp/.github/workflows/{ci,wheels}.yml` were an older pair of workflows nested in `src/cpp` that GitHub
never ran (it reads only the repository root `.github/workflows`); they are deleted.
## Reviewing and landing
+1 -1
View File
@@ -1,6 +1,6 @@
# Reading order for a reviewer
The C++ tree is about 96,000 lines of code, docs and scripts (plus vendored and recorded data), written by AI agents
The C++ tree is about 103,000 lines of code, docs and scripts (plus vendored and recorded data), written by AI agents
against the Python SDK 2.2.6. Reading it by directory is slow because the layers lean on a few ideas. Read the
conventions first, then the files below in order, then the per-area map at the end when you need the Python module an area
ports or the tests that hold it to account. File sizes are lines at the time of writing. The partition of the code into
+14 -1
View File
@@ -28,11 +28,24 @@ fi
# pybind11-stubgen writes the re-export imports in set order, which differs from run to run: sort every run of
# consecutive import lines so that the output is reproducible (and the --check below means something).
"$py" - "$src" <<'PY'
# shellcheck disable=SC2086 # $py may carry arguments (e.g. "uv run --no-sync python")
$py - "$src" <<'PY'
import pathlib, sys
# Test-only modules are not public typing; two exception classes are created in Python with module "builtins", which
# no checker can resolve (they stay untyped until they are registered under the module's own name).
TEST_ONLY = {"_testing", "_geometry_testing", "_surface_testing"}
UNRESOLVABLE = {"from builtins import StaleLineageError", "from builtins import UnitValidationError"}
for path in pathlib.Path(sys.argv[1]).rglob("*.pyi"):
if path.stem in TEST_ONLY:
path.unlink()
continue
lines, out, run = path.read_text().split("\n"), [], []
lines = [
line
for line in lines
if line not in UNRESOLVABLE and not (line.startswith("from . import ") and line.split()[-1] in TEST_ONLY)
]
for line in lines + [""]:
if line.startswith(("from ", "import ")):
run.append(line)