Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correctly propagate LICENSE to baml-py #695

Merged
merged 3 commits into from
Jun 20, 2024
Merged

Conversation

sxlijin
Copy link
Collaborator

@sxlijin sxlijin commented Jun 19, 2024

Users who pip install baml-py are currently confronted with an error about LICENSE not being reflected in the wheel's RECORD file. Looks like maturin doesn't play nice with license.workspace = true in a monorepo.

Warning: Validation of the RECORD file of
baml_py-0.40.0-cp38-abi3-macosx_11_0_arm64.whl failed. Please report to
the maintainers of that package so they can fix their build process.
Details:
In
/Users/sam/baml/engine/target/wheels/baml_py-0.40.0-cp38-abi3-macosx_11_0_arm64.whl,
baml_py-0.40.0.dist-info/license_files/LICENSE is not mentioned in
RECORD

Verified using this command:

poetry remove baml-py; poetry run maturin build --manifest-path
~/baml/engine/language_client_python/Cargo.toml && poetry add
~/baml/engine/target/wheels/baml_py-0.40.0-cp38-abi3-macosx_11_0_arm64.whl

Fix, I suspect, was some combination of using license instead of license-file in Cargo.toml and not referencing the Cargo workspace. Also see the maturin docs:
https://www.maturin.rs/metadata#add-spdx-license-expressions

Fixes #690

Also filed PyO3/maturin#2116 for the upstream issue

Users who `pip install baml-py` are currently confronted with an error
about LICENSE not being reflected in the wheel's RECORD file. Looks like
maturin doesn't play nice with `license.workspace = true` in a monorepo.

```
Warning: Validation of the RECORD file of
baml_py-0.40.0-cp38-abi3-macosx_11_0_arm64.whl failed. Please report to
the maintainers of that package so they can fix their build process.
Details:
In
/Users/sam/baml/engine/target/wheels/baml_py-0.40.0-cp38-abi3-macosx_11_0_arm64.whl,
baml_py-0.40.0.dist-info/license_files/LICENSE is not mentioned in
RECORD
```

Verified using this command:

```
poetry remove baml-py; poetry run maturin build --manifest-path
~/baml/engine/language_client_python/Cargo.toml && poetry add
~/baml/engine/target/wheels/baml_py-0.40.0-cp38-abi3-macosx_11_0_arm64.whl
```

Fix, I suspect, was some combination of using `license` instead of
`license-file` in `Cargo.toml` and not referencing the Cargo workspace.
Also see the maturin docs:
https://www.maturin.rs/metadata#add-spdx-license-expressions
Copy link

vercel bot commented Jun 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
baml ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2024 1:13pm

@sxlijin sxlijin changed the title fix: corrctly propagate LICENSE to baml-py fix: correctly propagate LICENSE to baml-py Jun 19, 2024
@hellovai hellovai merged commit 3fda880 into canary Jun 20, 2024
8 checks passed
@hellovai hellovai deleted the sam/python-license-fix branch June 20, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validation of the RECORD file of baml_py-0.40.0-cp38-abi3-macosx_11_0_arm64.whl failed
2 participants