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

Scikit-build-core build system rework #1971

Closed
wants to merge 61 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
678f50d
Initial rework into scikit-build-core
dudoslav May 17, 2024
7c20a47
Add auto downloading of TileDB
dudoslav May 20, 2024
6f8c182
Add TILEDB_PATH env variable
dudoslav May 20, 2024
b5d8bce
Remove debug project name
dudoslav May 20, 2024
bc166f7
Add testing build-wheels ci
dudoslav May 20, 2024
f3ec205
Add cxx_standard to 20
dudoslav May 20, 2024
51723fd
Fix incorrect flag set
dudoslav May 20, 2024
cff8080
Enable CI/CD tests
dudoslav May 20, 2024
042f320
Fix pytest command
dudoslav May 20, 2024
5fa6f72
Run tests in tests folder
dudoslav May 21, 2024
76da30d
Clean up code
dudoslav May 21, 2024
210a75e
Remove __init__.py for tests
dudoslav May 21, 2024
f73dcb8
Add test requirements
dudoslav May 21, 2024
a456a6d
Remove libtiledb logic
dudoslav May 21, 2024
cac2204
Disable python 39
dudoslav May 21, 2024
4e145ba
Improve pyproject.toml
dudoslav May 21, 2024
0b429c4
Rework basic CI workflow
dudoslav May 21, 2024
8ed0840
Install testing dependencies in CI
dudoslav May 21, 2024
7156bdc
Remove unused CI/CD files
dudoslav May 24, 2024
982d1e5
Merge remote-tracking branch 'origin/dev' into db/scikit-build-core
dudoslav May 24, 2024
dfb32b8
Fix format
dudoslav May 24, 2024
e160a89
Use only one version on numpy
dudoslav May 24, 2024
56f7b76
Also enable python 3.9
dudoslav May 24, 2024
7e7099f
Fix test issue with incorrect slashes in Win
dudoslav May 27, 2024
7f1c3cd
Increment cibuildwheel version
dudoslav May 27, 2024
9c13ff8
Fix syntax error
dudoslav May 27, 2024
09ac7d6
Format code
dudoslav May 27, 2024
2c1699e
Convert Path to str before search
dudoslav May 27, 2024
c9f5b73
Build arm macos wheels on macos-14
dudoslav May 27, 2024
b2f8f14
Add basic CI/CD
dudoslav May 27, 2024
2b4e5d2
Install test dependencies
dudoslav May 27, 2024
a1f8578
Fix docs
dudoslav May 27, 2024
78a09d9
Use macos-13 in ci workflow
dudoslav May 29, 2024
666458e
Try out importlib
dudoslav May 29, 2024
bc12c26
Fix toml error
dudoslav May 29, 2024
39ef85a
Return __init__.py fix
dudoslav May 30, 2024
aa17c85
Improve ci
dudoslav May 30, 2024
113cc03
Add sdist tests
dudoslav May 30, 2024
97e8ff9
Update job dependencies
dudoslav May 30, 2024
1be328a
Fix windows pip install command
dudoslav May 30, 2024
d434cf3
Pull sources for tests
dudoslav May 30, 2024
d8ae95b
Only checkout tests
dudoslav May 30, 2024
c95606e
Sdist tests install pytest and deps
dudoslav May 30, 2024
6456ad5
Disable cone mode add debug
dudoslav May 30, 2024
294bc1e
Checkout whole repo for tests
dudoslav May 30, 2024
6cdc40f
Run sdist tests
dudoslav May 30, 2024
27a3855
Add logging info to cmake
dudoslav May 30, 2024
83f439f
Add verbose to install
dudoslav May 30, 2024
2c4e236
Add additional logs
dudoslav May 30, 2024
c4275f6
Fix macos incorrect processor
dudoslav May 30, 2024
9901082
Remove cmake logs
dudoslav May 30, 2024
b787fda
Improve artefact naming
dudoslav May 30, 2024
80a8d18
Add daily tests
dudoslav May 31, 2024
9dcfd3a
Add logging and no-deps
dudoslav May 31, 2024
9bd795e
Add no-build-isolation
dudoslav May 31, 2024
3dd210a
Remove no-deps
dudoslav May 31, 2024
7eaa19a
Change numpy version using sed
dudoslav May 31, 2024
707da3b
Fix sed command
dudoslav May 31, 2024
2dd5f4a
Macos has sed without -i
dudoslav May 31, 2024
320c02c
Fix sed
dudoslav May 31, 2024
c62733a
Macos sed fix
dudoslav May 31, 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
26 changes: 0 additions & 26 deletions .github/disabled-workflows/release.yml

