Skip to content

Commit 305d935

Browse files
committed
Rollback dependency in pyproject.toml
1 parent 250418d commit 305d935

File tree

12 files changed

+114
-49
lines changed

12 files changed

+114
-49
lines changed

.github/workflows/ci-r-python-interop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
with:
105105
python-version: "3.11"
106106
cache: pip
107-
cache-dependency-path: ./apis/python/setup.py
107+
cache-dependency-path: ./apis/python/pyproject.toml
108108

109109
- name: Install tiledbsoma
110110
# TILEDB_REMOVE_DEPRECATIONS is already set to ON in pyproject.toml

.github/workflows/python-packaging.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
- name: Install dependencies
2727
run: |
28-
pip install --upgrade 'scikit-build-core>=0.10.0' 'pybind11[global]>=2.10.0' 'cmake>=3.21,<4' 'setuptools>=70.1' 'setuptools-scm>=8.0.0'
28+
pip install --upgrade 'build' 'scikit-build-core>=0.10.0' 'pybind11[global]>=2.10.0' 'cmake>=3.21,<4' 'setuptools>=70.1' 'setuptools-scm>=8.0.0'
2929
pip list
3030
3131
- name: Build sdist
@@ -153,15 +153,13 @@ jobs:
153153
env:
154154
CIBW_BUILD: ${{ matrix.python_name }}-${{ matrix.platform }}
155155
CIBW_BUILD_VERBOSITY: 3
156-
CIBW_BEFORE_BUILD_LINUX: ${{ env.CIBW_BEFORE_BUILD_LINUX || '' }}
157-
CIBW_ENVIRONMENT_LINUX: VCPKG_FORCE_SYSTEM_BINARIES=${{ env.VCPKG_FORCE_SYSTEM_BINARIES || '' }}
156+
# Don't pass CMAKE_TOOLCHAIN_FILE from host - it will be set by setup_build_env.sh
157+
# inside the container after vcpkg is bootstrapped
158+
CIBW_ENVIRONMENT_LINUX: "VCPKG_FORCE_SYSTEM_BINARIES=1"
159+
CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=13.3"
158160
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28"
159161
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28"
160162
CIBW_ARCHS_MACOS: "x86_64 arm64"
161-
CMAKE_TOOLCHAIN_FILE: ${{ env.CMAKE_TOOLCHAIN_FILE }}
162-
VCPKG_TARGET_TRIPLET: ${{ env.VCPKG_TARGET_TRIPLET }}
163-
CMAKE_OSX_ARCHITECTURES: ${{ env.CMAKE_OSX_ARCHITECTURES || '' }}
164-
MACOSX_DEPLOYMENT_TARGET: "13.3"
165163

