Skip to content

fix(setup): update auditwheel to 6.3.0 and resolve tempdir for InWheel#3063

Open
Copilot wants to merge 4 commits intomainfrom
copilot/update-auditwheel-dependency
Open

fix(setup): update auditwheel to 6.3.0 and resolve tempdir for InWheel#3063
Copilot wants to merge 4 commits intomainfrom
copilot/update-auditwheel-dependency

Conversation

Copy link
Copy Markdown

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'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. Resolving tempfile.tempdir up front so auditwheel's internal tempdir is already a realpath avoids the mismatch.

Changes

  • pyproject.toml: bump auditwheel 6.2.06.3.0
  • setup.py:
    • add from pathlib import Path and import tempfile
    • set tempfile.tempdir = str(Path(tempfile.gettempdir()).resolve()) at module load to fix the macOS symlink mismatch in auditwheel's internal tempdir
    • 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
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
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
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