From 2325759ba8b9ac14ffa00f71b3c4a19337050c81 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Wed, 24 Apr 2024 13:56:14 -0500 Subject: [PATCH] add script to override dev dependencies in tests (#10023) --- dev-requirements.txt | 2 +- scripts/update_dev_packages.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 scripts/update_dev_packages.sh diff --git a/dev-requirements.txt b/dev-requirements.txt index b7827c7003c..c90f50ea531 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,4 @@ -git+https://github.com/dbt-labs/dbt-adapters.git +git+https://github.com/dbt-labs/dbt-adapters.git@main git+https://github.com/dbt-labs/dbt-adapters.git@main#subdirectory=dbt-tests-adapter git+https://github.com/dbt-labs/dbt-common.git@main git+https://github.com/dbt-labs/dbt-postgres.git@main diff --git a/scripts/update_dev_packages.sh b/scripts/update_dev_packages.sh new file mode 100755 index 00000000000..3f140f04b89 --- /dev/null +++ b/scripts/update_dev_packages.sh @@ -0,0 +1,14 @@ +#!/bin/bash -e +set -e + +repo=$1 +ref=$2 +target_req_file="dev-requirements.txt" + +req_sed_pattern="s|${repo}.git@main|${repo}.git@${ref}|g" +if [[ "$OSTYPE" == darwin* ]]; then + # mac ships with a different version of sed that requires a delimiter arg + sed -i "" "$req_sed_pattern" $target_req_file +else + sed -i "$req_sed_pattern" $target_req_file +fi