This file was deleted.

146 changes: 146 additions & 0 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Build and test wheels

on:
workflow_dispatch:
push:
branches:
- release-*
- "*wheel*" # must quote since "*" is a YAML reserved character; we want a string
tags:
- "*"
pull_request:
branches:
- "*wheel*" # must quote since "*" is a YAML reserved character; we want a string

jobs:
build_wheels:
name: Wheel ${{ matrix.buildplat[0] }}-${{ matrix.buildplat[1] }}-${{ matrix.python }}
runs-on: ${{ matrix.buildplat[0] }}
strategy:
matrix:
buildplat:
- [ubuntu-22.04, manylinux_x86_64]
- [macos-13, macosx_x86_64]
- [macos-14, macosx_arm64]
- [windows-2022, win_amd64]
python: ["cp39", "cp310", "cp311", "cp312"]

steps:
- uses: actions/checkout@v4

- name: "Brew setup on macOS" # x-ref c8e49ba8f8b9ce
if: ${{ startsWith(matrix.os, 'macos-') == true }}
run: |
set -e pipefail
brew update
brew install automake pkg-config ninja llvm

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD_VERBOSITY: 3
CIBW_ENVIRONMENT_MACOS: >
CC=clang
CXX=clang++
MACOSX_DEPLOYMENT_TARGET: "11.0"
CIBW_ARCHS: all
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
# __init__.py interferes with the tests and is included as local file instead of
# used from wheels. To be honest, tests should not be in the source folder at all.
CIBW_BEFORE_TEST: rm {project}/tiledb/__init__.py
with:
output-dir: wheelhouse

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.buildplat[1] }}-${{ strategy.job-index }}
path: "./wheelhouse/*.whl"

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
outputs:
sdist_name: ${{ steps.get_sdist_name.outputs.sdist_name }}
steps:
- uses: actions/checkout@v4

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

- name: Get sdist package name
id: get_sdist_name
run: |
echo "sdist_name=$(ls dist/ | head -n 1)" >> "$GITHUB_OUTPUT"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is relying on the file ordering, seems like it could be brittle? Can we construct the sdist name from the version? Or at least it should be ls *.tar.gz to be more specific.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be only one file in /dist since this is completely clean job. But adding *.tar.gz is a good idea.


- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz

test_sdist:
name: Test source distribution package
needs: [build_sdist]
strategy:
matrix:
os:
- macos-13
- macos-14
- windows-2022
- ubuntu-22.04
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: Download sdist artifact
uses: actions/download-artifact@v4
with:
name: sdist
path: dist

- name: Install sdist artifact
run: pip install --verbose dist/${{ needs.build_sdist.outputs.sdist_name }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking but we might want to change this later to run in parallel with the wheel builds, because this will have to build everything from source so it will take some time at the end that could be amortized.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if I understand correctly, but this does run in parallel right now. All jobs (around 40) run in parallel, half is building wheels and half is building sdist and testing it.


- uses: actions/checkout@v4

- name: Install test dependencies
run: pip install pytest hypothesis psutil pyarrow

- name: Run tests
shell: bash
run: |
PROJECT_CWD=$PWD
rm tiledb/__init__.py
cd ..
pytest -vv --showlocals $PROJECT_CWD

upload_pypi:
needs: [build_wheels, test_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
outputs:
package_version: ${{ steps.get_package_version.outputs.package_version }}
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true

- id: get_package_version
run: |
echo "package_version=$(ls dist/ | head -n 1 | cut -d - -f 2)" >> "$GITHUB_OUTPUT"

- name: Upload to test-pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

- name: Upload to pypi
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
92 changes: 21 additions & 71 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ jobs:
shell: bash
strategy:
matrix:
os: [ubuntu-latest, macos-12, windows-latest]
os:
- ubuntu-latest
- macos-13
- macos-14
- windows-latest
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false
env:
# 11.7 necessary due to: https://github.com/actions/setup-python/issues/682#issuecomment-1604261330
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os == 'macos-12' && matrix.python-version == '3.8' && '11.7' || '11' }}
#MACOSX_DEPLOYMENT_TARGET: "10.11"
# On windows-2019 we are using the Visual Studio generator, which is multi-config and places the build artifacts in a subdirectory
MACOSX_DEPLOYMENT_TARGET: "11"
steps:
- name: Checkout TileDB-Py `dev`
uses: actions/checkout@v3
Expand All @@ -31,14 +32,14 @@ jobs:
# latest (14.39 currently).
- name: Setup MSVC toolset (VS 2022)
uses: TheMrMilchmann/setup-msvc-dev@v3
if: matrix.os == 'windows-latest'
if: startsWith(matris.os, 'windows')
with:
arch: x64
toolset: 14.39

