Skip to content

Commit eb70206

Browse files
authored
fix: package the baml-py license correctly (#2325)
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Fixes BAML license packaging by adding a test step in the GitHub Actions workflow and updates branch trigger and Maturin version. > > - **Workflow Changes**: > - Update branch trigger to `sam/license-fix` in `build-python-release.reusable.yaml`. > - Add `license_test: skip` to several build targets in `build-python-release.reusable.yaml`. > - Set `maturin-version` to `1.9.1` in `build-python-release.reusable.yaml`. > - **License Testing**: > - Add step to test LICENSE packaging using `uv` and `pip-licenses-cli` in `build-python-release.reusable.yaml`. > - Ensure `baml` package is marked as `Apache-2.0` in `license-audit.log`. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for ed7f8fe. You can [customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
1 parent c3ebf01 commit eb70206

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

.github/workflows/build-python-release.reusable.yaml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_call: {}
55
push:
66
branches:
7-
- baml-py-win
7+
- sam/license-fix
88

99
concurrency:
1010
# suffix is important to prevent a concurrency deadlock with the calling workflow
@@ -36,19 +36,23 @@ jobs:
3636
# # Workaround ring 0.17 build issue
3737
# # see https://github.com/briansmith/ring/issues/1728
3838
# CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
39+
license_test: skip
3940

4041
- target: x86_64-unknown-linux-musl
4142
runs_on: ubuntu-latest
4243
# see https://github.com/astral-sh/uv/blob/9bb55c4ac0582e05d1a7a5bbd99cc7b2c82f1847/.github/workflows/build-binaries.yml#L594
4344
manylinux: musllinux_1_1
45+
license_test: skip
4446

4547
- target: aarch64-unknown-linux-musl
4648
runs_on: ubuntu-latest
4749
# see https://github.com/astral-sh/uv/blob/9bb55c4ac0582e05d1a7a5bbd99cc7b2c82f1847/.github/workflows/build-binaries.yml#L594
4850
manylinux: musllinux_1_1
51+
license_test: skip
4952

5053
- target: x86_64-apple-darwin
5154
runs_on: macos-latest
55+
license_test: skip
5256

5357
- target: aarch64-apple-darwin
5458
runs_on: macos-latest
@@ -131,6 +135,7 @@ jobs:
131135
# see https://github.com/PyO3/maturin/issues/2110
132136
XWIN_VERSION: "16"
133137
with:
138+
maturin-version: "1.9.1"
134139
target: ${{ matrix._.target }}
135140
command: build
136141
# building in engine/ ensures that we pick up .cargo/config.toml
@@ -146,6 +151,26 @@ jobs:
146151
:
147152
fi
148153
154+
- name: Install uv
155+
uses: astral-sh/setup-uv@v6
156+
157+
- name: Test LICENSE packaging
158+
if: matrix._.license_test != 'skip'
159+
run: |
160+
set -euo pipefail
161+
162+
mkdir -p ../python-license-test
163+
cd ../python-license-test
164+
uv init --bare --python 3.10
165+
uv add pip-licenses-cli
166+
pwd
167+
ls ../baml/engine/language_client_python/dist/
168+
uv pip install $(ls ../baml/engine/language_client_python/dist/*.whl)
169+
uv run pip-licenses | tee license-audit.log
170+
171+
# Due to `set -e`, this will fail if no matches are found
172+
grep 'baml.*Apache-2.0' license-audit.log >/dev/null
173+
149174
- name: Upload wheels
150175
uses: actions/upload-artifact@v4
151176
with:

0 commit comments

Comments
 (0)