Fix wheel build: include vendored binaries via artifacts, not force-include#5
Merged
Merged
Conversation
…nclude force-include re-added the whole binaries/ directory on top of the normal package scan, so hatchling aborted with 'a second file is being added ... binaries/.gitignore'. This only surfaces when actually building a wheel, which CI never did (release.yml runs on tags only), so the first release would have failed. List the gitignored binaries as wheel artifacts instead — they are included without duplicating the tracked README/.gitignore in that directory. Verified locally: wheel builds, bundles gomc-rest-linux-amd64, installs, and launch()/connect() work from the installed package. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SQbVkPEprK2ebcjck5ouUy
There was a problem hiding this comment.
Pull request overview
This PR fixes a wheel-packaging failure caused by Hatchling adding the same files twice when [tool.hatch.build.targets.wheel.force-include] re-included the already-scanned src/gomc_rest/binaries/ directory. It switches to using Hatch’s artifacts mechanism so only the vendored, gitignored platform binary is conditionally included in the wheel without duplicating tracked files (e.g., README.md, .gitignore).
Changes:
- Replace
[tool.hatch.build.targets.wheel.force-include]withartifacts = ["src/gomc_rest/binaries/gomc-rest*"]to avoid duplicate wheel paths. - Update the inline comment to document why artifacts are used for gitignored, build-time-vendored binaries.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a latent packaging bug that would have failed every wheel build on the first release.
[tool.hatch.build.targets.wheel.force-include]re-added the entirebinaries/directory on top of hatchling's normal package scan, so building a wheel aborted with:This never surfaced in CI because
release.yml(the only workflow that builds wheels) runs on tags only — it was found by building locally for testing.Fix
Replace
force-includewithartifacts:The vendored binaries are gitignored, so
artifactsis the correct mechanism to ship them; the tracked files in that directory (README, .gitignore) are picked up once by the normal package scan.Verified locally
gomc_rest/binaries/gomc-rest.exe/gomc-rest-linux-amd64).win_amd64andmanylinux_2_34_x86_64wheels; installed the Linux wheel into a fresh venv and confirmedlaunch()starts the bundled v1.4.0 server (health OK, token auth on) andconnect()works.🤖 Generated with Claude Code
Generated by Claude Code