Mentions légales du service

Skip to content
Snippets Groups Projects
Unverified Commit 04c2afaa authored by Henry Schreiner's avatar Henry Schreiner Committed by GitHub
Browse files

ci: add wheels workflow (#6)

* ci: add wheels workflow

* fix: use classic build system for now

* fix: min CMake is still 3.15
parent 25a8b1fd
No related branches found
No related tags found
No related merge requests found
name: Wheels
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
release:
types:
- published
env:
CIBW_TEST_COMMAND: python {project}/tests/test.py
jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- 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, macos-latest] # Windows wheels currently not supported very well by scikit-build
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: joerick/cibuildwheel@v1.10.0
env:
# Python 2.7 on Windows with workaround not supported by scikit-build
CIBW_SKIP: cp27-win*
- 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: __token__
password: ${{ secrets.pypi_password }}
cmake_minimum_required(VERSION 3.15...3.18)
cmake_minimum_required(VERSION 3.15...3.19)
project(scikit_build_example VERSION "0.0.1")
# Currently, Scikit-build does not support FindPython, so we convert the
# provided hints ourselves.
if(SKBUILD)
set(Python_EXECUTABLE "${PYTHON_EXECUTABLE}")
set(Python_INCLUDE_DIR "${PYTHON_INCLUDE_DIR}")
set(Python_LIBRARY "${PYTHON_LIBRARY}")
set(DUMMY "${PYTHON_VERSION_STRING}") # Not needed, silences a warning
# Scikit-Build does not add your site-packages to the search path automatically,
# so we need to add it _or_ the pybind11 specific directory here.
execute_process(
COMMAND
"${PYTHON_EXECUTABLE}" -c
"import pybind11; print(pybind11.get_cmake_dir())"
OUTPUT_VARIABLE _tmp_dir
OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND_ECHO STDOUT)
list(APPEND CMAKE_PREFIX_PATH "${_tmp_dir}")
endif()
set(Python_FIND_IMPLEMENTATIONS CPython PyPy) # PyPy requires 3.18
find_package(Python REQUIRED COMPONENTS Interpreter Development)
# Scikit-Build does not add your site-packages to the search path automatically,
# so we need to add it _or_ the pybind11 specific directory here.
execute_process(
COMMAND
"${Python_EXECUTABLE}" -c
"import pybind11; print(pybind11.get_cmake_dir())"
OUTPUT_VARIABLE _tmp_dir
OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND_ECHO STDOUT)
list(APPEND CMAKE_PREFIX_PATH "${_tmp_dir}")
# Now we can find pybind11
find_package(pybind11 CONFIG REQUIRED)
......
......@@ -14,13 +14,17 @@ except ImportError:
)
raise
from setuptools import find_packages
setup(
name="scikit_build_example",
version="0.0.1",
description="a minimal example package (with pybind11)",
author="Henry Schreiner",
license="MIT",
packages=["scikit_build_example"],
packages=find_packages(where = 'src'),
package_dir={"": "src"},
cmake_install_dir="src/scikit_build_example",
include_package_data = True,
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment