Skip to content

Commit

Permalink
chore(dev/release): build BigQuery wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
lidavidm committed Sep 2, 2024
1 parent cda3468 commit b8812b1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion ci/scripts/python_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

set -ex

COMPONENTS="adbc_driver_manager adbc_driver_flightsql adbc_driver_postgresql adbc_driver_sqlite adbc_driver_snowflake"
COMPONENTS="adbc_driver_bigquery adbc_driver_manager adbc_driver_flightsql adbc_driver_postgresql adbc_driver_sqlite adbc_driver_snowflake"

function build_drivers {
local -r source_dir="$1"
Expand All @@ -36,13 +36,15 @@ function build_drivers {
export VCPKG_OVERLAY_TRIPLETS="${source_dir}/ci/vcpkg/triplets/"

if [[ $(uname) == "Linux" ]]; then
export ADBC_BIGQUERY_LIBRARY=${build_dir}/lib/libadbc_driver_bigquery.so
export ADBC_FLIGHTSQL_LIBRARY=${build_dir}/lib/libadbc_driver_flightsql.so
export ADBC_POSTGRESQL_LIBRARY=${build_dir}/lib/libadbc_driver_postgresql.so
export ADBC_SQLITE_LIBRARY=${build_dir}/lib/libadbc_driver_sqlite.so
export ADBC_SNOWFLAKE_LIBRARY=${build_dir}/lib/libadbc_driver_snowflake.so
export VCPKG_DEFAULT_TRIPLET="${VCPKG_ARCH}-linux-static-release"
export CMAKE_ARGUMENTS=""
else # macOS
export ADBC_BIGQUERY_LIBRARY=${build_dir}/lib/libadbc_driver_bigquery.dylib
export ADBC_FLIGHTSQL_LIBRARY=${build_dir}/lib/libadbc_driver_flightsql.dylib
export ADBC_POSTGRESQL_LIBRARY=${build_dir}/lib/libadbc_driver_postgresql.dylib
export ADBC_SQLITE_LIBRARY=${build_dir}/lib/libadbc_driver_sqlite.dylib
Expand Down Expand Up @@ -91,6 +93,7 @@ function build_drivers {
${CMAKE_ARGUMENTS} \
-DVCPKG_OVERLAY_TRIPLETS="${VCPKG_OVERLAY_TRIPLETS}" \
-DVCPKG_TARGET_TRIPLET="${VCPKG_DEFAULT_TRIPLET}" \
-DADBC_DRIVER_BIGQUERY=ON \
-DADBC_DRIVER_FLIGHTSQL=ON \
-DADBC_DRIVER_POSTGRESQL=ON \
-DADBC_DRIVER_SQLITE=ON \
Expand Down
1 change: 1 addition & 0 deletions ci/scripts/python_wheel_unix_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ echo "=== Building C/C++ driver components ==="
build_drivers "${source_dir}" "${build_dir}"

# Check that we don't expose any unwanted symbols
check_visibility $ADBC_BIGQUERY_LIBRARY
check_visibility $ADBC_FLIGHTSQL_LIBRARY
check_visibility $ADBC_POSTGRESQL_LIBRARY
check_visibility $ADBC_SQLITE_LIBRARY
Expand Down
8 changes: 5 additions & 3 deletions ci/scripts/python_wheel_windows_build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,17 @@ cmake ^
-DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake ^
-DCMAKE_UNITY_BUILD=%CMAKE_UNITY_BUILD% ^
-DVCPKG_TARGET_TRIPLET=%VCPKG_TARGET_TRIPLET% ^
-DADBC_DRIVER_POSTGRESQL=ON ^
-DADBC_DRIVER_SQLITE=ON ^
-DADBC_DRIVER_BIGQUERY=ON ^
-DADBC_DRIVER_FLIGHTSQL=ON ^
-DADBC_DRIVER_MANAGER=ON ^
-DADBC_DRIVER_POSTGRESQL=ON ^
-DADBC_DRIVER_SNOWFLAKE=ON ^
-DADBC_DRIVER_SQLITE=ON ^
%source_dir%\c || exit /B 1

cmake --build . --config %CMAKE_BUILD_TYPE% --target install --verbose -j || exit /B 1

set ADBC_BIGQUERY_LIBRARY=%build_dir%\bin\adbc_driver_bigquery.dll
set ADBC_FLIGHTSQL_LIBRARY=%build_dir%\bin\adbc_driver_flightsql.dll
set ADBC_POSTGRESQL_LIBRARY=%build_dir%\bin\adbc_driver_postgresql.dll
set ADBC_SQLITE_LIBRARY=%build_dir%\bin\adbc_driver_sqlite.dll
Expand All @@ -70,7 +72,7 @@ python -m pip install --upgrade pip delvewheel wheel || exit /B 1

FOR /F %%i IN ('python -c "import sysconfig; print(sysconfig.get_platform())"') DO set PLAT_NAME=%%i

FOR %%c IN (adbc_driver_manager adbc_driver_flightsql adbc_driver_postgresql adbc_driver_sqlite adbc_driver_snowflake) DO (
FOR %%c IN (adbc_driver_bigquery adbc_driver_manager adbc_driver_flightsql adbc_driver_postgresql adbc_driver_sqlite adbc_driver_snowflake) DO (
pushd %source_dir%\python\%%c

echo "=== (%PYTHON_VERSION%) Checking %%c version ==="
Expand Down
4 changes: 2 additions & 2 deletions ci/scripts/python_wheel_windows_test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set source_dir=%1

echo "=== (%PYTHON_VERSION%) Installing wheels ==="

FOR %%c IN (adbc_driver_manager adbc_driver_flightsql adbc_driver_postgresql adbc_driver_sqlite adbc_driver_snowflake) DO (
FOR %%c IN (adbc_driver_bigquery adbc_driver_manager adbc_driver_flightsql adbc_driver_postgresql adbc_driver_sqlite adbc_driver_snowflake) DO (
FOR %%w IN (%source_dir%\python\%%c\dist\*.whl) DO (
pip install --no-deps --force-reinstall %%w || exit /B 1
)
Expand All @@ -31,7 +31,7 @@ pip install importlib-resources pytest pyarrow pandas protobuf

echo "=== (%PYTHON_VERSION%) Testing wheels ==="

FOR %%c IN (adbc_driver_manager adbc_driver_flightsql adbc_driver_postgresql adbc_driver_sqlite adbc_driver_snowflake) DO (
FOR %%c IN (adbc_driver_bigquery adbc_driver_manager adbc_driver_flightsql adbc_driver_postgresql adbc_driver_sqlite adbc_driver_snowflake) DO (
echo "=== Testing %%c ==="
python -c "import %%c" || exit /B 1
python -c "import %%c.dbapi" || exit /B 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

# This file is part of 'miniver': https://github.com/jbweston/miniver

version = "1.0.0dev"
version = "1.2.0dev"

# These values are only set if the distribution was created with 'git archive'
# NOTE: must add an export-subst to .gitattributes!
Expand Down

0 comments on commit b8812b1

Please sign in to comment.