From 02068681a667113eb66a98e10706e08e8c827d1d Mon Sep 17 00:00:00 2001 From: Erik LaBianca Date: Wed, 11 Nov 2026 17:02:44 -0500 Subject: [PATCH 1/2] Fix sdist wheel build: flat license-files, ship schema inputs in the sdist maturin 1.9.6 does not create parent directories when writing nested license-files into dist-info, so building a wheel from the sdist failed at metadata generation (licenses/crates/weft-python/LICENSE.md). Reference the root license files instead (root THIRD-PARTY-LICENSES.txt links to the generated crate copy). The sdist also lacked the contract schemas and fixtures that weft-core includes at compile time; add them. PR CI now builds a wheel from the sdist. Co-Authored-By: Claude Fable 5.2 --- .github/workflows/ci.yml | 18 ++++++++++++++++++ THIRD-PARTY-LICENSES.txt | 1 + pyproject.toml | 4 ++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 120000 THIRD-PARTY-LICENSES.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5acdc9d3..53c6ee02 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,6 +54,24 @@ jobs: run: | pip install maturin==1.9.6 maturin build --locked --profile dev --manifest-path crates/weft-python/Cargo.toml --out dist + - name: Build a wheel from the sdist; it carries the licenses and imports + # The release publishes this sdist, so build a wheel from it in a throwaway + # tree (dev profile, shared target dir, so only the weft crates recompile). + run: | + maturin sdist --out "$RUNNER_TEMP/sdist" + mkdir "$RUNNER_TEMP/sdist-src" + tar -xzf "$RUNNER_TEMP"/sdist/*.tar.gz -C "$RUNNER_TEMP/sdist-src" --strip-components=1 + # The metadata step pip runs first (it failed on nested license-file paths). + (cd "$RUNNER_TEMP/sdist-src" && maturin pep517 write-dist-info \ + --metadata-directory "$RUNNER_TEMP/sdist-meta" --interpreter "$(command -v python)") + (cd "$RUNNER_TEMP/sdist-src" && CARGO_TARGET_DIR="$GITHUB_WORKSPACE/target" \ + maturin build --locked --profile dev --out "$RUNNER_TEMP/sdist-wheel") + python -m venv "$RUNNER_TEMP/sdist-venv" + "$RUNNER_TEMP/sdist-venv/bin/pip" install "$RUNNER_TEMP"/sdist-wheel/*.whl + "$RUNNER_TEMP/sdist-venv/bin/python" -I examples/quickstart.py + for f in LICENSE.md LICENSE-MIT LICENSE-APACHE THIRD-PARTY-LICENSES.txt; do + unzip -l "$RUNNER_TEMP"/sdist-wheel/*.whl | grep -F "dist-info/licenses/$f" + done - name: Install the wheel in a fresh venv and run the installed-wheel checks run: | python -m venv "$RUNNER_TEMP/venv" diff --git a/THIRD-PARTY-LICENSES.txt b/THIRD-PARTY-LICENSES.txt new file mode 120000 index 00000000..c9c54a7e --- /dev/null +++ b/THIRD-PARTY-LICENSES.txt @@ -0,0 +1 @@ +crates/weft-python/THIRD-PARTY-LICENSES.txt \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 90ab57b7..3f1d387c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires=["maturin==1.9.6"] build-backend="maturin" [project] license = "MIT OR Apache-2.0" -license-files = ["crates/weft-python/LICENSE.md", "crates/weft-python/LICENSE-MIT", "crates/weft-python/LICENSE-APACHE", "crates/weft-python/THIRD-PARTY-LICENSES.txt"] +license-files = ["LICENSE.md", "LICENSE-MIT", "LICENSE-APACHE", "THIRD-PARTY-LICENSES.txt"] name="umf-weft" version = "0.4.58" description="Native UMF-powered SQL compiler with explicit backend profiles" @@ -14,6 +14,6 @@ Repository="https://github.com/DocumentDrivenDX/weft" Issues="https://github.com/DocumentDrivenDX/weft/issues" [tool.maturin] manifest-path="crates/weft-python/Cargo.toml" -include=[{path="tests/**/*",format="sdist"},{path="spec/**/*",format="sdist"},{path=".cargo/**/*",format="sdist"},{path="vendor/ahash/**/*",format="sdist"}] +include=[{path="tests/**/*",format="sdist"},{path="spec/**/*",format="sdist"},{path=".cargo/**/*",format="sdist"},{path="vendor/ahash/**/*",format="sdist"},{path="docs/helix/02-design/contracts/**/*",format="sdist"},{path="docs/helix/03-test/fixtures/**/*",format="sdist"}] bindings="pyo3" features=["ashlar-sdk-ordered-page-candidate","raw-postgresql-reads","ashlar-databricks-paths-keys","ashlar-databricks-qualified","truss-postgresql-pg18","current-postgresql-scalar-candidate","current-databricks-scalar-candidate","current-query-refinement-candidate","current-presence-graph-requirements-candidate"] From 703301a9b4811b14f1180144be3bef7464f6461a Mon Sep 17 00:00:00 2001 From: Erik LaBianca Date: Wed, 11 Nov 2026 17:16:33 -0500 Subject: [PATCH 2/2] ci: replace the 8-minute sdist wheel build in PR CI with a cheap metadata and inputs check Co-Authored-By: Claude Fable 5.2 --- .github/workflows/ci.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53c6ee02..c2b95e65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,24 +54,21 @@ jobs: run: | pip install maturin==1.9.6 maturin build --locked --profile dev --manifest-path crates/weft-python/Cargo.toml --out dist - - name: Build a wheel from the sdist; it carries the licenses and imports - # The release publishes this sdist, so build a wheel from it in a throwaway - # tree (dev profile, shared target dir, so only the weft crates recompile). + - name: Sdist metadata and compile inputs + # Cheap guard (the full sdist -> wheel build runs in the nightly features job, + # about 8 minutes cold): pip's metadata step failed on nested license-files, + # and the sdist once lacked the schemas weft-core includes at compile time. run: | maturin sdist --out "$RUNNER_TEMP/sdist" mkdir "$RUNNER_TEMP/sdist-src" tar -xzf "$RUNNER_TEMP"/sdist/*.tar.gz -C "$RUNNER_TEMP/sdist-src" --strip-components=1 - # The metadata step pip runs first (it failed on nested license-file paths). (cd "$RUNNER_TEMP/sdist-src" && maturin pep517 write-dist-info \ --metadata-directory "$RUNNER_TEMP/sdist-meta" --interpreter "$(command -v python)") - (cd "$RUNNER_TEMP/sdist-src" && CARGO_TARGET_DIR="$GITHUB_WORKSPACE/target" \ - maturin build --locked --profile dev --out "$RUNNER_TEMP/sdist-wheel") - python -m venv "$RUNNER_TEMP/sdist-venv" - "$RUNNER_TEMP/sdist-venv/bin/pip" install "$RUNNER_TEMP"/sdist-wheel/*.whl - "$RUNNER_TEMP/sdist-venv/bin/python" -I examples/quickstart.py for f in LICENSE.md LICENSE-MIT LICENSE-APACHE THIRD-PARTY-LICENSES.txt; do - unzip -l "$RUNNER_TEMP"/sdist-wheel/*.whl | grep -F "dist-info/licenses/$f" + test -s "$RUNNER_TEMP"/sdist-meta/*.dist-info/licenses/"$f" done + (cd "$RUNNER_TEMP/sdist-src" && grep -rhoE '\.\./(\.\./)+docs/[A-Za-z0-9._/-]*\.schema\.json' crates/*/src \ + | sed 's#^\(\.\./\)*##' | sort -u | while read -r f; do test -f "$f" || { echo "missing from sdist: $f"; exit 1; }; done) - name: Install the wheel in a fresh venv and run the installed-wheel checks run: | python -m venv "$RUNNER_TEMP/venv"