Skip to content

Commit

Permalink
Build wheels for Apple Silicon macs, drop support for Python 3.6 (#37)
Browse files Browse the repository at this point in the history
This PR upgrades `cibuildwheel` to the latest version to support building macOS arm64 wheels.

The first version of `cibuildwheel` to support Apple Silicon is [2.10.0](https://github.com/pypa/cibuildwheel/releases/tag/v2.10.0), while support for running with Python 3.6 was dropped in [v2.9.0](https://github.com/pypa/cibuildwheel/releases/tag/v2.9.0). Python 3.6 has been [EOL since the end of 2021](https://peps.python.org/pep-0494/), so I opted to remove support for 3.6. Hope that's okay.

Fixes #34 

Bump versions for cibuildwheel, setuptools-golang, and twine.
  • Loading branch information
patricksanders committed May 12, 2023
1 parent 5d3cf1e commit d38c55e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 19 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ jobs:
with:
python-version: '3.7'

- name: Install dependencies
- name: Install Python dependencies
run: |
python -m pip install --upgrade -r development.txt
- name: Install Visual C++ for Python 2.7
- name: Install Windows dependencies
if: runner.os == 'Windows'
run: |
choco install vcpython27 -f -y
choco install golang -f -y
choco install mingw -f -y
pip install --force cibuildwheel==2.3.1
go get -d
- name: Set up QEMU
Expand All @@ -42,7 +42,7 @@ jobs:
- name: Build Linux wheels and sdist
if: runner.os == 'Linux'
env:
CIBW_SKIP: "cp35-* *-win32 *-musllinux_i686 *-musllinux_aarch64 *-musllinux_ppc64le *-musllinux_s390x *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_SKIP: "cp35-* cp36-* *-win32 *-musllinux_i686 *-musllinux_aarch64 *-musllinux_ppc64le *-musllinux_s390x *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_BUILD_VERBOSITY: 1
run: |
python setup.py sdist
Expand All @@ -67,15 +67,16 @@ jobs:
- name: Build macOS wheels
if: runner.os == 'macOS'
env:
CIBW_SKIP: "cp35-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_SKIP: "cp35-* cp36-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS_MACOS: x86_64 arm64
run: |
python3 -m cibuildwheel --output-dir wheelhouse
- name: Build Windows wheels
if: runner.os == 'Windows'
env:
CIBW_SKIP: "cp35-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_SKIP: "cp35-* cp36-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_BUILD_VERBOSITY: 1
run: |
python -m cibuildwheel --output-dir wheelhouse
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

name: Python ${{ matrix.python-version }}
steps:
Expand Down
7 changes: 0 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
FROM python:3.6-slim-buster as py36
RUN apt-get update && apt-get install -y golang make build-essential libffi-dev git
WORKDIR /root
COPY . /root
RUN python setup.py bdist_wheel


FROM python:3.7-slim-buster as py37
RUN apt-get update && apt-get install -y golang make build-essential libffi-dev git
WORKDIR /root
Expand Down
6 changes: 3 additions & 3 deletions development.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
setuptools-golang==2.3.0
setuptools-golang==2.7.0
wheel==0.37.1
cffi==1.14.5
black==20.8b1
isort==5.6.4
twine==3.1.1
twine==4.0.2
pytest==6.2.5
psutil==5.7.3
cibuildwheel==2.3.1
cibuildwheel==2.12.3
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.6",
python_requires=">=3.7",
# I'm not sure what this value is supposed to be
build_golang={"root": "github.com/ColdHeat/pybluemonday"},
ext_modules=[setuptools.Extension("pybluemonday/bluemonday", ["bluemonday.go"])],
setup_requires=["setuptools-golang==2.3.0", "cffi~=1.1"],
setup_requires=["setuptools-golang==2.7.0", "cffi~=1.1"],
install_requires=["cffi~=1.1"],
)

0 comments on commit d38c55e

Please sign in to comment.