Skip to content

Commit

Permalink
Try to parallize the cibuildwheel job.
Browse files Browse the repository at this point in the history
  • Loading branch information
TkTech committed Dec 6, 2021
1 parent 62493b4 commit c5eba9a
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 59 deletions.
88 changes: 47 additions & 41 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
on:
workflow_dispatch:
push:
# Sequence of patterns matched against refs/tags
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Creating release

Expand All @@ -14,37 +13,8 @@ env:
CIBW_ARCHS_MACOS: "x86_64 universal2"

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-10.15]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
name: Setting up Python
with:
python-version: '3.8'

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: Build & test wheels
uses: pypa/cibuildwheel@v2.2.2
env:
CIBW_ARCHS_LINUX: auto aarch64 ppc64le

- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl

# Build & test simple source release before wasting hours building and
# testing the binary build matrix.
sdist:
name: Creating source release
runs-on: ubuntu-latest
Expand Down Expand Up @@ -74,6 +44,42 @@ jobs:
with:
path: dist/*.tar.gz

build_wheels:
needs: [sdist]
name: "[${{ strategy.job-index }}/${{ strategy.job-total }}] py${{ matrix.py }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04, windows-2019, macos-10.15]
# cp - CPython
# pp - PyPy
py: ["cp36", "cp37", "cp38", "cp39", "cp310", "pp37"]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
name: Setting up Python
with:
python-version: '3.8'

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: Build & test wheels
uses: pypa/cibuildwheel@v2.2.2
env:
CIBW_ARCHS_LINUX: auto aarch64 ppc64le
CIBW_BUILD: "${{ matrix.py }}-*"

- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl

upload_all:
needs: [build_wheels, sdist]
name: Uploading built packages to pypi for release.
Expand All @@ -84,10 +90,10 @@ jobs:
name: artifact
path: dist

# - uses: pypa/gh-action-pypi-publish@v1.4.2
# with:
# user: ${{ secrets.PYPI_USERNAME }}
# password: ${{ secrets.PYPI_PASSWORD }}
- uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}

build_documentation:
name: Building & uploading documentation.
Expand All @@ -114,6 +120,6 @@ jobs:
run: |
cd docs && make clean && make html
# - name: Publishing documentation
# run: |
# ghp-import -f -n -c pysimdjson.tkte.ch -p docs/_build/html
- name: Publishing documentation
run: |
ghp-import -f -n -c pysimdjson.tkte.ch -p docs/_build/html
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

## 4.0.3

- Updated upstream simdjson library to 1.0.2.
- Binary wheels are now tested and available for py3.6-py3.10 on x86[_64],
ppc64le and aarch64.
- Under Linux, wheels are built for both manylinux and musl (Alpine).
- Under Linux, wheels are also available for PyPy3.7.
- Minor documentation fixes.
35 changes: 19 additions & 16 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If SIMD instructions are unavailable a fallback parser is used, making
pysimdjson safe to use anywhere.

Bindings are currently tested on OS X, Linux, and Windows for Python version
3.6 to 3.9.
3.6 to 3.10.

Installation
------------
Expand All @@ -39,25 +39,28 @@ with no further requirements:
Binary wheels are available for the following:

+-------------+-------+-------+-------+-------+
| | x86_64 | ARM |
+-------------+-------+-------+-------+-------+
| Interpreter | OS X | Win | Linux | Linux |
+=============+=======+=======+=======+=======+
| CPython 3.6 | Yes | Yes | Yes | Yes |
+-------------+-------+-------+-------+-------+
| CPython 3.7 | Yes | Yes | Yes | Yes |
+-------------+-------+-------+-------+-------+
| CPython 3.8 | Yes | Yes | Yes | Yes |
+-------------+-------+-------+-------+-------+
| CPython 3.9 | Yes | Yes | Yes | Yes |
+-------------+-------+-------+-------+-------+
+--------------+-------+-------+-------+---------+---------+
| | x86_64 | ARM64 | PowerPC |
+--------------+-------+-------+-------+---------+---------+
| Interpreter | OS X | Win | Linux | Linux | Linux |
+==============+=======+=======+=======+=========+=========+
| CPython 3.6 | Yes | Yes | Yes | Yes | Yes |
+--------------+-------+-------+-------+---------+---------+
| CPython 3.7 | Yes | Yes | Yes | Yes | Yes |
+--------------+-------+-------+-------+---------+---------+
| CPython 3.8 | Yes | Yes | Yes | Yes | Yes |
+--------------+-------+-------+-------+---------+---------+
| CPython 3.9 | Yes | Yes | Yes | Yes | Yes |
+--------------+-------+-------+-------+---------+---------+
| CPython 3.10 | Yes | Yes | Yes | Yes | Yes |
+--------------+-------+-------+-------+---------+---------+

When binary wheels are not available, a C++11 (or better) compiler is required
when installing.
when installing in order to build the underlying simdjson library.

If you would prefer to always install pysimdjson from source even when
pre-compiled binaries are available, use:
pre-compiled binaries are available (to take advantage of a newer compiler for
example), use:

.. code::
Expand Down
1 change: 1 addition & 0 deletions docs/performance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ to re-use the parser.
for i in range(0, 100):
doc = parser.parse(b'{"a": "b"}')
del doc
This will drastically reduce the number of allocations being made, as it will
reuse the existing buffer when possible. If it's too small, it'll grow to fit.
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
setup(
name='pysimdjson',
packages=find_packages(),
version='4.0.2',
version='4.0.3',
description='simdjson bindings for python',
long_description=long_description,
long_description_content_type='text/markdown',
Expand All @@ -94,7 +94,7 @@
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
],
python_requires='>3.4',
python_requires='>3.5',
extras_require={
# Dependencies for package release.
'release': [
Expand Down

0 comments on commit c5eba9a

Please sign in to comment.