- name: Install Ninja (VS 2022)
uses: seanmiddleditch/gha-setup-ninja@v4
if: matrix.os == 'windows-latest'
if: startsWith(matris.os, 'windows')

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -61,79 +62,28 @@ jobs:
# - https://github.com/actions/runner-images/pull/7125
- name: "Install homebrew dependencies"
run: brew install pkg-config
if: matrix.os == 'macos-12'

- name: "Install dependencies"
run: python -m pip install --upgrade -r misc/requirements_ci.txt

- name: "Get TILEDB_VERSION"
run: echo "LIBTILEDB_VERSION=$(python setup.py get_tiledb_version | tail -n 1)" >> $GITHUB_ENV

- name: "Get LIBTILEDB_SHA"
run: echo "LIBTILEDB_SHA=$(git ls-remote https://github.com/TileDB-Inc/TileDB $LIBTILEDB_VERSION | cut -c1-7)" >> $GITHUB_ENV

- name: "Download TileDB From Zip And Build TileDB-Py (Windows)"
run: |
choco install wget --no-progress

if wget https://github.com/TileDB-Inc/TileDB/releases/download/$LIBTILEDB_VERSION/tiledb-windows-x86_64-$LIBTILEDB_VERSION-$LIBTILEDB_SHA.zip; then
mkdir libtiledb
unzip tiledb-windows-x86_64-$LIBTILEDB_VERSION-$LIBTILEDB_SHA.zip -d libtiledb
cp libtiledb/bin/tiledb.dll tiledb
python setup.py develop --tiledb=libtiledb
else
# Build from source as fallback
python setup.py build_ext --inplace
python setup.py develop
fi
env:
TILEDB_FORCE_ALL_DEPS: True
CMAKE_GENERATOR: "Ninja"
if: matrix.os == 'windows-latest'

- name: "Download TileDB From Tarball And Build TileDB-Py (macOS)"
run: |
set -xeo pipefail

if wget https://github.com/TileDB-Inc/TileDB/releases/download/$LIBTILEDB_VERSION/tiledb-macos-x86_64-$LIBTILEDB_VERSION-$LIBTILEDB_SHA.tar.gz; then
mkdir libtiledb
sudo tar -vzxf tiledb-macos-x86_64-$LIBTILEDB_VERSION-$LIBTILEDB_SHA.tar.gz -C libtiledb
python setup.py develop --tiledb=libtiledb
else
# Build from source as fallback
python setup.py build_ext --inplace
python setup.py develop
fi
if: matrix.os == 'macos-12'

- name: "Download TileDB From Tarball And Build TileDB-Py (Linux)"
run: |
set -xeo pipefail

if wget https://github.com/TileDB-Inc/TileDB/releases/download/$LIBTILEDB_VERSION/tiledb-linux-x86_64-$LIBTILEDB_VERSION-$LIBTILEDB_SHA.tar.gz; then
mkdir libtiledb
sudo tar -vzxf tiledb-linux-x86_64-$LIBTILEDB_VERSION-$LIBTILEDB_SHA.tar.gz -C libtiledb
python setup.py develop --tiledb=libtiledb
else
# Build from source as fallback
python setup.py build_ext --inplace
python setup.py develop
fi
if: matrix.os == 'ubuntu-latest'

- name: "Check build directory"
run: ls -Rl
if: startsWith(matris.os, 'macos')

- name: "Install libfaketime (linux and macOS)"
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-12'
if: !startsWith(matris.os, 'windows')
run: |
git clone https://github.com/wolfcw/libfaketime/
cd libfaketime
sudo make install
cd ..

- name: "Build TileDB-Py"
run: pip install --verbose .

- name: "Install test dependencies"
run: pip install pytest hypothesis psutil pyarrow

- name: "Run tests"
run: pytest -vv --showlocals
run: |
PROJECT_CWD=$PWD
rm tiledb/__init__.py
cd /tmp
pytest -vv --showlocals $PROJECT_CWD

- name: "Print log files (failed build only)"
run: |
Expand Down
Loading
Loading