Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ jobs:
arch:
- 'x86'
- 'x64'
- 'arm64'
exclude:
- py: '3.8'
arch: 'arm64'
runs-on: 'windows-2022'
env:
ZSTD_WARNINGS_AS_ERRORS: '1'
Expand All @@ -112,14 +116,25 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
architecture: ${{ matrix.arch }}
architecture: ${{ matrix.arch == 'arm64' && 'x64' || matrix.arch }}

- uses: actions/checkout@v4

- name: Build Wheel
if: matrix.arch != 'arm64'
run: |
python -m pip wheel -w dist .

- name: Build Wheel
if: matrix.arch == 'arm64'
shell: bash
run: |
python -m pip install cibuildwheel
export CIBW_ARCHS=ARM64
export CIBW_BUILD=cp$(echo ${{ matrix.py }} | tr -d .)-*
export CIBW_BUILD_VERBOSITY=1
cibuildwheel --output-dir dist --arch ARM64

- name: Upload Wheel
uses: actions/upload-artifact@v4
with:
Expand Down
21 changes: 21 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,27 @@
if sys.version_info[0:2] >= (3, 13):
MINIMUM_CFFI_VERSION = "1.17"

ext_suffix = os.environ.get("SETUPTOOLS_EXT_SUFFIX")
if ext_suffix:
import sysconfig
# setuptools._distutils.command.build_ext doesn't use
# SETUPTOOLS_EXT_SUFFIX like setuptools.command.build_ext does.
# Work around the issue so that cross-compilation can work
# properly.
Comment on lines +40 to +43
Copy link
Owner

Choose a reason for hiding this comment

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

Oof.

sysconfig.get_config_vars()["EXT_SUFFIX"] = ext_suffix
try:
# Older versions of python didn't have EXT_SUFFIX, and setuptools
# sets its own value, but since we've already set one, we don't
# want setuptools to overwrite it.
import setuptools._distutils.compat.py39 as py39compat
except ImportError:
try:
import setuptools._distutils.py39compat as py39compat
except ImportError:
pass
if py39compat:
py39compat.add_ext_suffix = lambda vars: None

try:
import cffi

Expand Down
Loading