Skip to content

Commit

Permalink
Fix and test setup.py flags to external shared objects
Browse files Browse the repository at this point in the history
  • Loading branch information
jdblischak committed Mar 6, 2024
1 parent 793818d commit 0a9b015
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 2 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/python-so-copying.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,83 @@ jobs:
find . -name '*tile*.so*'
find . -name '*tile*.dylib*'
./venv-soma/bin/python -c "import tiledbsoma; print(tiledbsoma.pytiledbsoma.version())"
# Tests that the --libtiledbsoma flag to setup.py continues working
setuptools:
runs-on: ${{ matrix.os }}
name: "${{ matrix.os }} setuptools"
strategy:
fail-fast: false
matrix:
os: ["ubuntu-22.04", "macos-12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # for setuptools-scm
- name: Install pre-built libtiledb
run: |
mkdir -p external
if [ `uname -s` == "Darwin" ];
then
# Please do not edit manually -- let scripts/update-tiledb-version.py update this
wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.20.1/tiledb-macos-x86_64-2.20.1-249c024.tar.gz
else
# Please do not edit manually -- let scripts/update-tiledb-version.py update this
wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.20.1/tiledb-linux-x86_64-2.20.1-249c024.tar.gz
fi
tar -C external -xzf tiledb-*.tar.gz
ls external/lib/
- name: Build and install libtiledbsoma
run: |
cmake -S libtiledbsoma -B build-libtiledbsoma \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_PREFIX_PATH=$(pwd)/external/ \
-D CMAKE_INSTALL_PREFIX:PATH=$(pwd)/external/ \
-D OVERRIDE_INSTALL_PREFIX=OFF \
-D DOWNLOAD_TILEDB_PREBUILT=OFF \
-D FORCE_BUILD_TILEDB=OFF
cmake --build build-libtiledbsoma -j 2
cmake --build build-libtiledbsoma --target install-libtiledbsoma
ls external/lib/
# Delete all cmake executables from the runner. This will ensure that
# tiledbsoma-py has to use the cli flags to find the external
# libtiledbsoma.so and not build it from source by shelling out to cmake
- name: Delete cmake
run: |
echo before
which -a cmake
which -a cmake | xargs sudo rm -f
echo after
which -a cmake || echo cmake removed
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Setup Python virtual env
run: |
python --version
python -m venv ./venv-soma
./venv-soma/bin/python -m pip install --prefer-binary pybind11-global typeguard sparse wheel setuptools
./venv-soma/bin/python -m pip list
- name: Install TileDB-SOMA-Py with setuptools and --libtiledbsoma
run: |
cd apis/python
../../venv-soma/bin/python setup.py install \
--single-version-externally-managed \
--record record.txt \
--tiledb=$GITHUB_WORKSPACE/external/ \
--libtiledbsoma=$GITHUB_WORKSPACE/external/
- name: Check linking and RPATH (Linux)
if: runner.os == 'Linux'
run: |
ldd ./venv-soma/lib/python*/site-packages/tiledbsoma/pytiledbsoma.*.so
readelf -d ./venv-soma/lib/python*/site-packages/tiledbsoma/pytiledbsoma.*.so | grep R*PATH
- name: Check linking and RPATH (macOS)
if: runner.os == 'macOS'
run: |
otool -L ./venv-soma/lib/python*/site-packages/tiledbsoma/pytiledbsoma.*.so
otool -l ./venv-soma/lib/python*/site-packages/tiledbsoma/pytiledbsoma.*.so
- name: Install runtime dependencies
run: ./venv-soma/bin/python -m pip install --prefer-binary `grep -v '^\[' apis/python/src/tiledbsoma.egg-info/requires.txt`
- name: Runtime test
run: ./venv-soma/bin/python -c "import tiledbsoma; print(tiledbsoma.pytiledbsoma.version())"
4 changes: 2 additions & 2 deletions apis/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
tiledbsoma_dir = pathlib.Path(last)
sys.argv.remove(arg)

tiledb_dir = os.environ.get("TILEDB_PATH", None)
tiledb_dir = os.environ.get("TILEDB_PATH", tiledb_dir)
tiledb_given = tiledb_dir is not None
tiledbsoma_dir = os.environ.get("TILEDBSOMA_PATH", None)
tiledbsoma_dir = os.environ.get("TILEDBSOMA_PATH", tiledbsoma_dir)

if tiledbsoma_dir is not None and tiledb_dir is None:
raise ValueError(
Expand Down

0 comments on commit 0a9b015

Please sign in to comment.