|
2 | 2 |
|
3 | 3 | set -e |
4 | 4 |
|
5 | | -# ── Standard install ───────────────────────────────────────────────── |
6 | | -# Install project dependencies using uv. This section is shared by |
7 | | -# every tox environment and must remain provider-agnostic. |
8 | | -# ───────────────────────────────────────────────────────────────────── |
9 | | - |
10 | 5 | # Check if uv is installed, and install it if not |
11 | 6 | if ! command -v uv &> /dev/null; then |
12 | 7 | echo "uv not found, installing it..." |
|
24 | 19 |
|
25 | 20 | echo "${uv_options[*]}" |
26 | 21 |
|
27 | | -# Default to empty, to ensure snowflake_path variable is defined. |
| 22 | +# Default to empty, to ensure variables are defined. |
28 | 23 | snowflake_path=${snowflake_path:-""} |
| 24 | +ud_connector_path=${ud_connector_path:-""} |
29 | 25 | python_version=$(python -c 'import sys; print(f"cp{sys.version_info.major}{sys.version_info.minor}")') |
30 | 26 |
|
31 | | -if [[ -z "${snowflake_path}" ]]; then |
32 | | - echo "Using Python Connector from PyPI" |
| 27 | +if [[ -n "${ud_connector_path}" ]]; then |
| 28 | + echo "Installing Universal Driver connector" |
| 29 | + echo "UD connector path: ${ud_connector_path}" |
| 30 | + # Install all deps normally (old connector gets pulled in via snowflake-connector-python>=3.17.0) |
33 | 31 | uv pip install ${uv_options[@]} |
34 | | -else |
| 32 | + # Remove old connector and install UD in its place. |
| 33 | + # --reinstall ensures wheel files are always extracted even if the version |
| 34 | + # matches a previous install (uv otherwise skips re-extraction silently). |
| 35 | + uv pip uninstall snowflake-connector-python |
| 36 | + uv pip install --reinstall "${ud_connector_path}" |
| 37 | +elif [[ -n "${snowflake_path}" ]]; then |
35 | 38 | echo "Installing locally built Python Connector" |
36 | 39 | echo "Python Connector path: ${snowflake_path}" |
37 | 40 | ls -al ${snowflake_path} |
38 | 41 | uv pip install ${snowflake_path}/snowflake_connector_python*${python_version}*.whl |
39 | 42 | uv pip install ${uv_options[@]} |
40 | | -fi |
41 | | - |
42 | | -# ── Universal Driver connector swap ────────────────────────────────── |
43 | | -# When ud_connector_path is set, replace snowflake-connector-python |
44 | | -# with the Universal Driver build. This is a no-op for normal CI. |
45 | | -# ───────────────────────────────────────────────────────────────────── |
46 | | - |
47 | | -ud_connector_path=${ud_connector_path:-""} |
48 | | -if [[ -n "${ud_connector_path}" ]]; then |
49 | | - echo "Swapping snowflake-connector-python → Universal Driver" |
50 | | - echo " UD connector path: ${ud_connector_path}" |
51 | | - # --reinstall ensures wheel files are always extracted even if the |
52 | | - # version matches a previous install (uv otherwise skips silently). |
53 | | - uv pip uninstall snowflake-connector-python |
54 | | - uv pip install --reinstall "${ud_connector_path}" |
| 43 | +else |
| 44 | + echo "Using Python Connector from PyPI" |
| 45 | + uv pip install ${uv_options[@]} |
55 | 46 | fi |
0 commit comments