Skip to content

fix(setup): update auditwheel to 6.4.0 for InWheel tempdir fix#3063

Merged
Skn0tt merged 5 commits intomainfrom
copilot/update-auditwheel-dependency
May 6, 2026
Merged

fix(setup): update auditwheel to 6.4.0 for InWheel tempdir fix#3063
Skn0tt merged 5 commits intomainfrom
copilot/update-auditwheel-dependency

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 4, 2026

auditwheel 6.3.0 changed InWheel.__init__ to call .absolute() on its path arguments, requiring pathlib.Path instead of str. This broke the wheel-building step with AttributeError: 'str' object has no attribute 'absolute'.

Additionally, on macOS /var is a symlink to /private/var. auditwheel 6.3.0's InWheel allocates an internal tempfile.TemporaryDirectory for bdist_dir (returning /var/folders/...), but its rewrite_record helper walks files via walk() which calls Path.resolve(strict=True) and yields /private/var/folders/... paths. The mismatch causes path.relative_to(bdist_dir) to raise ValueError. This was fixed upstream in pypa/auditwheel#569 and shipped in auditwheel 6.4.0, so bumping to 6.4.0 lets us avoid any workaround on our side.

Changes

  • pyproject.toml: bump auditwheel 6.2.06.4.0
  • setup.py:
    • add from pathlib import Path
    • wrap InWheel arguments in Path(...):
# before
with InWheel(in_wheel=wheelhouse_whl, out_wheel=whlfile):

# after
with InWheel(in_wheel=Path(wheelhouse_whl), out_wheel=Path(whlfile)):
Original prompt

update the auditwheel dep, you'll have to update some argument in setup.py apparently. make sure you branch off main, not this branch

