Skip to content

Commit 7973d2c

Browse files
authored
build updates (#71)
- allow building on aarch64 - add python-3.11 wheel builds - upgrade action versions in build workflow
1 parent 29b2cb6 commit 7973d2c

8 files changed

Lines changed: 270 additions & 64 deletions

File tree

.github/workflows/publish.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,17 @@ jobs:
2424
python-version: '3.9'
2525
- name: Set up QEMU
2626
if: runner.os == 'Linux'
27-
uses: docker/setup-qemu-action@v1.0.1
27+
# uses: docker/setup-qemu-action@v1.0.1
28+
uses: docker/setup-qemu-action@v1.2.0
2829
with:
2930
platforms: arm64
3031
- name: Build wheels
31-
uses: joerick/cibuildwheel@v1.9.0
32+
# uses: joerick/cibuildwheel@v1.9.0
33+
uses: pypa/cibuildwheel@v2.9.0
3234
with:
3335
output-dir: wheelhouse
3436
env:
35-
CIBW_BUILD: '{cp36,cp37,cp38,cp39,cp310}-{manylinux_x86_64,manylinux_aarch64,win32,win_amd64,macosx_x86_64} {cp39,cp310}-macosx_arm64'
37+
CIBW_BUILD: '{cp36,cp37,cp38,cp39,cp310,cp311}-{manylinux_x86_64,manylinux_aarch64,win32,win_amd64,macosx_x86_64} {cp39,cp310,cp311}-macosx_arm64'
3638
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
3739
CIBW_ARCHS_LINUX: 'auto aarch64'
3840
CIBW_ARCHS_MACOS: 'auto arm64'

pip-freeze.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
attrs==21.4.0
1+
attrs==22.1.0
22
backcall==0.2.0
3-
Cython==0.29.28
3+
Cython==0.29.32
44
decorator==5.1.1
55
importlib-metadata==4.8.3
66
iniconfig==1.1.1
@@ -13,14 +13,13 @@ packaging==21.3
1313
parso==0.7.1
1414
pexpect==4.8.0
1515
pickleshare==0.7.5
16-
pkg_resources==0.0.0
1716
pluggy==1.0.0
18-
prompt-toolkit==3.0.28
17+
prompt-toolkit==3.0.31
1918
ptyprocess==0.7.0
2019
py==1.11.0
2120
py-cpuinfo==8.0.0
22-
Pygments==2.11.2
23-
pyparsing==3.0.7
21+
Pygments==2.13.0
22+
pyparsing==3.0.9
2423
pytest==7.0.1
2524
six==1.16.0
2625
toml==0.10.2

python.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ $(EXTENSION_OBJS): $(BUILD_STAMP)
5757
.PHONY: test
5858
test: build ## run Python unit tests
5959
$(PYENV) pytest
60-
$(PYTHON) -m doctest README.md && echo "$(BOLD)doctests passed$(END)"
6160

6261
.PHONY: nuke
6362
nuke: clean ## clean and remove virtual environment
@@ -76,7 +75,7 @@ clean: ## remove temporary files
7675

7776
.PHONY: install
7877
install: $(BUILD_STAMP) ## install package
79-
$(PIP) install -e --force-reinstall .
78+
$(PIP) install -e .
8079

8180
.PRECIOUS: $(ENV_STAMP)
8281
.PHONY: env

setup.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
import struct
43
import os
5-
from os.path import join, dirname
4+
import platform
5+
import struct
66

77
from setuptools import setup
88
from setuptools.dist import Distribution
@@ -62,26 +62,27 @@ def get_system_bits():
6262
]
6363
)
6464

65-
# The "cibuildwheel" tool sets the variable below to
66-
# something like x86_64, aarch64, i686, and so on.
67-
TARGET_ARCH = os.environ.get("AUDITWHEEL_ARCH")
65+
# The "cibuildwheel" tool sets AUDITWHEEL_ARCH variable to architecture strings
66+
# such as 'x86_64', 'aarch64', 'i686', etc. If this variable is not set, we
67+
# assume that the build is not a CI build and target current machine
68+
# architecture.
69+
TARGET_ARCH = os.environ.get("AUDITWHEEL_ARCH", platform.machine())
70+
print("building for target architecture:", TARGET_ARCH)
6871

69-
if HAVE_SSE42 and (TARGET_ARCH in [None, "x86_64"]) and (BITS == 64):
72+
if HAVE_SSE42 and (TARGET_ARCH == "x86_64") and (BITS == 64):
7073
print("enabling SSE4.2 on compile")
7174
if SYSTEM == "nt":
7275
CXXFLAGS.append("/D__SSE4_2__")
7376
else:
7477
CXXFLAGS.append("-msse4.2")
7578

76-
77-
if HAVE_AES and (TARGET_ARCH in [None, "x86_64"]) and (BITS == 64):
79+
if HAVE_AES and (TARGET_ARCH == "x86_64") and (BITS == 64):
7880
print("enabling AES on compile")
7981
if SYSTEM == "nt":
8082
CXXFLAGS.append("/D__AES__")
8183
else:
8284
CXXFLAGS.append("-maes")
8385

84-
8586
if USE_CYTHON:
8687
print("building extension using Cython")
8788
CMDCLASS = {"build_ext": build_ext}
@@ -91,7 +92,6 @@ def get_system_bits():
9192
CMDCLASS = {}
9293
SRC_EXT = ".cpp"
9394

94-
9595
EXT_MODULES = [
9696
Extension(
9797
"cityhash",
@@ -111,7 +111,7 @@ def get_system_bits():
111111
),
112112
]
113113

114-
if HAVE_SSE42 and (TARGET_ARCH in [None, "x86_64"]) and (BITS == 64):
114+
if HAVE_SSE42 and (TARGET_ARCH == "x86_64") and (BITS == 64):
115115
EXT_MODULES.append(
116116
Extension(
117117
"cityhashcrc",
@@ -127,15 +127,15 @@ def get_system_bits():
127127
)
128128

129129

130-
VERSION = "0.4.1"
130+
VERSION = "0.4.2"
131131
URL = "https://github.com/escherba/python-cityhash"
132132

133133

134134
def get_long_description(relpath, encoding="utf-8"):
135135
_long_desc = """
136136
137137
"""
138-
fname = join(dirname(__file__), relpath)
138+
fname = os.path.join(os.path.dirname(__file__), relpath)
139139
try:
140140
with open(fname, "rb") as fh:
141141
return fh.read().decode(encoding)

0 commit comments

Comments
 (0)