Skip to content

Commit

Permalink
ci: use GHA for alternate archs (#474)
Browse files Browse the repository at this point in the history
* ci: adding ARM build to GHA, dropping Travis

* ci: some fixes

* Update .github/workflows/wheels.yml
  • Loading branch information
henryiii authored Feb 11, 2021
1 parent dbe1f95 commit 6f9c764
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 67 deletions.
59 changes: 46 additions & 13 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ on:
- published

env:
CIBW_ENVIRONMENT: "PIP_ONLY_BINARY=numpy SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}"
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.overrideVersion }}
CIBW_ENVIRONMENT: "PIP_ONLY_BINARY=numpy SETUPTOOLS_SCM_PRETEND_VERSION=${{ github.event.inputs.overrideVersion }}"
CIBW_TEST_EXTRAS: test
CIBW_TEST_COMMAND: "pytest {project}/tests"
CIBW_TEST_SKIP: "pp*macos* pp*win* pp27-* *universal2:arm64"

jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
Expand All @@ -40,6 +43,38 @@ jobs:
with:
path: dist/*.tar.gz

build_arch_wheels:
name: ${{ matrix.python }} on ${{ matrix.arch }}
runs-on: ubuntu-20.04
strategy:
matrix:
python: [36, 37, 38, 39]
arch: [aarch64]
steps:

- uses: actions/checkout@v1
with:
submodules: true

- uses: docker/setup-qemu-action@v1
with:
platforms: all

- uses: joerick/cibuildwheel@v1.9.0
env:
CIBW_BUILD: cp${{ matrix.python }}-*
CIBW_ARCHS: ${{ matrix.arch }}

- name: Verify clean directory
run: git diff --exit-code
shell: bash

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


build_wheels:
name: ${{ matrix.type }} ${{ matrix.arch }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -49,41 +84,43 @@ jobs:
os: [windows-latest, macos-latest]
arch: [auto64]
type: [Standard]
build: ["*"]

include:
- os: ubuntu-latest
type: Standard
arch: auto
build: "cp3* pp*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010
CIBW_MANYLINUX_I686_IMAGE: manylinux2010

- os: ubuntu-latest
type: ManyLinux1
arch: auto
build: "cp{27,35,36,37,38}-*"
CIBW_MANYLINUX_X86_64_IMAGE: skhep/manylinuxgcc-x86_64
CIBW_MANYLINUX_I686_IMAGE: skhep/manylinuxgcc-i686

- os: macos-latest
type: Standard
arch: universal2
build: "*"

- os: windows-latest
type: Standard
arch: auto32
build: "*"

steps:
- uses: actions/checkout@v1
with:
submodules: true

- uses: joerick/cibuildwheel@v1.9.0
env:
CIBW_SKIP: cp27-win* pp27*
CIBW_BUILD: ${{ matrix.build }}
CIBW_SKIP: cp27-win* pp27-win*
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.CIBW_MANYLINUX_I686_IMAGE }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.CIBW_MANYLINUX_X86_64_IMAGE }}
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_TEST_EXTRAS: test
CIBW_TEST_COMMAND: "pytest {project}/tests"
CIBW_TEST_SKIP: "pp*macos* *universal2:arm64"

- name: Verify clean directory
run: git diff --exit-code
Expand Down Expand Up @@ -124,8 +161,6 @@ jobs:
CIBW_BUILD: cp27-win32
DISTUTILS_USE_SDK: 1
MSSdk: 1
CIBW_TEST_EXTRAS: test
CIBW_TEST_COMMAND: "pytest {project}/tests"

- name: Verify clean directory
run: git diff --exit-code
Expand All @@ -137,13 +172,11 @@ jobs:

upload_all:
name: Upload if release
needs: [build_wheels, build_win27_wheels, build_sdist]
needs: [build_wheels, build_win27_wheels, build_arch_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/setup-python@v2

- uses: actions/download-artifact@v2
with:
name: artifact
Expand Down
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# boost-histogram for Python

[![Actions Status][actions-badge]][actions-link]
[![Travis-CI][travis-badge]][travis-link]
[![Documentation Status][rtd-badge]][rtd-link]
[![Code style: black][black-badge]][black-link]

Expand Down Expand Up @@ -162,31 +161,33 @@ The easiest way to get boost-histogram is to use a binary wheel, which happens w
python -m pip install boost-histogram
```

Wheels are produced using [cibuildwheel](https://cibuildwheel.readthedocs.io/en/stable/); all platforms supported by cibuildwheel are provided in boost-histogram:
Wheels are produced using [cibuildwheel](https://cibuildwheel.readthedocs.io/en/stable/); all common platforms have wheels provided in boost-histogram:

| System | Arch | Python versions | PyPy versions |
|---------|-----|------------------|--------------|
| ManyLinux1 (custom GCC 9.2) | 32 & 64-bit | 2.7, 3.5, 3.6, 3.7, 3.8, 3.9 | |
| ManyLinux1 (custom GCC 9.2) | 32 & 64-bit | 2.7, 3.5, 3.6, 3.7, 3.8 | |
| ManyLinux2010 | 32 & 64-bit | 2.7, 3.5, 3.6, 3.7, 3.8, 3.9 | 7.3: 2.7, 3.6, 3.7 |
| ManyLinux2014 | ARM64 & PowerPC | 3.5, 3.6, 3.7, 3.8, 3.9 | |
| ManyLinux2014 | ARM64 | 3.6, 3.7, 3.8, 3.9 | |
| macOS 10.9+ | 64-bit | 2.7, 3.5, 3.6, 3.7, 3.8, 3.9 | 7.3: 2.7, 3.6, 3.7 |
| macOS Universal2 | Arm64 | 3.9 | |
| Windows | 32 & 64-bit | 2.7, 3.5, 3.6, 3.7, 3.8, 3.9 | (32 bit) 7.3: 2.7, 3.6, 3.7 |


* manylinux1: Using a custom docker container with GCC 9; should work but can't be called directly other compiled extensions unless they do the same thing (think that's the main caveat). Supporting 32 bits because it's there.
* manylinux1: Using a custom docker container with GCC 9; should work but can't be called directly other compiled extensions unless they do the same thing (think that's the main caveat). Supporting 32 bits because it's there. Anything running Python 3.9 should be compatible with manylinux2010, so manylinux1 not provided for Python 3.9 (like NumPy).
* manylinux2010: Requires pip 10+ and a version of Linux newer than 2010.
* Windows: pybind11 requires compilation with a newer copy of Visual Studio than Python 2.7's Visual Studio 2008; you need to have the [Visual Studio 2015 distributable][msvc2015] installed (the dll is included in 2017 and 2019, as well).
* PyPy: Supported on all platforms that `cibuildwheel` supports, in pypy2, pypy3.6, and pypy3.7 variants.
* ARM and PowerPC on Linux is supported for newer Python versions via manylinux2014.
* ARM on Linux is supported for newer Python versions via manylinux2014. PowerPC or IBM-Z available on request.
* macOS Universal2 wheels for Apple Silicon and Intel provided for Python 3.9 (requires Pip 21.0.1).

[msvc2015]: https://www.microsoft.com/en-us/download/details.aspx?id=48145

If you are on a Linux system that is not part of the "many" in manylinux, such as Alpine or ClearLinux, building from source is usually fine, since the compilers on those systems are often quite new. It will just take a little longer to install when it's using the sdist instead of a wheel.
If you are on a Linux system that is not part of the "many" in manylinux, such as Alpine or ClearLinux, building from source is usually fine, since the compilers on those systems are often quite new. It will just take longer to install when it is using the sdist instead of a wheel.


#### Conda-Forge

The boost-histogram package is available on Conda-Forge, as well. All supported versions are available with the exception of Python 2.7, which is no longer supported by conda-forge directly. If you really need boost-histogram + Conda + Python 2.7, please open an issue.
The boost-histogram package is available on Conda-Forge, as well. All supported versions are available with the exception of Python 2.7, which is no longer supported by conda-forge directly.

```bash
conda install -c conda-forge boost-histogram
Expand Down Expand Up @@ -278,8 +279,6 @@ Support for this work was provided by the National Science Foundation cooperativ
[rtd-badge]: https://readthedocs.org/projects/boost-histogram/badge/?version=latest
[rtd-link]: https://boost-histogram.readthedocs.io/en/latest/?badge=latest
[sk-badge]: https://scikit-hep.org/assets/images/Scikit--HEP-Project-blue.svg
[travis-badge]: https://travis-ci.com/scikit-hep/boost-histogram.svg?branch=master
[travis-link]: https://travis-ci.com/scikit-hep/boost-histogram

[Boost::Histogram]: https://www.boost.org/doc/libs/release/libs/histogram/doc/html/index.html
[Boost::Histogram source]: https://github.com/boostorg/histogram
Expand Down
1 change: 1 addition & 0 deletions src/boost_histogram/_internal/sig_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def inject_signature(sig, locals=None):
# type: (str, Optional[Dict[str, Any]]) -> Any
def wrap(f):
return f

return wrap


Expand Down

0 comments on commit 6f9c764

Please sign in to comment.