Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update psycopg2 check to be platform-based #141

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 additions & 11 deletions release_creation/bundle/test_archive_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,29 @@ python -m pip install -r "${requirements_file}" \
--find-links ./bundle_pkg_test \
--pre
dbt --version

# make sure psycopg2 is installed, but not psycopg2-binary
echo -n "Checking psycopg2 install..."
if ! pip freeze | grep psycopg2; then
echo "psycopg2 is not installed!"
exit 1
PSYCOPG2_PIP_ENTRY=$(pip list | grep "psycopg2 " || pip list | grep psycopg2-binary)
PSYCOPG2_NAME="${PSYCOPG2_PIP_ENTRY%% *}"
if [[ "$OSTYPE" == linux* && "${PSYCOPG2_NAME}" == "pscyopg2" ]]; then
echo "psycopg2 is installed on linux as expected"
echo ok
else
echo "psycopg2-binary is installed on linux and should not be!"
exit 1
fi
echo ok

echo -n "Checking psycopg2-binary..."
if pip freeze | grep psycopg2-binary; then
echo "psycopg2-binary is installed and should not be!"
exit 1
if [[ "$OSTYPE" == darwin* && "${PSYCOPG2_NAME}" == "pscyopg2-binary" ]]; then
echo "psycopg2-binary is installed on linux as expected"
echo ok
else
echo "psycopg2 is installed on macos and should not be!"
exit 1
fi
echo ok
deactivate
if [[ "$OSTYPE" != linux* && "$OSTYPE" != darwin* ]]; then
echo "unexpected OSTYPE:"
echo "$OSTYPE"
exit 1
fi

deactivate
Loading