Skip to content

Scikit-build-core build system rework #1988

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

Merged
merged 109 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 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
ce4a643
Properly set RPATH
dudoslav Jun 5, 2024
4007cff
Install numpy version before running tests
dudoslav Jun 5, 2024
1e4f1b2
Fix CI/CD yaml syntax error
dudoslav Jun 5, 2024
fd5e092
Fix typo
dudoslav Jun 5, 2024
1d2186e
Fix more typos
dudoslav Jun 5, 2024
6bc5a88
Fix syntax error
dudoslav Jun 5, 2024
7c191e9
TILEDB_VERSION comment out in CI/CD
dudoslav Jun 5, 2024
e5ec06e
Disable macos arm ci tests
dudoslav Jun 7, 2024
fb02c74
Fix Windows CI/CD pipeline
dudoslav Jun 7, 2024
d2c5d63
Add macos-14-xlarge runner
dudoslav Jun 7, 2024
77411c8
Disable macos-14 tests again
dudoslav Jun 7, 2024
5564bb2
Try decreased fragment size
dudoslav Jun 7, 2024
2d2fd2d
Comment out macos-14
dudoslav Jun 7, 2024
d55e185
Update to 2.24
ihnorton Jun 11, 2024
c257933
Merge remote-tracking branch 'origin/dev' into db/scikit-build-core
ihnorton Jun 11, 2024
5907bab
Merge remote-tracking branch 'origin/dev' into db/scikit-build-core
ihnorton Jun 11, 2024
5216cbd
Merge remote-tracking branch 'origin/dev' into db/scikit-build-core
dudoslav Jun 19, 2024
eb1f75c
Build wheels for python 3.8 as well
dudoslav Jun 19, 2024
eca4e86
CI always upload working folder as artifact
dudoslav Jun 19, 2024
42563d6
Pipx run build for specific python
dudoslav Jun 19, 2024
e18e6ec
Increment actions/checkout version to v4
dudoslav Jun 19, 2024
896eb10
Add common test requirements
dudoslav Jun 19, 2024
367dbe9
Return local-build.sh
dudoslav Jun 19, 2024
5af5085
Remove requirements.txt and add them into pyproject.toml
dudoslav Jun 20, 2024
bbf270e
Fix use of env variables, allow use of TILEDB_VERSION
dudoslav Jun 20, 2024
98ec8cd
Return daily tests
dudoslav Jun 20, 2024
e51cacf
Fix readthedocs ci
dudoslav Jun 20, 2024
01cf151
Fix numpy pipeline
dudoslav Jun 20, 2024
6cbd959
Fix CI
dudoslav Jun 20, 2024
7147fdc
Fix CI
dudoslav Jun 20, 2024
d18fecc
Fix CI
dudoslav Jun 20, 2024
edfd02b
Add debug info to CI
dudoslav Jun 20, 2024
ec2897c
Use TILEDB_VERSION
dudoslav Jun 20, 2024
e2e6e29
Remove debug info
dudoslav Jun 20, 2024
952f4fc
Remove 'dev' CI
dudoslav Jun 20, 2024
655a008
Allow users to pass TILEDB release hash
dudoslav Jun 20, 2024
7fb14bb
Package all files, add debug info remove stripping
dudoslav Jun 21, 2024
7e4aee7
Fix numpy daily test
dudoslav Jun 21, 2024
8b2ada7
Add multiple licenses
dudoslav Jul 1, 2024
3e03d2f
Add external licenses
dudoslav Jul 1, 2024
986196d
Add project license
dudoslav Jul 1, 2024
ab447d8
Merge remote-tracking branch 'origin/dev' into db/scikit-build-core
dudoslav Jul 2, 2024
711ba45
Always include download tiledb in wheel
dudoslav Jul 3, 2024
de47a7e
Remove doc and ci folders from wheel
dudoslav Jul 4, 2024
fb3d692
Remove BUILD_STATE check
dudoslav Jul 4, 2024
f621881
Add extra logging
dudoslav Jul 9, 2024
d18362b
Merge remote-tracking branch 'origin/dev' into db/scikit-build-core
dudoslav Jul 9, 2024
f705ef2
Remove debug info and stripping
dudoslav Jul 22, 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: ["cp38", "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
Copy link
Member

Choose a reason for hiding this comment

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

x-ref https://github.com/pypa/cibuildwheel/issues/1534 probably

# 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"

- 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@v5
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 }}

- 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
103 changes: 31 additions & 72 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,29 @@ jobs:
shell: bash
strategy:
matrix:
os: [ubuntu-latest, macos-12, windows-latest]
os:
- ubuntu-latest
- macos-13
# libfaketime tests fail on macos arm. Disable tests for now.
# - 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
uses: actions/checkout@v4

- name: Setup MSVC toolset (VS 2022)
uses: TheMrMilchmann/setup-msvc-dev@v3
if: matrix.os == 'windows-latest'
if: startsWith(matrix.os, 'windows')
with:
arch: x64

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

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -57,79 +59,29 @@ 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(matrix.os, 'macos')

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

- name: "Build and Install TileDB-Py"
# We use pipx here to produce wheel/sdist to upload as artifact in case of error
run: |
pipx run --python ${{ matrix.python-version }} build
WHEEL_NAME=$(ls dist/*.whl)
pip install --verbose ${WHEEL_NAME}[test]

- 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 All @@ -144,3 +96,10 @@ jobs:
cat $f
done;
if: failure()

- name: "Upload files for debug"
if: always()
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ matrix.python-version }}
path: "."
Loading
Loading