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
72 changes: 72 additions & 0 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build wheel

on:
workflow_dispatch:

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [windows-latest, ubuntu-latest, macos-latest, macos-14]
env:
CIBW_SKIP: 'pp*'
CIBW_ARCHS: 'auto64'
CIBW_PROJECT_REQUIRES_PYTHON: '>=3.9'
CIBW_TEST_REQUIRES: 'pytest'
# Appends the project path since build is not done in the project directory
CIBW_TEST_COMMAND: 'pytest {project}/tmp/tests'

defaults:
run:
shell: bash -l {0}

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python version ${{ matrix.version }}
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install OMP (MacOS Intel)
if: matrix.platform == 'macos-latest'
run: |
brew install llvm libomp
echo "export CC=/usr/local/opt/llvm/bin/clang" >> ~/.bashrc
echo "export CFLAGS=\"$CFLAGS -I/usr/local/opt/libomp/include\"" >> ~/.bashrc
echo "export CXXFLAGS=\"$CXXFLAGS -I/usr/local/opt/libomp/include\"" >> ~/.bashrc
echo "export LDFLAGS=\"$LDFLAGS -Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp\"" >> ~/.bashrc
source ~/.bashrc
- name: Install OMP (MacOS M1)
if: matrix.platform == 'macos-14'
run: |
brew install llvm libomp
echo "export CC=/opt/homebrew/opt/llvm/bin/clang" >> ~/.bashrc
echo "export CFLAGS=\"$CFLAGS -I/opt/homebrew/opt/libomp/include\"" >> ~/.bashrc
echo "export CXXFLAGS=\"$CXXFLAGS -I/opt/homebrew/opt/libomp/include\"" >> ~/.bashrc
echo "export LDFLAGS=\"$LDFLAGS -Wl,-rpath,/opt/homebrew/opt/libomp/lib -L/opt/homebrew/opt/libomp/lib -lomp\"" >> ~/.bashrc
source ~/.bashrc
- name: Install OMP (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt install libomp-dev
- name: Build Wheel
run: |
# Hack to ensure installed RAT package is used for test instead
# of local package.
mkdir tmp
cp -r tests tmp/tests/
python -m pip install cibuildwheel==2.16.5
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ runner.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
File renamed without changes.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import platform
import sys
import pybind11
from setuptools import setup, Extension
from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext
from setuptools.command.build_clib import build_clib

Expand Down Expand Up @@ -152,7 +152,7 @@ def build_libraries(self, libraries):
author_email = '',
url = 'https://github.com/RascalSoftware/python-RAT',
description = 'Python extension for the Reflectivity Analysis Toolbox (RAT)',
packages = ['RAT'],
packages = find_packages(),
include_package_data = True,
package_data = {'': [get_shared_object_name(libevent[0])]},
cmdclass = {'build_clib': BuildClib, 'build_ext': BuildExt},
Expand Down