Merge pull request #4421 from Andrew-Chen-Wang/patch-7

Change psycopg2 to psycopg3
This commit is contained in:
Jelmer 2023-06-29 08:58:29 +02:00 committed by GitHub
commit 4ef180edb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -20,14 +20,14 @@ python << END
import sys
import time
import psycopg2
import psycopg
suggest_unrecoverable_after = 30
start = time.time()
while True:
try:
psycopg2.connect(
psycopg.connect(
dbname="${POSTGRES_DB}",
user="${POSTGRES_USER}",
password="${POSTGRES_PASSWORD}",
@ -35,7 +35,7 @@ while True:
port="${POSTGRES_PORT}",
)
break
except psycopg2.OperationalError as error:
except psycopg.OperationalError as error:
sys.stderr.write("Waiting for PostgreSQL to become available...\n")
if time.time() - start > suggest_unrecoverable_after:

View File

@ -3,9 +3,9 @@
Werkzeug[watchdog]==2.3.6 # https://github.com/pallets/werkzeug
ipdb==0.13.13 # https://github.com/gotcha/ipdb
{%- if cookiecutter.use_docker == 'y' %}
psycopg2==2.9.6 # https://github.com/psycopg/psycopg2
psycopg[c]==3.1.9 # https://github.com/psycopg/psycopg
{%- else %}
psycopg2-binary==2.9.6 # https://github.com/psycopg/psycopg2
psycopg[binary]==3.1.9 # https://github.com/psycopg/psycopg
{%- endif %}
{%- if cookiecutter.use_async == 'y' or cookiecutter.use_celery == 'y' %}
watchfiles==0.19.0 # https://github.com/samuelcolvin/watchfiles

View File

@ -3,7 +3,7 @@
-r base.txt
gunicorn==20.1.0 # https://github.com/benoitc/gunicorn
psycopg2==2.9.6 # https://github.com/psycopg/psycopg2
psycopg[c]==3.1.9 # https://github.com/psycopg/psycopg
{%- if cookiecutter.use_whitenoise == 'n' %}
Collectfast==2.2.0 # https://github.com/antonagestam/collectfast
{%- endif %}