166164
- name: Check wheel name
167165
run: ls -l ./wheelhouse/*.whl

.github/workflows/python-remote-storage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
with:
6060
python-version: ${{ matrix.python_version }}
6161
cache: pip
62-
cache-dependency-path: ./apis/python/setup.py
62+
cache-dependency-path: ./apis/python/pyproject.toml
6363

6464
- name: Check out TileDB-SOMA
6565
uses: actions/checkout@v4

.github/workflows/test-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
with:
6868
python-version: ${{ inputs.python_version }}
6969
cache: pip
70-
cache-dependency-path: ./apis/python/setup.py
70+
cache-dependency-path: ./apis/python/pyproject.toml
7171

7272
- name: Install tiledbsoma
7373
# TILEDB_REMOVE_DEPRECATIONS is already set to ON in pyproject.toml

apis/python/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
cmake_minimum_required(VERSION 3.21)
2+
3+
# set(PYBIND11_FINDPYTHON ON)
4+
5+
26
project(tiledbsoma-python LANGUAGES CXX)
37

48
# Set C++ standard
59
set(CMAKE_CXX_STANDARD 20)
610
set(CMAKE_CXX_STANDARD_REQUIRED ON)
711

812
# Find pybind11
9-
find_package(pybind11 REQUIRED)
13+
# find_package(pybind11 REQUIRED)
1014

1115
# Find Python
12-
find_package(Python COMPONENTS Interpreter Development REQUIRED)
16+
# find_package(Python COMPONENTS Interpreter Development REQUIRED)
1317

1418
# Get version from setuptools_scm generated file or fallback
1519
# setuptools_scm writes version to src/tiledbsoma/_version.py if configured

apis/python/MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ include src/tiledbsoma/*.h
1313
# Python package directory (includes all .py files and subdirectories)
1414
graft src/tiledbsoma
1515

16-
# Requirements files
17-
include requirements_*.txt
16+
# Requirements files are now inlined in pyproject.toml
17+
# No need to include them separately
1818

1919
# Exclude build artifacts and cache files
2020
prune src/tiledbsoma/__pycache__

apis/python/pyproject.toml

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,48 @@ dependencies = [
5151
dynamic = ["version"]
5252

5353
[project.optional-dependencies]
54-
dev = {file = "requirements_dev.txt"}
55-
spatial-io = {file = "requirements_spatial.txt"}
56-
all = {file = ["requirements_dev.txt", "requirements_spatial.txt"]}
54+
# Development dependencies
55+
dev = [
56+
"black",
57+
"dask",
58+
"pytest",
59+
"pytest-cov",
60+
"ruff",
61+
"sparse",
62+
"typeguard==4.4.2",
63+
"types-setuptools",
64+
"more-itertools",
65+
"hypothesis",
66+
"deepdiff",
67+
]
68+
# Spatial I/O dependencies
69+
spatial-io = [
70+
"geopandas",
71+
"tifffile",
72+
"pillow",
73+
"spatialdata>=0.2.5",
74+
"xarray",
75+
"dask",
76+
]
77+
# All optional dependencies (dev + spatial-io)
78+
all = [
79+
"black",
80+
"dask",
81+
"pytest",
82+
"pytest-cov",
83+
"ruff",
84+
"sparse",
85+
"typeguard==4.4.2",
86+
"types-setuptools",
87+
"more-itertools",
88+
"hypothesis",
89+
"deepdiff",
90+
"geopandas",
91+
"tifffile",
92+
"pillow",
93+
"spatialdata>=0.2.5",
94+
"xarray",
95+
]
5796

5897
[tool.scikit-build]
5998
# CMake configuration
@@ -64,6 +103,8 @@ build-dir = "build"
64103
[tool.scikit-build.cmake]
65104
# CMake version requirement (use version instead of minimum-version for scikit-build-core >= 0.8)
66105
version = ">=3.21,<4" # CMake 4 builds are broken on ARM Linux: https://github.com/single-cell-data/TileDB-SOMA/issues/3890
106+
# scikit-build-core automatically picks up CMAKE_TOOLCHAIN_FILE from environment
107+
# We set it in before-build hooks via setup_build_env.sh
67108

68109
[tool.scikit-build.cmake.define]
69110
# CMake build type - Release for production builds
@@ -99,11 +140,19 @@ manylinux-x86_64-image = "manylinux_2_28"
99140
manylinux-aarch64-image = "manylinux_2_28"
100141

101142
# Install system dependencies and bootstrap vcpkg
143+
# Note: vcpkg is checked out inside the container since cibuildwheel only copies apis/python/
144+
# {project} is the temporary directory where cibuildwheel copies the package
102145
before-all = [
103146
"yum install -y git ninja-build perl-IPC-Cmd zip autoconf automake libtool pkg-config",
104-
"bash {project}/apis/python/scripts/setup_build_env.sh",
147+
"git clone --depth 1 https://github.com/microsoft/vcpkg.git {project}/../vcpkg",
148+
"{project}/../vcpkg/bootstrap-vcpkg.sh",
105149
]
106150

151+
# Set up vcpkg environment before each build
152+
# This runs for each Python version and sets environment variables that persist to the build
153+
# We use eval to execute export commands from the script so they persist to the build step
154+
before-build = "export VCPKG_ROOT={project}/../vcpkg && {project}/apis/python/scripts/setup_build_env.sh"
155+
107156
# Environment variables for vcpkg build
108157
environment = {VCPKG_FORCE_SYSTEM_BINARIES = "1"}
109158

@@ -112,10 +161,13 @@ environment = {VCPKG_FORCE_SYSTEM_BINARIES = "1"}
112161
environment = {MACOSX_DEPLOYMENT_TARGET = "13.3"}
113162

114163
# Install system dependencies and bootstrap vcpkg
164+
# Note: vcpkg is checked out inside the container since cibuildwheel only copies apis/python/
165+
# {project} is the temporary directory where cibuildwheel copies the package
115166
before-all = [
116167
"brew update || true",
117168
"brew install automake llvm ninja git || true",
118-
"bash {project}/apis/python/scripts/setup_build_env.sh",
169+
"git clone --depth 1 https://github.com/microsoft/vcpkg.git {project}/../vcpkg",
170+
"{project}/../vcpkg/bootstrap-vcpkg.sh",
119171
]
120172

121173
[tool.cibuildwheel.windows]
@@ -136,7 +188,8 @@ before-all = [
136188
# This allows setuptools_scm to find git tags from the repository root
137189
root = "../.."
138190
# Write version to a file for CMake to read and for runtime access
139-
# When root is set, write_to is relative to the root (repository root)
191+
# When root is set, write_to is resolved relative to the root directory
192+
# So we need to specify the full path from the root
140193
write_to = "apis/python/src/tiledbsoma/_version.py"
141194
# Use git to find version (default behavior)
142195
# This will work with tags like "1.0.0", "v1.0.0", etc.

apis/python/requirements_dev.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

apis/python/requirements_spatial.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

apis/python/scripts/setup_build_env.sh

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,39 @@ PYTHON_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
1010
REPO_ROOT="$(cd "${PYTHON_DIR}/../.." && pwd)"
1111

1212
# Check if vcpkg is already set up
13-
if [ -n "${VCPKG_ROOT:-}" ]; then
14-
echo "Using existing VCPKG_ROOT: ${VCPKG_ROOT}"
15-
export CMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
16-
elif [ -n "${CMAKE_TOOLCHAIN_FILE:-}" ]; then
13+
if [ -n "${CMAKE_TOOLCHAIN_FILE:-}" ] && [ -f "${CMAKE_TOOLCHAIN_FILE}" ]; then
14+
# CMAKE_TOOLCHAIN_FILE is already set and exists - use it
1715
echo "Using existing CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}"
1816
export VCPKG_ROOT="$(dirname "$(dirname "${CMAKE_TOOLCHAIN_FILE}")")"
17+
elif [ -n "${VCPKG_ROOT:-}" ] && [ -d "${VCPKG_ROOT}" ]; then
18+
# VCPKG_ROOT is set and exists - use it
19+
echo "Using existing VCPKG_ROOT: ${VCPKG_ROOT}"
20+
export CMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
1921
else
2022
# Try to find vcpkg in common locations
2123
if [ -d "${REPO_ROOT}/vcpkg" ]; then
2224
export VCPKG_ROOT="${REPO_ROOT}/vcpkg"
25+
elif [ -d "${PYTHON_DIR}/../vcpkg" ]; then
26+
# For cibuildwheel: vcpkg is cloned one level up from apis/python
27+
export VCPKG_ROOT="${PYTHON_DIR}/../vcpkg"
2328
elif [ -d "${HOME}/vcpkg" ]; then
2429
export VCPKG_ROOT="${HOME}/vcpkg"
2530
else
2631
echo "Error: vcpkg not found. Please set VCPKG_ROOT or CMAKE_TOOLCHAIN_FILE environment variable."
32+
echo "Searched locations:"
33+
echo " - ${REPO_ROOT}/vcpkg"
34+
echo " - ${PYTHON_DIR}/../vcpkg"
35+
echo " - ${HOME}/vcpkg"
2736
exit 1
2837
fi
2938

3039
# Bootstrap vcpkg if needed
3140
if [ ! -f "${VCPKG_ROOT}/vcpkg" ] && [ ! -f "${VCPKG_ROOT}/vcpkg.exe" ]; then
3241
echo "Bootstrapping vcpkg..."
33-
if [ "$(uname)" == "Darwin" ]; then
34-
"${VCPKG_ROOT}/bootstrap-vcpkg.sh"
35-
else
36-
"${VCPKG_ROOT}/bootstrap-vcpkg.sh"
37-
fi
42+
"${VCPKG_ROOT}/bootstrap-vcpkg.sh" || {
43+
echo "Error: Failed to bootstrap vcpkg"
44+
exit 1
45+
}
3846
fi
3947

4048
export CMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
@@ -67,6 +75,18 @@ if [ "$(uname)" == "Darwin" ] && [ -z "${CMAKE_OSX_ARCHITECTURES:-}" ]; then
6775
export CMAKE_OSX_ARCHITECTURES="$(uname -m)"
6876
fi
6977

78+
# If -x flag is passed, output export commands instead of executing them
79+
# This allows the script to be sourced or eval'd to set environment variables
80+
if [ "${1:-}" = "-x" ]; then
81+
echo "export VCPKG_ROOT=\"${VCPKG_ROOT}\""
82+
echo "export CMAKE_TOOLCHAIN_FILE=\"${CMAKE_TOOLCHAIN_FILE}\""
83+
echo "export VCPKG_TARGET_TRIPLET=\"${VCPKG_TARGET_TRIPLET}\""
84+
if [ "$(uname)" == "Darwin" ] && [ -n "${CMAKE_OSX_ARCHITECTURES:-}" ]; then
85+
echo "export CMAKE_OSX_ARCHITECTURES=\"${CMAKE_OSX_ARCHITECTURES}\""
86+
fi
87+
exit 0
88+
fi
89+
7090
echo "VCPKG_ROOT: ${VCPKG_ROOT}"
7191
echo "CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}"
7292
echo "VCPKG_TARGET_TRIPLET: ${VCPKG_TARGET_TRIPLET}"

0 commit comments

Comments
 (0)