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
Fix arm wheels on macOS #4017
Fix arm wheels on macOS #4017
Changes from all commits
69c8910
3380098
b7cb820
fcc91fe
75bd6e7
757430b
33073bf
bdf4105
e7f14d7
7650f6e
05eb557
5f3e84d
f6a3033
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,8 @@ exclude = ["/profiling"] | |
[tool.hatch.build.targets.wheel] | ||
only-include = ["src"] | ||
sources = ["src"] | ||
# Note that we change the behaviour of this flag below | ||
macos-max-compat = true | ||
|
||
[tool.hatch.build.targets.wheel.hooks.mypyc] | ||
enable-by-default = false | ||
|
@@ -175,9 +177,18 @@ before-build = [ | |
HATCH_BUILD_HOOKS_ENABLE = "1" | ||
MYPYC_OPT_LEVEL = "3" | ||
MYPYC_DEBUG_LEVEL = "0" | ||
AIOHTTP_NO_EXTENSIONS = "1" | ||
|
||
# Black needs Clang to compile successfully on Linux. | ||
CC = "clang" | ||
AIOHTTP_NO_EXTENSIONS = "1" | ||
|
||
[tool.cibuildwheel.macos] | ||
build-frontend = { name = "build", args = ["--no-isolation"] } | ||
# Unfortunately, hatch doesn't respect MACOSX_DEPLOYMENT_TARGET | ||
before-build = [ | ||
"python -m pip install 'hatchling==1.18.0' hatch-vcs hatch-fancy-pypi-readme 'hatch-mypyc>=0.16.0' 'mypy==1.5.1' 'click==8.1.3'", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll have to remember to update this pin when we upgrade mypy. Also, any specific reason we need to pin click and not our other dependencies here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We pinned click because 8.1.4 and 8.1.5 broke mypyc builds. I copied all the pins here from elsewhere in this file, with the exception of hatchling because we patch it |
||
"""sed -i '' -e "600,700s/'10_16'/os.environ['MACOSX_DEPLOYMENT_TARGET'].replace('.', '_')/" $(python -c 'import hatchling.builders.wheel as h; print(h.__file__)') """, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the actual logic for this is https://github.com/pypa/wheel/blob/main/src/wheel/macosx_libfile.py#L392 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ofek I think the thing to upstream would be this monkeypatch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should have a way to set the sdk version in the tag to something based on
|
||
] | ||
|
||
[tool.isort] | ||
atomic = true | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this change anything? I'd expect it to work the same as before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No change, I was just messing with this logic to give me macOS wheel builds I could test (linked above)