Skip to content

Commit 8d708b2

Browse files
chore: fix wheel license packaging issues (#1932)
<!-- .github/pull_request_template.md --> ## πŸ“Œ Description setuptools can't properly handle license files under `license/` directory: https://github.com/flashinfer-ai/flashinfer/actions/runs/18483737518/job/52670722434 ``` 400 License-File licenses/LICENSE.cutlass.txt does not exist in distribution file flashinfer_python-0.4.1-py3-none-any.whl at flashinfer_python-0.4.1.dist-info/licenses/licenses/LICENSE.cutlass.txt INFO <html> <head> <title>400 License-File licenses/LICENSE.cutlass.txt does not exist in distribution file flashinfer_python-0.4.1-py3-none-any.whl at flashinfer_python-0.4.1.dist-info/licenses/licenses/LICENSE.cutlass.txt </title> </head> <body> <h1>400 License-File licenses/LICENSE.cutlass.txt does not exist in distribution file flashinfer_python-0.4.1-py3-none-any.whl at flashinfer_python-0.4.1.dist-info/licenses/licenses/LICENSE.cutlass.txt </h1> The server could not comply with the request since it is either malformed or otherwise incorrect.<br/><br/> License-File licenses/LICENSE.cutlass.txt does not exist in distribution file flashinfer_python-0.4.1-py3-none-any.whl at flashinfer_python-0.4.1.dist-info/licenses/licenses/LICENSE.cutlass.txt </body> </html> ERROR HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/ License-File licenses/LICENSE.cutlass.txt does not exist in distribution file flashinfer_python-0.4.1-py3-none-any.whl at flashinfer_python-0.4.1.dist-info/licenses/licenses/LICENSE.cutlass.txt ``` This PR fixes the issue by first copying license files to root. Note: we didn't run into this issue because we only upload sdist instead of wheel to pypi. ## πŸ” Related Issues <!-- Link any related issues here --> ## πŸš€ Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete. ### βœ… Pre-commit Checks - [x] I have installed `pre-commit` by running `pip install pre-commit` (or used your preferred method). - [x] I have installed the hooks with `pre-commit install`. - [x] I have run the hooks manually with `pre-commit run --all-files` and fixed any reported issues. > If you are unsure about how to set up `pre-commit`, see [the pre-commit documentation](https://pre-commit.com/). ## πŸ§ͺ Tests - [x] Tests have been added or updated as needed. - [ ] All tests are passing (`unittest`, etc.). ## Reviewer Notes <!-- Optional: anything you'd like reviewers to focus on, concerns, etc. --> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent b01715b commit 8d708b2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

β€Žbuild_backend.pyβ€Ž

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ def _prepare_for_wheel():
115115
shutil.rmtree(_data_dir)
116116
_create_data_dir(use_symlinks=False)
117117

118+
# Copy license files from licenses/ to root to avoid nested path in wheel
119+
licenses_dir = _root / "licenses"
120+
if licenses_dir.exists():
121+
for license_file in licenses_dir.glob("*.txt"):
122+
shutil.copy2(
123+
license_file,
124+
_root / f"LICENSE.{license_file.stem.removeprefix('LICENSE.')}.txt",
125+
)
126+
118127

119128
def _prepare_for_editable():
120129
# For editable install, use symlinks so changes are reflected immediately

β€Žpyproject.tomlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ license = "Apache-2.0"
2121
readme = "README.md"
2222
urls = { Homepage = "https://github.com/flashinfer-ai/flashinfer" }
2323
dynamic = ["dependencies", "version"]
24-
license-files = ["LICENSE", "licenses/*"]
24+
license-files = ["LICENSE", "LICENSE*.txt"]
2525

2626
[project.scripts]
2727
flashinfer = "flashinfer.__main__:cli"

0 commit comments

Comments
Β (0)