Skip to content

fix: set executable permission on CLI binary in Python wheel#419

Merged
SteveSandersonMS merged 2 commits intomainfrom
stevesa/python-uv-fix
Feb 10, 2026
Merged

fix: set executable permission on CLI binary in Python wheel#419
SteveSandersonMS merged 2 commits intomainfrom
stevesa/python-uv-fix

Conversation

@SteveSandersonMS
Copy link
Contributor

Problem

When installing the Python SDK via pip/uv, the bundled CLI binary at copilot/bin/copilot is installed without the Unix executable bit, requiring users to manually chmod it.

Root Cause

setuptools strips the executable bit when packaging data files. The repack step in build-wheels.mjs then captures this 0o644 permission into the wheel ZIP.

Fix

After extracting the wheel for repack, restore chmod 0o755 on the CLI binary so zf.write() captures the correct permissions.

The repack step in build-wheels.mjs was producing wheels where
copilot/bin/copilot had 0o644 (-rw-r--r--) permissions because
setuptools strips the executable bit when building package data.

After extracting the wheel for repack, restore chmod 0o755 on the
CLI binary so that zf.write() captures the correct permissions.
This ensures pip/uv install the binary as executable on Unix.
@SteveSandersonMS SteveSandersonMS requested a review from a team as a code owner February 10, 2026 12:16
Copilot AI review requested due to automatic review settings February 10, 2026 12:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the Python SDK wheel repackaging step so the bundled Copilot CLI binary is installed with correct Unix executable permissions, avoiding post-install manual chmod.

Changes:

  • During wheel repack, re-apply 0o755 to the extracted copilot/bin/copilot (and copilot.exe) before re-zipping so the wheel captures executable mode bits correctly.
  • Add the necessary import to support the new permission-restoration logic in the embedded repack script.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@SteveSandersonMS SteveSandersonMS merged commit 4dc5629 into main Feb 10, 2026
14 of 15 checks passed
@SteveSandersonMS SteveSandersonMS deleted the stevesa/python-uv-fix branch February 10, 2026 12:32
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.

1 participant