Chronological Review: 1. User asked to merge open PRs (many dependabot) on microsoft/playwright-python. 2. Triaged 7 dependabot PRs; merged 3 green ones (#3049, #3041, #2994). 3. Posted `@dependabot rebase` then `@dependabot recreate` on remaining 4. 4. After waiting, merged 3 more (#2976, #2975, #2896). Left #2785 (auditwheel) open with real build failure. 5. User asked to fix the auditwheel bit. 6. Inspected setup.py — found InWheel usage at lines 85, 87, 176, 179. 7. User asked: "can we delegate it to the cloud?" — meaning use Copilot coding agent. 8. Agent confirmed yes, viewed setup.py lines 170-190 to gather context for the issue description. 9. Summarization triggered before agent could create the issue and assign to Copilot.

Intent Mapping:

  • "let's get them merged" — merge open dependabot PRs (largely done; 6/7 merged)
  • "please fix the auditwheel bit" — fix build(deps-dev): bump auditwheel from 6.2.0 to 6.4.2 #2785 build failure
  • "can we delegate it to the cloud?" — delegate the fix to Copilot coding agent rather than doing it locally

Technical Inventory:

  • gh CLI for PR review/merge/comment
  • GitHub MCP server for issue creation, job logs
  • microsoft/playwright-python repo, fork at Skn0tt/playwright-python
  • auditwheel 6.3.0 API change: InWheel(in_wheel=...) now requires pathlib.Path, not str. Error: AttributeError: 'str' object has no attribute 'absolute' at auditwheel/wheeltools.py:114.

Code Archaeology:

  • /Users/skn0tt/dev/microsoft/playwright-python/setup.py
    • Line 85: from auditwheel.wheeltools import InWheel
    • Line 87: InWheel = None (fallback)
    • Line 174-180: Loop wrapping wheels with InWheel:
      for whlfile in glob.glob(os.path.join(self.dist_dir, "*.whl")):
          os.makedirs("wheelhouse", exist_ok=True)
          if InWheel:
              wheelhouse_whl = os.path.join("wheelhouse", os.path.basename(whlfile))
              shutil.move(whlfile, wheelhouse_whl)
              with InWheel(in_wheel=wheelhouse_whl, out_wheel=whlfile):
                  print(f"Updating RECORD file of {whlfile}")
  • Fix needed: wrap wheelhouse_whl and whlfile in Path(...) (and add from pathlib import Path if missing).

Progress Assessment:

Recent Commands Analysis:

  • Last command: view on setup.py lines 170-190, returning the InWheel block context.
  • Prior: grep for "auditwheel|in_wheel|InWheel" in setup.py, returned the 4 lines listed above.
  • Pre-summary state: Agent had confirmed delegation to cloud is possible and was gathering context to write the issue body for Copilot.

Context Validation:

1. Conversation Overview: - Primary Objectives: - "there is a bunch of open PRs in this repo, many of them dependabot. let's get them merged." - "please fix the auditwheel bit" - "can we delegate it to the cloud?" (use Copilot coding agent rather than fix locally) - Session Context: Triaged + merged 6 of 7 open dependabot PRs on microsoft/playwright-python. Last remaining PR #2785 (auditwheel 6.2.0→6.3.0) has a real build failure requiring code fix in setup.py. User now wants the fix delegated to Copilot coding agent in the cloud. - User Intent Evolution: Merge sweep → fix the one real failure → delegate that fix to cloud agent.
  1. Technical Foundation:

    • GitHub repo: microsoft/playwright-python (Skn0tt is maintainer; fork at Skn0tt/playwright-python, local clone at /Users/skn0tt/dev/microsoft/playwright-python)
    • gh CLI authenticated as Skn0tt with repo/workflow scopes
    • GitHub MCP server available for issue creation, job logs, etc.
    • auditwheel 6.3.0 API change: InWheel(in_wheel=...) now requires pathlib.Path, not str. Triggers AttributeError: 'str' object has no attribute 'absolute' at auditwheel/wheeltools.py:114 (self.in_wheel = in_wheel.absolute()).
  2. Codebase Status:

    • /Users/skn0tt/dev/microsoft/playwright-python/setup.py:
      • Purpose: Build script that uses auditwheel's InWheel context manager to update RECORD files in built wheels.
      • Current State: Unmodified locally. Needs fix.
      • Key Code Segments:
        • Line 85: from auditwheel.wheeltools import InWheel
        • Line 87: InWheel = None (import fallback)
        • Lines 174-180:
          for whlfile in glob.glob(os.path.join(self.dist_dir, "*.whl")):
              os.makedirs("wheelhouse", exist_ok=True)
              if InWheel:
                  wheelhouse_whl = os.pa...

Created from Copilot CLI via the copilot delegate command.

Copilot AI changed the title [WIP] Update auditwheel dependency and modify setup.py arguments fix(setup): update auditwheel to 6.3.0 and wrap InWheel args in Path May 4, 2026
Copilot finished work on behalf of Skn0tt May 4, 2026 10:29
Copilot AI requested a review from Skn0tt May 4, 2026 10:29
@Skn0tt Skn0tt marked this pull request as ready for review May 4, 2026 10:31
@Skn0tt Skn0tt requested a review from dgozman May 4, 2026 10:31
@Skn0tt
Copy link
Copy Markdown
Member

Skn0tt commented May 5, 2026

@copilot please look at the CI results, there's something going wrong

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 5, 2026

@copilot please look at the CI results, there's something going wrong

Looked into it — after the previous fix the build hit a different auditwheel error on macOS:

ValueError: '/private/var/folders/.../tmpnw3396bn/playwright/__init__.py' is not in the subpath of '/var/folders/.../tmpnw3396bn'

/var is a symlink to /private/var on macOS. Path(...).absolute() (which auditwheel calls internally) doesn't resolve symlinks, but the file paths it walks inside rewrite_record are realpath-resolved, so path.relative_to(bdist_dir) blows up.

Fixed in f223264 by calling .resolve() on both in_wheel and out_wheel so the symlink is resolved up front.

Copilot AI requested a review from Skn0tt May 5, 2026 08:11
Copilot finished work on behalf of Skn0tt May 5, 2026 08:11
@Skn0tt
Copy link
Copy Markdown
Member

Skn0tt commented May 5, 2026

@copilot it's still failing

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 5, 2026

@copilot it's still failing

Found the actual root cause. .resolve() on the wheel paths wasn't sufficient because the failing path inside auditwheel is self.name — auditwheel's own internal tempfile.TemporaryDirectory, allocated from tempfile.gettempdir() which on macOS returns /var/folders/.... Inside rewrite_record it walks files via walk(), which calls topdir.resolve(strict=True) and yields /private/var/folders/... paths, so path.relative_to(bdist_dir) blows up.

Fix in 09b5eaf: set tempfile.tempdir = str(Path(tempfile.gettempdir()).resolve()) at the top of setup.py, so auditwheel's internal tempdir is already a realpath and matches the walked paths. Also reverted the redundant .resolve() on the InWheel args.

Copilot AI changed the title fix(setup): update auditwheel to 6.3.0 and wrap InWheel args in Path fix(setup): update auditwheel to 6.3.0 and resolve tempdir for InWheel May 5, 2026
Copilot finished work on behalf of Skn0tt May 5, 2026 08:28
@Skn0tt
Copy link
Copy Markdown
Member

Skn0tt commented May 6, 2026

@copilot look at the CI results, something is still fishy. what's going on?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 6, 2026

@copilot look at the CI results, something is still fishy. what's going on?

All the Build jobs (wheel building — what this PR actually fixes) are now green across macOS, Windows, and Linux on every Python version 3.9–3.13. The auditwheel 6.3.0 + tempdir fix worked.

The only remaining red check is Test Docker / build (noble, ubuntu-24.04). The failures there are Connection closed while reading from the driver errors — driver pipe issues unrelated to setup.py / wheel building. Looking at recent main: the Docker test job has been flaky for a while (run #796 on the chore: roll to 1.59.1 PR — the same driver version this branch uses — also failed it; #799 only passed because the next push happened to retry cleanly). The ubuntu-24.04-arm variant of the same job passed in this run, which is consistent with flakiness rather than a real regression introduced here.

Nothing further from me on the wheel side — happy to look at the Docker flakes separately if you want, but I don't think they should block this PR.

Copilot finished work on behalf of Skn0tt May 6, 2026 07:46
@Skn0tt
Copy link
Copy Markdown
Member

Skn0tt commented May 6, 2026

@copilot I see. i still find it very weird that you override a global. please investigate pypa/auditwheel#565 to see if there's a simpler way of fixing it

auditwheel 6.4.0 includes pypa/auditwheel#569, which resolves the
InTemporaryDirectory path internally. With that fix upstream we no
longer need to mutate tempfile.tempdir at module load to work around
the macOS /var -> /private/var symlink mismatch.

Agent-Logs-Url: https://github.com/microsoft/playwright-python/sessions/d9049c05-0054-4d3c-a0d1-f6c72264b15e

Co-authored-by: Skn0tt <14912729+Skn0tt@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 6, 2026

@copilot I see. i still find it very weird that you override a global. please investigate pypa/auditwheel#565 to see if there's a simpler way of fixing it

Good call. The upstream fix for that issue is pypa/auditwheel#569, which shipped in auditwheel 6.4.0 ([BUGFIX] Resolve path of InTemporaryDirectory name (#565)). Bumping to 6.4.0 lets us drop the tempfile.tempdir global override entirely.

Done in ce6efc1: bumped auditwheel 6.3.06.4.0 in pyproject.toml and removed the global mutation from setup.py. Kept the Path(...) wrappers on the InWheel(in_wheel=..., out_wheel=...) args since InWheel.__init__ still calls .absolute() on them in 6.4.0.

Copilot AI changed the title fix(setup): update auditwheel to 6.3.0 and resolve tempdir for InWheel fix(setup): update auditwheel to 6.4.0 for InWheel tempdir fix May 6, 2026
Copilot finished work on behalf of Skn0tt May 6, 2026 07:52
@Skn0tt Skn0tt merged commit 873c5c7 into main May 6, 2026
41 of 42 checks passed
@Skn0tt Skn0tt deleted the copilot/update-auditwheel-dependency branch May 6, 2026 08:16
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.

3 participants