From d6b4c4434bb32a6cecb0de252328ee069d343d35 Mon Sep 17 00:00:00 2001 From: Armen Zambrano G Date: Fri, 1 Oct 2021 08:58:06 -0400 Subject: [PATCH] fix(dev): psycopg2-binary 2.9.1 does not work with Django 2.2 For the incompatibility issue with Django visit [this issue][incompatible], In this PR, we're going to downgrade to the compatible 2.8.6 version (thus, matching the Python 3.6 version), removing the need to install `postgresql` (this means partially reverting #28607) and instead installing a wheel I built on my machine that I have stored in GC storage. Fixes #28958 [incompatible]: https://github.com/psycopg/psycopg2/issues/1293 --- .github/workflows/development-environment.yml | 2 +- Makefile | 1 - requirements-base.txt | 4 +--- scripts/lib.sh | 16 ++++++---------- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/development-environment.yml b/.github/workflows/development-environment.yml index 0a53c8e40d6097..9bce8a651561cf 100644 --- a/.github/workflows/development-environment.yml +++ b/.github/workflows/development-environment.yml @@ -51,7 +51,7 @@ jobs: # Xcode CLI & brew are already installed, thus, no need to call xcode-select install continue-on-error: true run: | - make prerequisites + brew bundle -q - name: Setup Python ${{ matrix.python-version }} uses: ./.github/actions/setup-python diff --git a/Makefile b/Makefile index 4975119f607935..ea2191a3be1a46 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,6 @@ install-py-dev : build-platform-assets \ direnv-help \ upgrade-pip \ -prerequisites \ setup-git-config : @SENTRY_NO_VENV_CHECK=1 ./scripts/do.sh $@ diff --git a/requirements-base.txt b/requirements-base.txt index 57869024b34940..044ae9938c258b 100644 --- a/requirements-base.txt +++ b/requirements-base.txt @@ -35,9 +35,7 @@ Pillow==8.2.0; python_version == '3.6' Pillow==8.3.1; python_version > '3.6' progressbar2==3.32.0 python-rapidjson==1.4 -psycopg2-binary==2.8.6; python_version == '3.6' -# For development only: This version removes needing to setting flags for Apple's M1 chipset -psycopg2-binary==2.9.1; python_version > '3.6' +psycopg2-binary==2.8.6 PyJWT==2.1.0 python-dateutil==2.8.1 python-memcached==1.59 diff --git a/scripts/lib.sh b/scripts/lib.sh index ecea3a7cfa8df2..dceb3aad356fbb 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -129,6 +129,12 @@ install-py-dev() { # This helps when getsentry calls into this script cd "${HERE}/.." || exit echo "--> Installing Sentry (for development)" + if query-apple-m1; then + # This installs pyscopg-binary2 since there's no arm64 wheel + # This saves having to install postgresql on the Developer's machine + using flags + # https://github.com/psycopg/psycopg2/issues/1286 + pip install "https://storage.googleapis.com/python-arm64-wheels/psycopg2_binary-2.8.6-cp38-cp38-macosx_11_0_arm64.whl" + fi # SENTRY_LIGHT_BUILD=1 disables webpacking during setup.py. # Webpacked assets are only necessary for devserver (which does it lazily anyways) # and acceptance tests, which webpack automatically if run. @@ -256,16 +262,6 @@ reset-db() { apply-migrations } -prerequisites() { - brew update -q && brew bundle -q - if query-apple-m1; then - # psycopg2-binary does not have an arm64 wheel, thus, we need to build it locally - # by installing postgresql - # See details: https://github.com/psycopg/psycopg2/issues/1286 - brew install postgresql - fi -} - direnv-help() { cat >&2 <