Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build mypyc wheels for CPython 3.11 #3276

Merged
merged 1 commit into from Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pypi_upload.yml
Expand Up @@ -58,7 +58,7 @@ jobs:
- uses: actions/checkout@v3

- name: Build wheels via cibuildwheel
uses: pypa/cibuildwheel@v2.8.1
uses: pypa/cibuildwheel@v2.10.0
env:
CIBW_ARCHS_MACOS: "${{ matrix.macos_arch }}"
# This isn't supported in pyproject.toml which makes sense (but is annoying).
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.md
Expand Up @@ -25,6 +25,8 @@

<!-- Changes to how Black is packaged, such as dependency requirements -->

- Faster compiled wheels are now available for CPython 3.11 (#3276)

### Parser

<!-- Changes to the parser or to version autodetection -->
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Expand Up @@ -55,6 +55,9 @@ MYPYC_DEBUG_LEVEL = "0"
# The dependencies required to build wheels with mypyc aren't specified in
# [build-system].requires so we'll have to manage the build environment ourselves.
PIP_NO_BUILD_ISOLATION = "no"
# CPython 3.11 wheels aren't available for aiohttp and building a Cython extension
# from source also doesn't work.
AIOHTTP_NO_EXTENSIONS = "1"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we remove setting the env var from my action now so we only have 1 place with the tech debt ?

Copy link
Collaborator Author

@ichard26 ichard26 Sep 18, 2022

Choose a reason for hiding this comment

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

Well the CIWB environment variables are independent from the envvars your 3.11 tox session sets. Not sure how you'd consolidate them. I have not configured cibuildwheel to use tox as part of the wheel test phase because it'd be fairly involved.


[tool.cibuildwheel.linux]
before-build = [
Expand All @@ -69,6 +72,7 @@ MYPYC_DEBUG_LEVEL = "0"
PIP_NO_BUILD_ISOLATION = "no"
# Black needs Clang to compile successfully on Linux.
CC = "clang"
AIOHTTP_NO_EXTENSIONS = "1"

[tool.cibuildwheel.windows]
# For some reason, (compiled) mypyc is failing to start up with "ImportError: DLL load
Expand Down
3 changes: 2 additions & 1 deletion src/black/files.py
Expand Up @@ -26,7 +26,8 @@
import tomllib
except ImportError:
# Help users on older alphas
import tomli as tomllib
if not TYPE_CHECKING:
import tomli as tomllib
else:
import tomli as tomllib

Expand Down