Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build python wheels via scikit-build-core #1629

Merged
merged 28 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8f9cb39
Build python wheels via scikit-build-core
cary-ilm Feb 4, 2024
6957263
Add custom README.md for pypi.org
cary-ilm Feb 8, 2024
59b24eb
fix typo
cary-ilm Feb 8, 2024
175858b
reference src/wrappers/python/README.md in pyproject.toml
cary-ilm Feb 8, 2024
97ac7ed
Add copyright notice
cary-ilm Feb 8, 2024
165b7cf
Update pyproject.toml
cary-ilm Feb 9, 2024
8b8d982
Update pyproject.toml
cary-ilm Feb 9, 2024
a9ed487
Update src/wrappers/python/CMakeLists.txt
cary-ilm Feb 9, 2024
b58a478
Add uninstall target (#1624)
cary-ilm Feb 9, 2024
2beca72
Add cmake.targets and OPENEXR_INSTALL=OFF
cary-ilm Feb 9, 2024
3fb82a5
INSTALL_TOOLS=OFF
cary-ilm Feb 10, 2024
ca5f7fe
propogate OPENEXR_INSTALL to Imath
cary-ilm Feb 10, 2024
077f814
test1
cary-ilm Feb 10, 2024
51ef980
OPENEXR_INSTALL_PKG_CONFIG
cary-ilm Feb 11, 2024
bbb7330
Fix CVE 2023 5841 (#1627)
kdt3rd Feb 4, 2024
3e5c736
Bazel support: Bump Imath to 3.1.10 (#1626)
Vertexwahn Feb 7, 2024
81df2c7
Document security expectations (#1623)
cary-ilm Feb 8, 2024
0db0df8
Add uninstall target (#1624)
cary-ilm Feb 9, 2024
87495b7
Remove snyk-scan-pr.yml (#1631)
cary-ilm Feb 9, 2024
dc61a07
fix issue with unpacking sample counts (#1630)
kdt3rd Feb 10, 2024
6e03c20
adjust checks for core to better match c++ checks (#1632)
kdt3rd Feb 10, 2024
485d90b
Fix install of symlink (#1633)
cary-ilm Feb 10, 2024
e047a89
adds a shortcut to avoid reconstructing every call (#1634)
kdt3rd Feb 11, 2024
cecb331
check and control reduceMemory and reduceTime in stream mode (#1635)
kdt3rd Feb 11, 2024
a249de4
Update .github/workflows/python-wheels-publish-test.yml
cary-ilm Feb 12, 2024
48e852f
Add sdist
cary-ilm Feb 12, 2024
12650a1
Update .github/workflows/python-wheels-publish-test.yml
cary-ilm Feb 13, 2024
51e9554
fix sdist; remove debugging
cary-ilm Feb 13, 2024
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
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.0
7.0.2
33 changes: 27 additions & 6 deletions .github/workflows/bazel_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4.1.1

- name: Mount Bazel cache
uses: actions/cache@v3
uses: actions/cache@v4.0.0
with:
path: "/home/runner/.cache/bazel"
key: bazel-ubuntu-22
Expand All @@ -66,10 +66,10 @@ jobs:
runs-on: windows-2022

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4.1.1

- name: Mount Bazel cache
uses: actions/cache@v3
uses: actions/cache@v4.0.0
with:
path: "/home/runner/.cache/bazel"
key: bazel-windows-2022
Expand All @@ -87,10 +87,10 @@ jobs:
runs-on: macos-13

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4.1.1

- name: Mount Bazel cache
uses: actions/cache@v3
uses: actions/cache@v4.0.0
with:
path: "/home/runner/.cache/bazel"
key: bazel-macos-13
Expand All @@ -102,3 +102,24 @@ jobs:
# Test without bzlmod
bazelisk build --noenable_bzlmod -- //...
bazelisk test --noenable_bzlmod -- //...

build_and_test_macos_M1:
name: macOS 14 Bazel build <Apple Clang14>
runs-on: macos-14

steps:
- uses: actions/[email protected]

- name: Mount Bazel cache
uses: actions/[email protected]
with:
path: "/home/runner/.cache/bazel"
key: bazel-macos-14

- name: Build
run: |
bazelisk build //...
bazelisk test //...
# Test without bzlmod
bazelisk build --noenable_bzlmod -- //...
bazelisk test --noenable_bzlmod -- //...
8 changes: 3 additions & 5 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ jobs:
run: yum install -y help2man
- name: Configure
run: |
cmake .. \
-DCMAKE_INSTALL_PREFIX=../_install \
cmake -B _build -S . \
-DCMAKE_INSTALL_PREFIX=_install \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
Expand All @@ -249,13 +249,11 @@ jobs:
-DOPENEXR_INSTALL_DOCS='ON' \
-DOPENEXR_RUN_FUZZ_TESTS='OFF' \
-DOPENEXR_ENABLE_THREADING=${{ matrix.threads-enabled }}
working-directory: _build
- name: Build
run: |
cmake --build . \
cmake --build _build \
--target install \
--config ${{ matrix.build-type }}
working-directory: _build
- name: Validate
run: |
share/ci/scripts/linux/validate_openexr_libs.sh _install
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/python-wheels-publish-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.

name: Publish python distribution 📦 to TestPyPI

on:

# Publish python wheels to test.pypi when a release candidate is tagged,
# e.g. v3.4.5-rc, v3.4.5-rc6, etc.

push:
tags:
- v3.[0-9]+.[0-9]+-rc*
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: Python Wheels - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

environment:
name: testpypi
url: https://test.pypi.org/p/openexr

permissions:
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cary-ilm marked this conversation as resolved.
Show resolved Hide resolved

- name: Create sdist
# Only create it once.
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pipx run build --sdist . --outdir wheelhouse

- name: Build wheel
uses: pypa/[email protected]
with:
output-dir: wheelhouse
env:
CIBW_ARCHS_LINUX: x86_64
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
# Skip python 3.6 since scikit-build-core requires 3.7+
# Skip 32-bit wheels builds on Windows
# Also skip the PyPy builds, since they fail the unit tests
CIBW_SKIP: cp36-* *-win32 *_i686 pp*
CIBW_TEST_SKIP: "*-macosx_universal2:arm64"
CIBW_ENVIRONMENT: OPENEXR_RELEASE_CANDIDATE_TAG="${{ github.ref_name }}"

- name: Upload artifact
uses: actions/[email protected]
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
cary-ilm marked this conversation as resolved.
Show resolved Hide resolved

publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/openexr

permissions:
id-token: write

steps:
- name: Download Linux artifacts
uses: actions/[email protected]
with:
name: wheels-ubuntu-latest
path: dist
- name: Download macOS artifacts
uses: actions/[email protected]
with:
name: wheels-macos-latest
path: dist
- name: Download Windows artifacts
uses: actions/[email protected]
with:
name: wheels-windows-latest
path: dist
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
94 changes: 94 additions & 0 deletions .github/workflows/python-wheels-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.

name: Publish python distribution 📦 to PyPI

on:
# Publish wheels to pypi on release
release:
types: [published]
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: Python Wheels - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

environment:
name: pypi
url: https://pypi.org/p/openexr

permissions:
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Create sdist
# Only create it once.
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pipx run build --sdist . --outdir wheelhouse

- name: Build wheel
uses: pypa/[email protected]
with:
output-dir: wheelhouse
env:
CIBW_BUILD: cp312-*
CIBW_ARCHS_LINUX: x86_64
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
# Skip python 3.6 since scikit-build-core requires 3.7+
# Skip 32-bit wheels builds on Windows
# Also skip the PyPy builds, since they fail the unit tests
CIBW_SKIP: cp36-* *-win32 *_i686 pp*
CIBW_TEST_SKIP: "*arm64"

- name: Upload artifact
uses: actions/[email protected]
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl

publish-to-pypi:
name: Publish Python 🐍 distribution 📦 to PyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/openexr

permissions:
id-token: write

steps:
- name: Download Linux artifacts
uses: actions/[email protected]
with:
name: wheels-ubuntu-latest
path: dist
- name: Download macOS artifacts
uses: actions/[email protected]
with:
name: wheels-macos-latest
path: dist
- name: Download Windows artifacts
uses: actions/[email protected]
with:
name: wheels-windows-latest
path: dist
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Loading
Loading