Skip to content

fix: unbreak Windows wheel build and bump python-datamodel floor#1517

Merged
phenobarbital merged 1 commit into
masterfrom
dev
Jun 19, 2026
Merged

fix: unbreak Windows wheel build and bump python-datamodel floor#1517
phenobarbital merged 1 commit into
masterfrom
dev

Conversation

@phenobarbital

@phenobarbital phenobarbital commented Jun 19, 2026

Copy link
Copy Markdown
Owner

The CIBW_TEST_COMMAND added recently made cibuildwheel pip-install the built wheel (with all deps) in a test venv on Windows, which pulled in uvloop transitively via python-datamodel and failed: uvloop has no Windows support.

Verify the compiled Cython extension by inspecting the wheel archive directly instead of installing it, so dependencies are never resolved just to run the check. Bump the python-datamodel floor to >=0.10.21, the release that marks uvloop as non-Windows-only.

Summary by Sourcery

Ensure built wheels contain the compiled Cython extension without installing them and update a core dependency version floor.

Bug Fixes:

  • Avoid Windows wheel build failures by verifying the compiled Cython extension directly from wheel files instead of installing them via cibuildwheel test commands.

Enhancements:

  • Add a release workflow step that inspects produced wheel archives to confirm the asyncdb Cython extension is present before uploading artifacts.

Build:

  • Increase the python-datamodel dependency minimum version to 0.10.21 to align with updated platform support.

The CIBW_TEST_COMMAND added recently made cibuildwheel pip-install the
built wheel (with all deps) in a test venv on Windows, which pulled in
uvloop transitively via python-datamodel and failed: uvloop has no
Windows support.

Verify the compiled Cython extension by inspecting the wheel archive
directly instead of installing it, so dependencies are never resolved
just to run the check. Bump the python-datamodel floor to >=0.10.21,
the release that marks uvloop as non-Windows-only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adjusts the release workflow to verify that built wheels contain the compiled Cython extension by inspecting wheel archives directly instead of installing them via cibuildwheel, and raises the python-datamodel minimum version to one that no longer pulls in uvloop on Windows.

Flow diagram for wheel build and Cython extension verification in release workflow

flowchart TD
    gha[GitHubActions release workflow] --> cbw[cibuildwheel build wheels]
    cbw --> dist_dir[dist directory with .whl files]
    dist_dir --> verify[Verify compiled Cython extension in wheels]
    verify --> loop{each wheel in dist/*.whl}
    loop --> inspect[zipfile.ZipFile.namelist]
    inspect --> check{asyncdb/utils/types.*.so or .pyd present?}
    check -- yes --> ok[print OK and continue]
    check -- no --> fail[assertion failure, build fails]
Loading

File-Level Changes

Change Details Files
Replace cibuildwheel CIBW_TEST_COMMAND-based runtime check with a post-build wheel-archive inspection step to ensure the Cython extension is present without installing dependencies.
  • Remove the CIBW_TEST_COMMAND environment variable configuration from the release workflow job.
  • Add a dedicated GitHub Actions step that runs a Python script to scan all built wheels in dist/ and assert that asyncdb/utils/types.*.so or .pyd exists in each wheel.
  • Ensure the new verification step fails the workflow if no wheels are produced or if any wheel is missing the compiled extension, while printing a concise success message per wheel.
.github/workflows/release.yml
Bump the minimum supported python-datamodel version to avoid uvloop being pulled in as a hard dependency on Windows.
  • Update the python-datamodel dependency constraint to require version >=0.10.21 in the project dependencies list.
pyproject.toml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@phenobarbital phenobarbital merged commit ff67202 into master Jun 19, 2026
1 of 2 checks passed
@phenobarbital phenobarbital deleted the dev branch June 19, 2026 18:28

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • In the wheel verification step, consider using a context manager for zipfile.ZipFile (e.g., with zipfile.ZipFile(whl) as zf:) to ensure files are properly closed and avoid potential resource warnings in longer runs.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the wheel verification step, consider using a context manager for `zipfile.ZipFile` (e.g., `with zipfile.ZipFile(whl) as zf:`) to ensure files are properly closed and avoid potential resource warnings in longer runs.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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