Skip to content

[python] Support NumPy 2 #5600

[python] Support NumPy 2

[python] Support NumPy 2 #5600

name: TileDB-SOMA R-Python interop testing
on:
pull_request:
# TODO: leave this enabled for pre-merge signal for now. At some point we may want to go back to
# only having this signal post-merge.
#paths:
# - "apis/python/**"
# - "apis/r/**"
# - "apis/system/**"
push:
branches:
- main
- 'release-*'
workflow_dispatch:
jobs:
ci:
strategy:
matrix:
include:
- { os: ubuntu-latest }
runs-on: ${{ matrix.os }}
steps:
- name: Checkout TileDB-SOMA
uses: actions/checkout@v4
with:
fetch-depth: 0 # ensure we get all tags to inform package version determination
- name: Bootstrap
run: cd apis/r && tools/r-ci.sh bootstrap
- name: Set additional repositories (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
rversion <- paste(strsplit(as.character(getRversion()), split = '\\.')[[1L]][1:2], collapse = '.')
codename <- system('. /etc/os-release; echo ${VERSION_CODENAME}', intern = TRUE)
repo <- "https://tiledb-inc.r-universe.dev"
(opt <- sprintf('options(repos = c("%s/bin/linux/%s/%s", "%s", getOption("repos")))', repo, codename, rversion, repo))
cat(opt, "\n", file = "~/.Rprofile", append = TRUE)
shell: Rscript {0}
- name: Install tiledb-r
run: cd apis/r && Rscript tools/install-tiledb-r.R
- name: Dependencies
run: cd apis/r && Rscript -e "remotes::install_deps(dependencies = TRUE, upgrade = FALSE)"
- name: CMake
uses: lukka/get-cmake@latest
- name: MkVars
run: mkdir ~/.R && echo "CXX17FLAGS=-Wno-deprecated-declarations -Wno-deprecated" > ~/.R/Makevars
# Uncomment these next two stanzas as needed whenever we've just released a new tiledb-r for
# which source is available but CRAN releases (and hence update r2u binaries) are not yet:
#
# IMPORTANT: these two stanzas should remain uncommented _only_ during the propagation time
# between (a) publication of source for a new TileDB-R _upon which_ TileDB-SOMA depends in its
# apis/R/DESCRIPTION file and (b) appearance of binaries.
#
# Please see https://github.com/single-cell-data/TileDB-SOMA/wiki/Branches-and-releases which
# is crucial for anyone doing releases of TileDB-SOMA.
#
# Please edit both files in the same way:
# * r-ci.yml
# * r-python-interop-testing.yml
#
# Do not remove these comments until such time as we have eliminated our dependency on
# the TileDB-R package.
#- name: Install r-universe build of tiledb-r (macOS)
# if: ${{ matrix.os == 'macOS-latest' }}
# run: cd apis/r && Rscript -e "install.packages('tiledb', repos = c('https://eddelbuettel.r-universe.dev', 'https://cloud.r-project.org'))"
#- name: Install r-universe build of tiledb-r (linux)
# if: ${{ matrix.os != 'macOS-latest' }}
# run: cd apis/r && Rscript -e "options(bspm.version.check=TRUE); install.packages('tiledb', repos = c('https://eddelbuettel.r-universe.dev/bin/linux/jammy/4.3/', 'https://cloud.r-project.org'))"
- name: Build and install libtiledbsoma
run: sudo scripts/bld --prefix=/usr/local --no-tiledb-deprecated=true --werror=true && sudo ldconfig
- name: Install R-tiledbsoma
run: |
cd apis/r
R CMD build --no-build-vignettes --no-manual .
FILE=$(ls -1t *.tar.gz | head -n 1)
R CMD INSTALL $FILE
- name: Show R package versions
run: Rscript -e 'tiledbsoma::show_package_versions()'
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
cache-dependency-path: ./apis/python/setup.py
- name: Install tiledbsoma
run: pip -v install -e apis/python[dev] -C "--build-option=--no-tiledb-deprecated "
- name: Show Python package versions
run: |
python -c 'import tiledbsoma; tiledbsoma.show_package_versions()'
python scripts/show-versions.py
- name: Update Packages
run: Rscript -e 'update.packages(ask=FALSE)'
- name: Interop Tests
run: python -m pytest apis/system/tests/
env:
TILEDB_SOMA_INIT_BUFFER_BYTES: 33554432 # accommodate tiny runners