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
10 changes: 6 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: publish
on:
workflow_dispatch:
inputs:
repository:
repository:
description: 'The repository to upload the package to'
required: true
default: 'testpypi'
Expand All @@ -24,11 +24,13 @@ jobs:
python-version: '3.9'
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1.0.1
# uses: docker/setup-qemu-action@v1.0.1
uses: docker/setup-qemu-action@v1.2.0
with:
platforms: arm64
- name: Build wheels
uses: joerick/cibuildwheel@v1.9.0
# uses: joerick/cibuildwheel@v1.9.0
uses: pypa/cibuildwheel@v2.9.0
with:
output-dir: wheelhouse
env:
Expand All @@ -38,7 +40,7 @@ jobs:
CIBW_ARCHS_MACOS: 'auto arm64'
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: 'pytest -s {project}/tests'
CIBW_TEST_SKIP: '*-macosx_arm64' # Until the day Apple silicon instances are available on GitHub Actions
# CIBW_TEST_SKIP: '*-macosx_arm64' # Until the day Apple silicon instances are available on GitHub Actions
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
Expand Down
13 changes: 6 additions & 7 deletions pip-freeze.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
attrs==21.4.0
attrs==22.1.0
backcall==0.2.0
Cython==0.29.28
Cython==0.29.32
decorator==5.1.1
importlib-metadata==4.8.3
iniconfig==1.1.1
ipdb==0.13.9
ipython==7.16.3
ipython-genutils==0.2.0
jedi==0.17.2
-e git+ssh://git@github.com/escherba/python-metrohash.git@2a85565e5e49b9a36fded0b056d67060ff0e8a7d#egg=metrohash
-e git+https://github.com/escherba/python-metrohash@7df90e93a81300cead306e1b0dcd9ac178abcf44#egg=metrohash
numpy==1.19.5
packaging==21.3
parso==0.7.1
pexpect==4.8.0
pickleshare==0.7.5
pkg_resources==0.0.0
pluggy==1.0.0
prompt-toolkit==3.0.28
prompt-toolkit==3.0.31
ptyprocess==0.7.0
py==1.11.0
py-cpuinfo==8.0.0
Pygments==2.11.2
pyparsing==3.0.7
Pygments==2.13.0
pyparsing==3.0.9
pytest==7.0.1
six==1.16.0
toml==0.10.2
Expand Down
3 changes: 1 addition & 2 deletions python.mk
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ $(EXTENSION_OBJS): $(BUILD_STAMP)
.PHONY: test
test: build ## run Python unit tests
$(PYENV) pytest
$(PYTHON) -m doctest README.md && echo "$(BOLD)doctests passed$(END)"

.PHONY: nuke
nuke: clean ## clean and remove virtual environment
Expand All @@ -76,7 +75,7 @@ clean: ## remove temporary files

.PHONY: install
install: $(BUILD_STAMP) ## install package
$(PIP) install -e --force-reinstall .
$(PIP) install -e .

.PRECIOUS: $(ENV_STAMP)
.PHONY: env
Expand Down
23 changes: 12 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import struct
import os
from os.path import join, dirname
import platform
import struct

from setuptools import setup
from setuptools.dist import Distribution
Expand Down Expand Up @@ -62,19 +62,21 @@ def get_system_bits():
]
)

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

if HAVE_SSE42 and (TARGET_ARCH in [None, "x86_64"]) and (BITS == 64):
if HAVE_SSE42 and (TARGET_ARCH == "x86_64") and (BITS == 64):
print("enabling SSE4.2 on compile")
if SYSTEM == "nt":
CXXFLAGS.append("/D__SSE4_2__")
else:
CXXFLAGS.append("-msse4.2")


if HAVE_AES and (TARGET_ARCH in [None, "x86_64"]) and (BITS == 64):
if HAVE_AES and (TARGET_ARCH == "x86_64") and (BITS == 64):
print("enabling AES on compile")
if SYSTEM == "nt":
CXXFLAGS.append("/D__AES__")
Expand Down Expand Up @@ -104,7 +106,6 @@ def get_system_bits():
CMDCLASS = {}
SRC_EXT = ".cpp"


EXT_MODULES = [
Extension(
"metrohash",
Expand All @@ -116,15 +117,15 @@ def get_system_bits():
),
]

VERSION = "0.3.1"
VERSION = "0.3.2"
URL = "https://github.com/escherba/python-metrohash"


def get_long_description(relpath, encoding="utf-8"):
_long_desc = """

"""
fname = join(dirname(__file__), relpath)
fname = os.path.join(os.path.dirname(__file__), relpath)
try:
with open(fname, "rb") as fh:
return fh.read().decode(encoding)
Expand Down
Loading