Skip to content

Commit

Permalink
Merge pull request #42 from oberbichler/feature/cibuildwheel
Browse files Browse the repository at this point in the history
Use cibuildwheel
  • Loading branch information
oberbichler authored Jul 17, 2021
2 parents df91a8c + 37d4858 commit 374d91b
Show file tree
Hide file tree
Showing 227 changed files with 218 additions and 48,793 deletions.
100 changes: 0 additions & 100 deletions .github/workflows/publish.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/test-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true

- name: Create Build Environment
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand Down
108 changes: 108 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Wheels

on:
workflow_dispatch:
pull_request:
push:
branches:
- master
release:
types:
- published

env:
CIBW_TEST_COMMAND: pytest {project}/tests
CIBW_TEST_EXTRAS: test
HYPERJET_VERSION: ${{ github.event.release.tag_name }}


jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Patch version
run: |
import os
with open('setup.py', 'r') as f:
content = f.read()
version = os.getenv('HYPERJET_VERSION', 'v0.0.0')[1:]
print(version)
content = content.replace('0.0.0', version)
with open('setup.py', 'w') as f:
f.write(content)
shell: python

- name: Build SDist
run: pipx run build --sdist

- name: Check metadata
run: pipx run twine check dist/*

- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz


build_wheels:
name: Wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

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

- name: Patch version
run: |
import os
with open('setup.py', 'r') as f:
content = f.read()
content = content.replace('0.0.0', os.getenv('HYPERJET_VERSION', '0.0.0'))
with open('setup.py', 'w') as f:
f.write(content)
shell: python

- uses: pypa/cibuildwheel@v2.0.0
env:
CIBW_ARCHS_MACOS: x86_64
CIBW_SKIP: pp*-macosx*
CIBW_TEST_EXTRAS: test
CIBW_TEST_COMMAND: pytest {project}/tests

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

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


upload_all:
name: Upload if release
needs: [build_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
path: dist

- uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "pybind11"]
path = pybind11
url = https://github.com/pybind/pybind11
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ endif()
if (${BUILD_PYTHON_MODULE})
include_directories("external_libraries")

add_subdirectory(external_libraries/pybind11)
add_subdirectory(pybind11)

pybind11_add_module(python_module src/python_module.cpp)

Expand Down
37 changes: 0 additions & 37 deletions external_libraries/pybind11/.appveyor.yml

This file was deleted.

13 changes: 0 additions & 13 deletions external_libraries/pybind11/.clang-tidy

This file was deleted.

73 changes: 0 additions & 73 deletions external_libraries/pybind11/.cmake-format.yaml

This file was deleted.

Loading

0 comments on commit 374d91b

Please sign in to comment.